Logoj0ke.net Open Build Service > Projects > devel > scons > scons-user.html
Sign Up | Log In

File scons-user.html of Package scons

x
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<HTML
3
><HEAD
4
><TITLE
5
>SCons User Guide 0.98.3</TITLE
6
><META
7
NAME="GENERATOR"
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD
9
><BODY
10
CLASS="book"
11
BGCOLOR="#FFFFFF"
12
TEXT="#000000"
13
LINK="#0000FF"
14
VLINK="#840084"
15
ALINK="#0000FF"
16
><DIV
17
CLASS="BOOK"
18
><A
19
NAME="AEN1"
20
></A
21
><DIV
22
CLASS="TITLEPAGE"
23
><H1
24
CLASS="title"
25
><A
26
NAME="AEN2"
27
>SCons User Guide 0.98.3</A
28
></H1
29
><H3
30
CLASS="author"
31
><A
32
NAME="AEN4"
33
></A
34
>Steven Knight</H3
35
><P
36
CLASS="copyright"
37
>Copyright &copy; 2004, 2005, 2006, 2007 Steven Knight</P
38
><DIV
39
CLASS="legalnotice"
40
><P
41
></P
42
><A
43
NAME="AEN12"
44
></A
45
><A
46
NAME="AEN13"
47
></A
48
><BLOCKQUOTE
49
CLASS="BLOCKQUOTE"
50
><P
51
>&#13;
52
  SCons User's Guide Copyright (c) 2004, 2005, 2006, 2007 Steven Knight
53
54
 </P
55
></BLOCKQUOTE
56
><P
57
></P
58
></DIV
59
><HR></DIV
60
><DIV
61
CLASS="TOC"
62
><DL
63
><DT
64
><B
65
>Table of Contents</B
66
></DT
67
><DT
68
><A
69
HREF="#chap-preface"
70
>Preface</A
71
></DT
72
><DD
73
><DL
74
><DT
75
>1. <A
76
HREF="#AEN29"
77
><SPAN
78
CLASS="application"
79
>SCons</SPAN
80
> Principles</A
81
></DT
82
><DT
83
>2. <A
84
HREF="#AEN54"
85
>A Caveat About This Guide's Completeness</A
86
></DT
87
><DT
88
>3. <A
89
HREF="#AEN62"
90
>Acknowledgements</A
91
></DT
92
><DT
93
>4. <A
94
HREF="#AEN83"
95
>Contact</A
96
></DT
97
></DL
98
></DD
99
><DT
100
>1. <A
101
HREF="#chap-build-install"
102
>Building and Installing <SPAN
103
CLASS="application"
104
>SCons</SPAN
105
></A
106
></DT
107
><DD
108
><DL
109
><DT
110
>1.1. <A
111
HREF="#AEN102"
112
>Installing Python</A
113
></DT
114
><DT
115
>1.2. <A
116
HREF="#AEN124"
117
>Installing <SPAN
118
CLASS="application"
119
>SCons</SPAN
120
> From Pre-Built Packages</A
121
></DT
122
><DD
123
><DL
124
><DT
125
>1.2.1. <A
126
HREF="#AEN129"
127
>Installing <SPAN
128
CLASS="application"
129
>SCons</SPAN
130
> on Red Hat (and Other RPM-based) Linux Systems</A
131
></DT
132
><DT
133
>1.2.2. <A
134
HREF="#AEN149"
135
>Installing <SPAN
136
CLASS="application"
137
>SCons</SPAN
138
> on Debian Linux Systems</A
139
></DT
140
><DT
141
>1.2.3. <A
142
HREF="#AEN157"
143
>Installing <SPAN
144
CLASS="application"
145
>SCons</SPAN
146
> on Windows Systems</A
147
></DT
148
></DL
149
></DD
150
><DT
151
>1.3. <A
152
HREF="#AEN166"
153
>Building and Installing <SPAN
154
CLASS="application"
155
>SCons</SPAN
156
> on Any System</A
157
></DT
158
><DD
159
><DL
160
><DT
161
>1.3.1. <A
162
HREF="#AEN194"
163
>Building and Installing Multiple Versions of <SPAN
164
CLASS="application"
165
>SCons</SPAN
166
> Side-by-Side</A
167
></DT
168
><DT
169
>1.3.2. <A
170
HREF="#AEN218"
171
>Installing <SPAN
172
CLASS="application"
173
>SCons</SPAN
174
> in Other Locations</A
175
></DT
176
><DT
177
>1.3.3. <A
178
HREF="#AEN236"
179
>Building and Installing <SPAN
180
CLASS="application"
181
>SCons</SPAN
182
> Without Administrative Privileges</A
183
></DT
184
></DL
185
></DD
186
></DL
187
></DD
188
><DT
189
>2. <A
190
HREF="#chap-simple"
191
>Simple Builds</A
192
></DT
193
><DD
194
><DL
195
><DT
196
>2.1. <A
197
HREF="#AEN256"
198
>Building Simple C / C++ Programs</A
199
></DT
200
><DT
201
>2.2. <A
202
HREF="#AEN288"
203
>Building Object Files</A
204
></DT
205
><DT
206
>2.3. <A
207
HREF="#AEN307"
208
>Simple Java Builds</A
209
></DT
210
><DT
211
>2.4. <A
212
HREF="#AEN328"
213
>Cleaning Up After a Build</A
214
></DT
215
><DT
216
>2.5. <A
217
HREF="#AEN348"
218
>The <TT
219
CLASS="filename"
220
>SConstruct</TT
221
> File</A
222
></DT
223
><DD
224
><DL
225
><DT
226
>2.5.1. <A
227
HREF="#AEN358"
228
><TT
229
CLASS="filename"
230
>SConstruct</TT
231
> Files Are Python Scripts</A
232
></DT
233
><DT
234
>2.5.2. <A
235
HREF="#AEN370"
236
><SPAN
237
CLASS="application"
238
>SCons</SPAN
239
> Functions Are Order-Independent</A
240
></DT
241
></DL
242
></DD
243
><DT
244
>2.6. <A
245
HREF="#AEN420"
246
>Making the <SPAN
247
CLASS="application"
248
>SCons</SPAN
249
> Output Less Verbose</A
250
></DT
251
></DL
252
></DD
253
><DT
254
>3. <A
255
HREF="#chap-less-simple"
256
>Less Simple Things to Do With Builds</A
257
></DT
258
><DD
259
><DL
260
><DT
261
>3.1. <A
262
HREF="#AEN443"
263
>Specifying the Name of the Target (Output) File</A
264
></DT
265
><DT
266
>3.2. <A
267
HREF="#AEN467"
268
>Compiling Multiple Source Files</A
269
></DT
270
><DT
271
>3.3. <A
272
HREF="#AEN489"
273
>Making a list of files with Glob()</A
274
></DT
275
><DT
276
>3.4. <A
277
HREF="#AEN495"
278
>Specifying Single Files Vs. Lists of Files</A
279
></DT
280
><DT
281
>3.5. <A
282
HREF="#AEN513"
283
>Making Lists of Files Easier to Read</A
284
></DT
285
><DT
286
>3.6. <A
287
HREF="#AEN539"
288
>Keyword Arguments</A
289
></DT
290
><DT
291
>3.7. <A
292
HREF="#AEN550"
293
>Compiling Multiple Programs</A
294
></DT
295
><DT
296
>3.8. <A
297
HREF="#AEN564"
298
>Sharing Source Files Between Multiple Programs</A
299
></DT
300
></DL
301
></DD
302
><DT
303
>4. <A
304
HREF="#chap-libraries"
305
>Building and Linking with Libraries</A
306
></DT
307
><DD
308
><DL
309
><DT
310
>4.1. <A
311
HREF="#AEN584"
312
>Building Libraries</A
313
></DT
314
><DD
315
><DL
316
><DT
317
>4.1.1. <A
318
HREF="#AEN603"
319
>Building Libraries From Source Code or Object Files</A
320
></DT
321
><DT
322
>4.1.2. <A
323
HREF="#AEN614"
324
>Building Static Libraries Explicitly:  the <CODE
325
CLASS="function"
326
>StaticLibrary</CODE
327
> Builder</A
328
></DT
329
><DT
330
>4.1.3. <A
331
HREF="#AEN628"
332
>Building Shared (DLL) Libraries:  the <CODE
333
CLASS="function"
334
>SharedLibrary</CODE
335
> Builder</A
336
></DT
337
></DL
338
></DD
339
><DT
340
>4.2. <A
341
HREF="#AEN645"
342
>Linking with Libraries</A
343
></DT
344
><DT
345
>4.3. <A
346
HREF="#AEN672"
347
>Finding Libraries:  the <CODE
348
CLASS="envar"
349
>$LIBPATH</CODE
350
> Construction Variable</A
351
></DT
352
></DL
353
></DD
354
><DT
355
>5. <A
356
HREF="#chap-nodes"
357
>Node Objects</A
358
></DT
359
><DD
360
><DL
361
><DT
362
>5.1. <A
363
HREF="#AEN703"
364
>Builder Methods Return Lists of Target Nodes</A
365
></DT
366
><DT
367
>5.2. <A
368
HREF="#AEN734"
369
>Explicitly Creating File and Directory Nodes</A
370
></DT
371
><DT
372
>5.3. <A
373
HREF="#AEN754"
374
>Printing <CODE
375
CLASS="classname"
376
>Node</CODE
377
> File Names</A
378
></DT
379
><DT
380
>5.4. <A
381
HREF="#AEN766"
382
>Using a <CODE
383
CLASS="classname"
384
>Node</CODE
385
>'s File Name as a String</A
386
></DT
387
></DL
388
></DD
389
><DT
390
>6. <A
391
HREF="#chap-depends"
392
>Dependencies</A
393
></DT
394
><DD
395
><DL
396
><DT
397
>6.1. <A
398
HREF="#AEN802"
399
>Deciding When an Input File Has Changed:  the <CODE
400
CLASS="function"
401
>Decider</CODE
402
> Function</A
403
></DT
404
><DD
405
><DL
406
><DT
407
>6.1.1. <A
408
HREF="#AEN810"
409
>Using MD5 Signatures to Decide if a File Has Changed</A
410
></DT
411
><DT
412
>6.1.2. <A
413
HREF="#AEN853"
414
>Using Time Stamps to Decide If a File Has Changed</A
415
></DT
416
><DT
417
>6.1.3. <A
418
HREF="#AEN899"
419
>Deciding If a File Has Changed Using Both MD Signatures and Time Stamps</A
420
></DT
421
><DT
422
>6.1.4. <A
423
HREF="#AEN924"
424
>Writing Your Own Custom <CODE
425
CLASS="function"
426
>Decider</CODE
427
> Function</A
428
></DT
429
><DT
430
>6.1.5. <A
431
HREF="#AEN941"
432
>Mixing Different Ways of Deciding If a File Has Changed</A
433
></DT
434
></DL
435
></DD
436
><DT
437
>6.2. <A
438
HREF="#AEN958"
439
>Older Functions for Deciding When an Input File Has Changed</A
440
></DT
441
><DD
442
><DL
443
><DT
444
>6.2.1. <A
445
HREF="#AEN963"
446
>The <CODE
447
CLASS="function"
448
>SourceSignatures</CODE
449
> Function</A
450
></DT
451
><DT
452
>6.2.2. <A
453
HREF="#AEN975"
454
>The <CODE
455
CLASS="function"
456
>TargetSignatures</CODE
457
> Function</A
458
></DT
459
></DL
460
></DD
461
><DT
462
>6.3. <A
463
HREF="#AEN1020"
464
>Implicit Dependencies:  The <CODE
465
CLASS="envar"
466
>$CPPPATH</CODE
467
> Construction Variable</A
468
></DT
469
><DT
470
>6.4. <A
471
HREF="#AEN1079"
472
>Caching Implicit Dependencies</A
473
></DT
474
><DD
475
><DL
476
><DT
477
>6.4.1. <A
478
HREF="#AEN1118"
479
>The <TT
480
CLASS="literal"
481
>--implicit-deps-changed</TT
482
> Option</A
483
></DT
484
><DT
485
>6.4.2. <A
486
HREF="#AEN1130"
487
>The <TT
488
CLASS="literal"
489
>--implicit-deps-unchanged</TT
490
> Option</A
491
></DT
492
></DL
493
></DD
494
><DT
495
>6.5. <A
496
HREF="#AEN1143"
497
>Explicit Dependencies:  the <CODE
498
CLASS="function"
499
>Depends</CODE
500
> Function</A
501
></DT
502
><DT
503
>6.6. <A
504
HREF="#AEN1156"
505
>Ignoring Dependencies:  the <CODE
506
CLASS="function"
507
>Ignore</CODE
508
> Function</A
509
></DT
510
><DT
511
>6.7. <A
512
HREF="#AEN1176"
513
>The <CODE
514
CLASS="function"
515
>AlwaysBuild</CODE
516
> Function</A
517
></DT
518
></DL
519
></DD
520
><DT
521
>7. <A
522
HREF="#chap-environments"
523
>Construction Environments</A
524
></DT
525
><DD
526
><DL
527
><DT
528
>7.1. <A
529
HREF="#AEN1224"
530
>Multiple <TT
531
CLASS="literal"
532
>Construction Environments</TT
533
></A
534
></DT
535
><DT
536
>7.2. <A
537
HREF="#AEN1264"
538
>Copying <TT
539
CLASS="literal"
540
>Construction Environments</TT
541
></A
542
></DT
543
><DT
544
>7.3. <A
545
HREF="#AEN1284"
546
>Fetching Values From a <TT
547
CLASS="literal"
548
>Construction Environment</TT
549
></A
550
></DT
551
><DT
552
>7.4. <A
553
HREF="#AEN1307"
554
>Expanding Values From a <TT
555
CLASS="literal"
556
>Construction Environment</TT
557
></A
558
></DT
559
><DT
560
>7.5. <A
561
HREF="#AEN1337"
562
>Modifying a <TT
563
CLASS="literal"
564
>Construction Environment</TT
565
></A
566
></DT
567
><DD
568
><DL
569
><DT
570
>7.5.1. <A
571
HREF="#AEN1342"
572
>Replacing Values in a <TT
573
CLASS="literal"
574
>Construction Environment</TT
575
></A
576
></DT
577
><DT
578
>7.5.2. <A
579
HREF="#AEN1374"
580
>Appending to the End of Values in a <TT
581
CLASS="literal"
582
>Construction Environment</TT
583
></A
584
></DT
585
><DT
586
>7.5.3. <A
587
HREF="#AEN1392"
588
>Appending to the Beginning of Values in a <TT
589
CLASS="literal"
590
>Construction Environment</TT
591
></A
592
></DT
593
></DL
594
></DD
595
></DL
596
></DD
597
><DT
598
>8. <A
599
HREF="#chap-ENV"
600
>Controlling the External Environment Used to Execute Build Commands</A
601
></DT
602
><DD
603
><DL
604
><DT
605
>8.1. <A
606
HREF="#AEN1441"
607
>Propagating <CODE
608
CLASS="varname"
609
>PATH</CODE
610
> From the External Environment</A
611
></DT
612
></DL
613
></DD
614
><DT
615
>9. <A
616
HREF="#chap-command-line"
617
>Controlling a Build From the Command Line</A
618
></DT
619
><DD
620
><DL
621
><DT
622
>9.1. <A
623
HREF="#AEN1465"
624
>Not Having to Specify Command-Line Options Each Time:  the <CODE
625
CLASS="varname"
626
>SCONSFLAGS</CODE
627
> Environment Variable</A
628
></DT
629
><DT
630
>9.2. <A
631
HREF="#AEN1490"
632
>Getting at Command-Line Targets</A
633
></DT
634
><DT
635
>9.3. <A
636
HREF="#AEN1506"
637
>Controlling the Default Targets</A
638
></DT
639
><DD
640
><DL
641
><DT
642
>9.3.1. <A
643
HREF="#AEN1556"
644
>Getting at the List of Default Targets</A
645
></DT
646
></DL
647
></DD
648
><DT
649
>9.4. <A
650
HREF="#AEN1587"
651
>Getting at the List of Build Targets, Regardless of Origin</A
652
></DT
653
><DT
654
>9.5. <A
655
HREF="#AEN1612"
656
>Command-Line <CODE
657
CLASS="varname"
658
>variable</CODE
659
>=<CODE
660
CLASS="varname"
661
>value</CODE
662
> Build Options</A
663
></DT
664
><DT
665
>9.6. <A
666
HREF="#AEN1646"
667
>Controlling Command-Line Build Options</A
668
></DT
669
><DT
670
>9.7. <A
671
HREF="#AEN1672"
672
>Providing Help for Command-Line Build Options</A
673
></DT
674
><DT
675
>9.8. <A
676
HREF="#AEN1687"
677
>Reading Build Options From a File</A
678
></DT
679
><DT
680
>9.9. <A
681
HREF="#AEN1709"
682
>Canned Build Options</A
683
></DT
684
><DD
685
><DL
686
><DT
687
>9.9.1. <A
688
HREF="#AEN1713"
689
>True/False Values:  the <CODE
690
CLASS="function"
691
>BoolOption</CODE
692
> Build Option</A
693
></DT
694
><DT
695
>9.9.2. <A
696
HREF="#AEN1762"
697
>Single Value From a List:  the <CODE
698
CLASS="function"
699
>EnumOption</CODE
700
> Build Option</A
701
></DT
702
><DT
703
>9.9.3. <A
704
HREF="#AEN1827"
705
>Multiple Values From a List:  the <CODE
706
CLASS="function"
707
>ListOption</CODE
708
> Build Option</A
709
></DT
710
><DT
711
>9.9.4. <A
712
HREF="#AEN1849"
713
>Path Names:  the <CODE
714
CLASS="function"
715
>PathOption</CODE
716
> Build Option</A
717
></DT
718
><DT
719
>9.9.5. <A
720
HREF="#AEN1878"
721
>Enabled/Disabled Path Names: the <CODE
722
CLASS="function"
723
>PackageOption</CODE
724
> Build Option</A
725
></DT
726
></DL
727
></DD
728
><DT
729
>9.10. <A
730
HREF="#AEN1895"
731
>Adding Multiple Command-Line Build Options at Once</A
732
></DT
733
></DL
734
></DD
735
><DT
736
>10. <A
737
HREF="#chap-help"
738
>Providing Build Help:  the <CODE
739
CLASS="function"
740
>Help</CODE
741
> Function</A
742
></DT
743
><DT
744
>11. <A
745
HREF="#chap-install"
746
>Installing Files in Other Directories:  the <CODE
747
CLASS="function"
748
>Install</CODE
749
> Builder</A
750
></DT
751
><DD
752
><DL
753
><DT
754
>11.1. <A
755
HREF="#AEN1964"
756
>Installing Multiple Files in a Directory</A
757
></DT
758
><DT
759
>11.2. <A
760
HREF="#AEN1974"
761
>Installing a File Under a Different Name</A
762
></DT
763
><DT
764
>11.3. <A
765
HREF="#AEN1985"
766
>Installing Multiple Files Under Different Names</A
767
></DT
768
></DL
769
></DD
770
><DT
771
>12. <A
772
HREF="#chap-factories"
773
>Platform-Independent File System Manipulation</A
774
></DT
775
><DD
776
><DL
777
><DT
778
>12.1. <A
779
HREF="#AEN2001"
780
>Copying Files or Directories:  The <CODE
781
CLASS="function"
782
>Copy</CODE
783
> Factory</A
784
></DT
785
><DT
786
>12.2. <A
787
HREF="#AEN2033"
788
>Deleting Files or Directories:  The <CODE
789
CLASS="function"
790
>Delete</CODE
791
> Factory</A
792
></DT
793
><DT
794
>12.3. <A
795
HREF="#AEN2058"
796
>Moving (Renaming) Files or Directories:  The <CODE
797
CLASS="function"
798
>Move</CODE
799
> Factory</A
800
></DT
801
><DT
802
>12.4. <A
803
HREF="#AEN2067"
804
>Updating the Modification Time of a File:  The <CODE
805
CLASS="function"
806
>Touch</CODE
807
> Factory</A
808
></DT
809
><DT
810
>12.5. <A
811
HREF="#AEN2076"
812
>Creating a Directory:  The <CODE
813
CLASS="function"
814
>Mkdir</CODE
815
> Factory</A
816
></DT
817
><DT
818
>12.6. <A
819
HREF="#AEN2085"
820
>Changing File or Directory Permissions:  The <CODE
821
CLASS="function"
822
>Chmod</CODE
823
> Factory</A
824
></DT
825
><DT
826
>12.7. <A
827
HREF="#AEN2094"
828
>Executing an action immediately:  the <CODE
829
CLASS="function"
830
>Execute</CODE
831
> Function</A
832
></DT
833
></DL
834
></DD
835
><DT
836
>13. <A
837
HREF="#chap-file-removal"
838
>Preventing Removal of Targets</A
839
></DT
840
><DD
841
><DL
842
><DT
843
>13.1. <A
844
HREF="#AEN2126"
845
>Preventing target removal during build: the <CODE
846
CLASS="function"
847
>Precious</CODE
848
> Function</A
849
></DT
850
><DT
851
>13.2. <A
852
HREF="#AEN2142"
853
>Preventing target removal during clean: the <CODE
854
CLASS="function"
855
>NoClean</CODE
856
> Function</A
857
></DT
858
><DT
859
>13.3. <A
860
HREF="#AEN2156"
861
>Removing additional files during clean: the <CODE
862
CLASS="function"
863
>Clean</CODE
864
> Function</A
865
></DT
866
></DL
867
></DD
868
><DT
869
>14. <A
870
HREF="#chap-hierarchical"
871
>Hierarchical Builds</A
872
></DT
873
><DD
874
><DL
875
><DT
876
>14.1. <A
877
HREF="#AEN2183"
878
><TT
879
CLASS="filename"
880
>SConscript</TT
881
> Files</A
882
></DT
883
><DT
884
>14.2. <A
885
HREF="#AEN2211"
886
>Path Names Are Relative to the <TT
887
CLASS="filename"
888
>SConscript</TT
889
> Directory</A
890
></DT
891
><DT
892
>14.3. <A
893
HREF="#AEN2237"
894
>Top-Level Path Names in Subsidiary <TT
895
CLASS="filename"
896
>SConscript</TT
897
> Files</A
898
></DT
899
><DT
900
>14.4. <A
901
HREF="#AEN2258"
902
>Absolute Path Names</A
903
></DT
904
><DT
905
>14.5. <A
906
HREF="#AEN2268"
907
>Sharing Environments (and Other Variables) Between <TT
908
CLASS="filename"
909
>SConscript</TT
910
> Files</A
911
></DT
912
><DD
913
><DL
914
><DT
915
>14.5.1. <A
916
HREF="#AEN2280"
917
>Exporting Variables</A
918
></DT
919
><DT
920
>14.5.2. <A
921
HREF="#AEN2308"
922
>Importing Variables</A
923
></DT
924
><DT
925
>14.5.3. <A
926
HREF="#AEN2331"
927
>Returning Values From an <TT
928
CLASS="filename"
929
>SConscript</TT
930
> File</A
931
></DT
932
></DL
933
></DD
934
></DL
935
></DD
936
><DT
937
>15. <A
938
HREF="#chap-separate"
939
>Separating Source and Build Directories</A
940
></DT
941
><DD
942
><DL
943
><DT
944
>15.1. <A
945
HREF="#AEN2365"
946
>Specifying a Variant Directory Tree as Part of an <TT
947
CLASS="filename"
948
>SConscript</TT
949
> Call</A
950
></DT
951
><DT
952
>15.2. <A
953
HREF="#AEN2395"
954
>Why <SPAN
955
CLASS="application"
956
>SCons</SPAN
957
> Duplicates Source Files in a Variant Directory Tree</A
958
></DT
959
><DT
960
>15.3. <A
961
HREF="#AEN2412"
962
>Telling <SPAN
963
CLASS="application"
964
>SCons</SPAN
965
> to Not Duplicate Source Files in the Variant Directory Tree</A
966
></DT
967
><DT
968
>15.4. <A
969
HREF="#AEN2428"
970
>The <CODE
971
CLASS="function"
972
>VariantDir</CODE
973
> Function</A
974
></DT
975
><DT
976
>15.5. <A
977
HREF="#AEN2457"
978
>Using <CODE
979
CLASS="function"
980
>VariantDir</CODE
981
> With an <TT
982
CLASS="filename"
983
>SConscript</TT
984
> File</A
985
></DT
986
><DT
987
>15.6. <A
988
HREF="#AEN2476"
989
>Using Glob() with <CODE
990
CLASS="function"
991
>VariantDir</CODE
992
></A
993
></DT
994
></DL
995
></DD
996
><DT
997
>16. <A
998
HREF="#chap-variants"
999
>Variant Builds</A
1000
></DT
1001
><DT
1002
>17. <A
1003
HREF="#chap-builders-writing"
1004
>Writing Your Own Builders</A
1005
></DT
1006
><DD
1007
><DL
1008
><DT
1009
>17.1. <A
1010
HREF="#AEN2514"
1011
>Writing Builders That Execute External Commands</A
1012
></DT
1013
><DT
1014
>17.2. <A
1015
HREF="#AEN2523"
1016
>Attaching a Builder to a <TT
1017
CLASS="literal"
1018
>Construction Environment</TT
1019
></A
1020
></DT
1021
><DT
1022
>17.3. <A
1023
HREF="#AEN2579"
1024
>Letting <SPAN
1025
CLASS="application"
1026
>SCons</SPAN
1027
> Handle The File Suffixes</A
1028
></DT
1029
><DT
1030
>17.4. <A
1031
HREF="#AEN2600"
1032
>Builders That Execute Python Functions</A
1033
></DT
1034
><DT
1035
>17.5. <A
1036
HREF="#AEN2636"
1037
>Builders That Create Actions Using a <TT
1038
CLASS="literal"
1039
>Generator</TT
1040
></A
1041
></DT
1042
><DT
1043
>17.6. <A
1044
HREF="#AEN2679"
1045
>Builders That Modify the Target or Source Lists Using an <TT
1046
CLASS="literal"
1047
>Emitter</TT
1048
></A
1049
></DT
1050
></DL
1051
></DD
1052
><DT
1053
>18. <A
1054
HREF="#chap-builders-commands"
1055
>Not Writing a Builder:  the <CODE
1056
CLASS="function"
1057
>Command</CODE
1058
> Builder</A
1059
></DT
1060
><DT
1061
>19. <A
1062
HREF="#chap-add-method"
1063
>Pseudo-Builders:  the AddMethod function</A
1064
></DT
1065
><DT
1066
>20. <A
1067
HREF="#chap-scanners"
1068
>Writing Scanners</A
1069
></DT
1070
><DD
1071
><DL
1072
><DT
1073
>20.1. <A
1074
HREF="#AEN2744"
1075
>A Simple Scanner Example</A
1076
></DT
1077
></DL
1078
></DD
1079
><DT
1080
>21. <A
1081
HREF="#chap-repositories"
1082
>Building From Code Repositories</A
1083
></DT
1084
><DD
1085
><DL
1086
><DT
1087
>21.1. <A
1088
HREF="#AEN2795"
1089
>The <CODE
1090
CLASS="function"
1091
>Repository</CODE
1092
> Method</A
1093
></DT
1094
><DT
1095
>21.2. <A
1096
HREF="#AEN2806"
1097
>Finding source files in repositories</A
1098
></DT
1099
><DT
1100
>21.3. <A
1101
HREF="#AEN2838"
1102
>Finding <TT
1103
CLASS="literal"
1104
>#include</TT
1105
> files in repositories</A
1106
></DT
1107
><DD
1108
><DL
1109
><DT
1110
>21.3.1. <A
1111
HREF="#AEN2879"
1112
>Limitations on <TT
1113
CLASS="literal"
1114
>#include</TT
1115
> files in repositories</A
1116
></DT
1117
></DL
1118
></DD
1119
><DT
1120
>21.4. <A
1121
HREF="#AEN2920"
1122
>Finding the <TT
1123
CLASS="filename"
1124
>SConstruct</TT
1125
> file in repositories</A
1126
></DT
1127
><DT
1128
>21.5. <A
1129
HREF="#AEN2938"
1130
>Finding derived files in repositories</A
1131
></DT
1132
><DT
1133
>21.6. <A
1134
HREF="#AEN2967"
1135
>Guaranteeing local copies of files</A
1136
></DT
1137
></DL
1138
></DD
1139
><DT
1140
>22. <A
1141
HREF="#chap-sconf"
1142
>Multi-Platform Configuration (<SPAN
1143
CLASS="application"
1144
>Autoconf</SPAN
1145
> Functionality)</A
1146
></DT
1147
><DD
1148
><DL
1149
><DT
1150
>22.1. <A
1151
HREF="#AEN3001"
1152
><TT
1153
CLASS="literal"
1154
>Configure Contexts</TT
1155
></A
1156
></DT
1157
><DT
1158
>22.2. <A
1159
HREF="#AEN3017"
1160
>Checking for the Existence of Header Files</A
1161
></DT
1162
><DT
1163
>22.3. <A
1164
HREF="#AEN3026"
1165
>Checking for the Availability of a Function</A
1166
></DT
1167
><DT
1168
>22.4. <A
1169
HREF="#AEN3031"
1170
>Checking for the Availability of a Library</A
1171
></DT
1172
><DT
1173
>22.5. <A
1174
HREF="#AEN3046"
1175
>Checking for the Availability of a <TT
1176
CLASS="literal"
1177
>typedef</TT
1178
></A
1179
></DT
1180
><DT
1181
>22.6. <A
1182
HREF="#AEN3057"
1183
>Adding Your Own Custom Checks</A
1184
></DT
1185
><DT
1186
>22.7. <A
1187
HREF="#AEN3086"
1188
>Not Configuring When Cleaning Targets</A
1189
></DT
1190
></DL
1191
></DD
1192
><DT
1193
>23. <A
1194
HREF="#chap-caching"
1195
>Caching Built Files</A
1196
></DT
1197
><DD
1198
><DL
1199
><DT
1200
>23.1. <A
1201
HREF="#AEN3102"
1202
>Specifying the Shared Cache Directory</A
1203
></DT
1204
><DT
1205
>23.2. <A
1206
HREF="#AEN3118"
1207
>Keeping Build Output Consistent</A
1208
></DT
1209
><DT
1210
>23.3. <A
1211
HREF="#AEN3132"
1212
>Not Using the Shared Cache for Specific Files</A
1213
></DT
1214
><DT
1215
>23.4. <A
1216
HREF="#AEN3143"
1217
>Disabling the Shared Cache</A
1218
></DT
1219
><DT
1220
>23.5. <A
1221
HREF="#AEN3155"
1222
>Populating a Shared Cache With Already-Built Files</A
1223
></DT
1224
><DT
1225
>23.6. <A
1226
HREF="#AEN3172"
1227
>Minimizing Cache Contention:  the <TT
1228
CLASS="literal"
1229
>--random</TT
1230
> Option</A
1231
></DT
1232
></DL
1233
></DD
1234
><DT
1235
>24. <A
1236
HREF="#chap-alias"
1237
>Alias Targets</A
1238
></DT
1239
><DT
1240
>25. <A
1241
HREF="#chap-java"
1242
>Java Builds</A
1243
></DT
1244
><DD
1245
><DL
1246
><DT
1247
>25.1. <A
1248
HREF="#AEN3232"
1249
>Building Java Class Files:  the <CODE
1250
CLASS="function"
1251
>Java</CODE
1252
> Builder</A
1253
></DT
1254
><DT
1255
>25.2. <A
1256
HREF="#AEN3256"
1257
>How <SPAN
1258
CLASS="application"
1259
>SCons</SPAN
1260
> Handles Java Dependencies</A
1261
></DT
1262
><DT
1263
>25.3. <A
1264
HREF="#AEN3283"
1265
>Building Java Archive (<TT
1266
CLASS="filename"
1267
>.jar</TT
1268
>) Files:  the <CODE
1269
CLASS="function"
1270
>Jar</CODE
1271
> Builder</A
1272
></DT
1273
><DT
1274
>25.4. <A
1275
HREF="#AEN3314"
1276
>Building C Header and Stub Files:  the <CODE
1277
CLASS="function"
1278
>JavaH</CODE
1279
> Builder</A
1280
></DT
1281
><DT
1282
>25.5. <A
1283
HREF="#AEN3368"
1284
>Building RMI Stub and Skeleton Class Files:  the <CODE
1285
CLASS="function"
1286
>RMIC</CODE
1287
> Builder</A
1288
></DT
1289
></DL
1290
></DD
1291
><DT
1292
>26. <A
1293
HREF="#chap-troubleshooting"
1294
>Troubleshooting</A
1295
></DT
1296
><DD
1297
><DL
1298
><DT
1299
>26.1. <A
1300
HREF="#AEN3399"
1301
>Why is That Target Being Rebuilt?  the <TT
1302
CLASS="literal"
1303
>--debug=explain</TT
1304
> Option</A
1305
></DT
1306
><DT
1307
>26.2. <A
1308
HREF="#AEN3449"
1309
>What's in That Construction Environment?  the <CODE
1310
CLASS="function"
1311
>Dump</CODE
1312
> Method</A
1313
></DT
1314
><DT
1315
>26.3. <A
1316
HREF="#AEN3475"
1317
>What Dependencies Does <SPAN
1318
CLASS="application"
1319
>SCons</SPAN
1320
> Know About?  the <TT
1321
CLASS="literal"
1322
>--tree</TT
1323
> Option</A
1324
></DT
1325
><DT
1326
>26.4. <A
1327
HREF="#AEN3545"
1328
>How is <SPAN
1329
CLASS="application"
1330
>SCons</SPAN
1331
> Constructing the Command Lines It Executes?  the <TT
1332
CLASS="literal"
1333
>--debug=presub</TT
1334
> Option</A
1335
></DT
1336
><DT
1337
>26.5. <A
1338
HREF="#AEN3554"
1339
>Where is <SPAN
1340
CLASS="application"
1341
>SCons</SPAN
1342
> Searching for Libraries?  the <TT
1343
CLASS="literal"
1344
>--debug=findlibs</TT
1345
> Option</A
1346
></DT
1347
><DT
1348
>26.6. <A
1349
HREF="#AEN3571"
1350
>Where is <SPAN
1351
CLASS="application"
1352
>SCons</SPAN
1353
> Blowing Up?  the <TT
1354
CLASS="literal"
1355
>--debug=stacktrace</TT
1356
> Option</A
1357
></DT
1358
><DT
1359
>26.7. <A
1360
HREF="#AEN3592"
1361
>How is <SPAN
1362
CLASS="application"
1363
>SCons</SPAN
1364
> Making Its Decisions?  the <TT
1365
CLASS="literal"
1366
>--taskmastertrace</TT
1367
> Option</A
1368
></DT
1369
></DL
1370
></DD
1371
><DT
1372
>A. <A
1373
HREF="#app-variables"
1374
>Construction Variables</A
1375
></DT
1376
><DT
1377
>B. <A
1378
HREF="#app-builders"
1379
>Builders</A
1380
></DT
1381
><DT
1382
>C. <A
1383
HREF="#app-tools"
1384
>Tools</A
1385
></DT
1386
><DT
1387
>D. <A
1388
HREF="#app-tasks"
1389
>Handling Common Tasks</A
1390
></DT
1391
></DL
1392
></DIV
1393
><DIV
1394
CLASS="LOT"
1395
><DL
1396
CLASS="LOT"
1397
><DT
1398
><B
1399
>List of Examples</B
1400
></DT
1401
><DT
1402
>D-1. <A
1403
HREF="#AEN9591"
1404
>Wildcard globbing to create a list of filenames</A
1405
></DT
1406
><DT
1407
>D-2. <A
1408
HREF="#AEN9594"
1409
>Filename extension substitution</A
1410
></DT
1411
><DT
1412
>D-3. <A
1413
HREF="#AEN9597"
1414
>Appending a path prefix to a list of filenames</A
1415
></DT
1416
><DT
1417
>D-4. <A
1418
HREF="#AEN9602"
1419
>Substituting a path prefix with another one</A
1420
></DT
1421
><DT
1422
>D-5. <A
1423
HREF="#AEN9607"
1424
>Filtering a filename list to exclude/retain only a specific set
1425
of extensions</A
1426
></DT
1427
><DT
1428
>D-6. <A
1429
HREF="#AEN9612"
1430
>The "backtick function": run a shell command and capture the
1431
output</A
1432
></DT
1433
></DL
1434
></DIV
1435
><DIV
1436
CLASS="preface"
1437
><HR><H1
1438
><A
1439
NAME="chap-preface"
1440
></A
1441
>Preface</H1
1442
><P
1443
>&#13;
1444
  Thank you for taking the time to read about <SPAN
1445
CLASS="application"
1446
>SCons</SPAN
1447
>.
1448
  <SPAN
1449
CLASS="application"
1450
>SCons</SPAN
1451
> is a next-generation
1452
  software construction tool,
1453
  or make tool--that is, a software utility
1454
  for building software (or other files)
1455
  and keeping built software up-to-date
1456
  whenever the underlying input files change.
1457
1458
  </P
1459
><P
1460
>&#13;
1461
  The most distinctive thing about <SPAN
1462
CLASS="application"
1463
>SCons</SPAN
1464
>
1465
  is that its configuration files are
1466
  actually <SPAN
1467
CLASS="emphasis"
1468
><I
1469
CLASS="emphasis"
1470
>scripts</I
1471
></SPAN
1472
>,
1473
  written in the <SPAN
1474
CLASS="application"
1475
>Python</SPAN
1476
> programming language.
1477
  This is in contrast to most alternative build tools,
1478
  which typically invent a new language to
1479
  configure the build.
1480
  <SPAN
1481
CLASS="application"
1482
>SCons</SPAN
1483
> still has a learning curve, of course,
1484
  because you have to know what functions to call
1485
  to set up your build properly,
1486
  but the underlying syntax used should be familiar
1487
  to anyone who has ever looked at a Python script.
1488
1489
  </P
1490
><P
1491
>&#13;
1492
  Paradoxically,
1493
  using Python as the configuration file format
1494
  makes <SPAN
1495
CLASS="application"
1496
>SCons</SPAN
1497
>
1498
  <SPAN
1499
CLASS="emphasis"
1500
><I
1501
CLASS="emphasis"
1502
>easier</I
1503
></SPAN
1504
>
1505
  for non-programmers to learn
1506
  than the cryptic languages of other build tools,
1507
  which are usually invented by programmers for other programmers.
1508
  This is in no small part due to the
1509
  consistency and readability that are built in to Python.
1510
  It just so happens that making a real, live
1511
  scripting language the basis for the
1512
  configuration files
1513
  makes it a snap for more accomplished programmers
1514
  to do more complicated things with builds,
1515
  as necessary.
1516
1517
  </P
1518
><DIV
1519
CLASS="section"
1520
><HR><H2
1521
CLASS="section"
1522
><A
1523
NAME="AEN29"
1524
>1. <SPAN
1525
CLASS="application"
1526
>SCons</SPAN
1527
> Principles</A
1528
></H2
1529
><P
1530
>&#13;
1531
    There are a few overriding principles
1532
    we try to live up to in designing and implementing <SPAN
1533
CLASS="application"
1534
>SCons</SPAN
1535
>:
1536
1537
    </P
1538
><P
1539
></P
1540
><DIV
1541
CLASS="variablelist"
1542
><DL
1543
><DT
1544
>Correctness</DT
1545
><DD
1546
><P
1547
>&#13;
1548
      First and foremost,
1549
      by default, <SPAN
1550
CLASS="application"
1551
>SCons</SPAN
1552
> guarantees a correct build
1553
      even if it means sacrificing performance a little.
1554
      We strive to guarantee the build is correct
1555
      regardless of how the software being built is structured,
1556
      how it may have been written,
1557
      or how unusual the tools are that build it.
1558
1559
      </P
1560
></DD
1561
><DT
1562
>Performance</DT
1563
><DD
1564
><P
1565
>&#13;
1566
      Given that the build is correct,
1567
      we try to make <SPAN
1568
CLASS="application"
1569
>SCons</SPAN
1570
> build software
1571
      as quickly as possible.
1572
      In particular, wherever we may have needed to slow
1573
      down the default <SPAN
1574
CLASS="application"
1575
>SCons</SPAN
1576
> behavior to guarantee a correct build,
1577
      we also try to make it easy to speed up <SPAN
1578
CLASS="application"
1579
>SCons</SPAN
1580
>
1581
      through optimization options that let you trade off
1582
      guaranteed correctness in all end cases for
1583
      a speedier build in the usual cases.
1584
1585
      </P
1586
></DD
1587
><DT
1588
>Convenience</DT
1589
><DD
1590
><P
1591
>&#13;
1592
      <SPAN
1593
CLASS="application"
1594
>SCons</SPAN
1595
> tries to do as much for you out of the box as reasonable,
1596
      including detecting the right tools on your system
1597
      and using them correctly to build the software.
1598
1599
      </P
1600
></DD
1601
></DL
1602
></DIV
1603
><P
1604
>&#13;
1605
    In a nutshell, we try hard to make <SPAN
1606
CLASS="application"
1607
>SCons</SPAN
1608
> just
1609
    "do the right thing" and build software correctly,
1610
    with a minimum of hassles.
1611
1612
    </P
1613
></DIV
1614
><DIV
1615
CLASS="section"
1616
><HR><H2
1617
CLASS="section"
1618
><A
1619
NAME="AEN54"
1620
>2. A Caveat About This Guide's Completeness</A
1621
></H2
1622
><P
1623
>&#13;
1624
  One word of warning as you read through this Guide:
1625
  Like too much Open Source software out there,
1626
  the <SPAN
1627
CLASS="application"
1628
>SCons</SPAN
1629
> documentation isn't always
1630
  kept up-to-date with the available features.
1631
  In other words,
1632
  there's a lot that <SPAN
1633
CLASS="application"
1634
>SCons</SPAN
1635
> can do that
1636
  isn't yet covered in this User's Guide.
1637
  (Come to think of it,
1638
  that also describes a lot of proprietary software, doesn't it?)
1639
1640
  </P
1641
><P
1642
>&#13;
1643
  Although this User's Guide isn't as complete as we'd like it to be,
1644
  our development process does emphasize
1645
  making sure that the <SPAN
1646
CLASS="application"
1647
>SCons</SPAN
1648
> man page is kept up-to-date
1649
  with new features.
1650
  So if you're trying to figure out how to do something
1651
  that <SPAN
1652
CLASS="application"
1653
>SCons</SPAN
1654
> supports
1655
  but can't find enough (or any) information here,
1656
  it would be worth your while to look
1657
  at the man page to see if the information is covered there.
1658
  And if you do,
1659
  maybe you'd even consider contributing
1660
  a section to the User's Guide
1661
  so the next person looking for
1662
  that information won't have to
1663
  go through the same thing...?
1664
1665
  </P
1666
></DIV
1667
><DIV
1668
CLASS="section"
1669
><HR><H2
1670
CLASS="section"
1671
><A
1672
NAME="AEN62"
1673
>3. Acknowledgements</A
1674
></H2
1675
><P
1676
>&#13;
1677
    <SPAN
1678
CLASS="application"
1679
>SCons</SPAN
1680
> would not exist without a lot of help
1681
    from a lot of people,
1682
    many of whom may not even be aware
1683
    that they helped or served as inspiration.
1684
    So in no particular order,
1685
    and at the risk of leaving out someone:
1686
1687
    </P
1688
><P
1689
>&#13;
1690
    First and foremost,
1691
    <SPAN
1692
CLASS="application"
1693
>SCons</SPAN
1694
> owes a tremendous debt to Bob Sidebotham,
1695
    the original author of the classic Perl-based <SPAN
1696
CLASS="application"
1697
>Cons</SPAN
1698
> tool
1699
    which Bob first released to the world back around 1996.
1700
    Bob's work on Cons classic provided the underlying architecture
1701
    and model of specifying a build configuration
1702
    using a real scripting language.
1703
    My real-world experience working on Cons
1704
    informed many of the design decisions in SCons,
1705
    including the improved parallel build support,
1706
    making Builder objects easily definable by users,
1707
    and separating the build engine from the wrapping interface.
1708
1709
    </P
1710
><P
1711
>&#13;
1712
    Greg Wilson was instrumental in getting
1713
    <SPAN
1714
CLASS="application"
1715
>SCons</SPAN
1716
> started as a real project
1717
    when he initiated the Software Carpentry design
1718
    competition in February 2000.
1719
    Without that nudge,
1720
    marrying the advantages of the Cons classic
1721
    architecture with the readability of Python
1722
    might have just stayed no more than a nice idea.
1723
1724
    </P
1725
><P
1726
>&#13;
1727
    The entire <SPAN
1728
CLASS="application"
1729
>SCons</SPAN
1730
> team have been
1731
    absolutely wonderful to work with,
1732
    and <SPAN
1733
CLASS="application"
1734
>SCons</SPAN
1735
> would be nowhere near as useful a
1736
    tool without the energy, enthusiasm
1737
    and time people have contributed over the past few years.
1738
    The "core team"
1739
    of Chad Austin, Anthony Roach, Charles Crain,
1740
    Steve Leblanc, Gary Oberbrunner, Greg Spencer and Christoph Wiedemann
1741
    have been great about reviewing my (and other) changes
1742
    and catching problems before they get in the code base.
1743
    Of particular technical note:
1744
    Anthony's outstanding and innovative work on the tasking engine
1745
    has given <SPAN
1746
CLASS="application"
1747
>SCons</SPAN
1748
> a vastly superior parallel build model;
1749
    Charles has been the master of the crucial Node infrastructure;
1750
    Christoph's work on the Configure infrastructure
1751
    has added crucial Autoconf-like functionality;
1752
    and Greg has provided excellent support
1753
    for Microsoft Visual Studio.
1754
1755
    </P
1756
><P
1757
>&#13;
1758
    Special thanks to David Snopek for contributing
1759
    his underlying "Autoscons" code that formed
1760
    the basis of Christoph's work with the Configure functionality.
1761
    David was extremely generous in making
1762
    this code available to <SPAN
1763
CLASS="application"
1764
>SCons</SPAN
1765
>,
1766
    given that he initially released it under the GPL
1767
    and <SPAN
1768
CLASS="application"
1769
>SCons</SPAN
1770
> is released under a less-restrictive MIT-style license.
1771
1772
    </P
1773
><P
1774
>&#13;
1775
    Thanks to Peter Miller
1776
    for his splendid change management system, <SPAN
1777
CLASS="application"
1778
>Aegis</SPAN
1779
>,
1780
    which has provided the <SPAN
1781
CLASS="application"
1782
>SCons</SPAN
1783
> project
1784
    with a robust development methodology from day one,
1785
    and which showed me how you could
1786
    integrate incremental regression tests into
1787
    a practical development cycle
1788
    (years before eXtreme Programming arrived on the scene).
1789
1790
    </P
1791
><P
1792
>&#13;
1793
    And last, thanks to Guido van Rossum
1794
    for his elegant scripting language,
1795
    which is the basis not only for the <SPAN
1796
CLASS="application"
1797
>SCons</SPAN
1798
> implementation,
1799
    but for the interface itself.
1800
1801
    </P
1802
></DIV
1803
><DIV
1804
CLASS="section"
1805
><HR><H2
1806
CLASS="section"
1807
><A
1808
NAME="AEN83"
1809
>4. Contact</A
1810
></H2
1811
><P
1812
>&#13;
1813
    The best way to contact people involved with SCons,
1814
    including the author,
1815
    is through the SCons mailing lists.
1816
1817
    </P
1818
><P
1819
>&#13;
1820
    If you want to ask general questions about how to use <SPAN
1821
CLASS="application"
1822
>SCons</SPAN
1823
>
1824
    send email to <TT
1825
CLASS="literal"
1826
>users@scons.tigris.org</TT
1827
>.
1828
1829
    </P
1830
><P
1831
>&#13;
1832
    If you want to contact the <SPAN
1833
CLASS="application"
1834
>SCons</SPAN
1835
> development community directly,
1836
    send email to <TT
1837
CLASS="literal"
1838
>dev@scons.tigris.org</TT
1839
>.
1840
1841
    </P
1842
><P
1843
>&#13;
1844
    If you want to receive announcements about <SPAN
1845
CLASS="application"
1846
>SCons</SPAN
1847
>,
1848
    join the low-volume <TT
1849
CLASS="literal"
1850
>announce@scons.tigris.org</TT
1851
> mailing list.
1852
1853
    </P
1854
></DIV
1855
></DIV
1856
><DIV
1857
CLASS="chapter"
1858
><HR><H1
1859
><A
1860
NAME="chap-build-install"
1861
></A
1862
>Chapter 1. Building and Installing <SPAN
1863
CLASS="application"
1864
>SCons</SPAN
1865
></H1
1866
><P
1867
>&#13;
1868
  This chapter will take you through the basic steps
1869
  of installing <SPAN
1870
CLASS="application"
1871
>SCons</SPAN
1872
> on your system,
1873
  and building <SPAN
1874
CLASS="application"
1875
>SCons</SPAN
1876
> if you don't have a
1877
  pre-built package available
1878
  (or simply prefer the flexibility of building it yourself).
1879
  Before that, however, this chapter will also describe the basic steps
1880
  involved in installing Python on your system,
1881
  in case that is necessary.
1882
  Fortunately, both <SPAN
1883
CLASS="application"
1884
>SCons</SPAN
1885
> and Python
1886
  are very easy to install on almost any system,
1887
  and Python already comes installed on many systems.
1888
1889
  </P
1890
><DIV
1891
CLASS="section"
1892
><HR><H2
1893
CLASS="section"
1894
><A
1895
NAME="AEN102"
1896
>1.1. Installing Python</A
1897
></H2
1898
><P
1899
>&#13;
1900
    Because <SPAN
1901
CLASS="application"
1902
>SCons</SPAN
1903
> is written in Python,
1904
    you must obviously have Python installed on your system
1905
    to use <SPAN
1906
CLASS="application"
1907
>SCons</SPAN
1908
>
1909
    Before you try to install Python,
1910
    you should check to see if Python is already
1911
    available on your system  by typing
1912
    <KBD
1913
CLASS="userinput"
1914
>python</KBD
1915
>
1916
    at your system's command-line prompt.
1917
    You should see something like the following
1918
    on a UNIX or Linux system that has Python installed:
1919
1920
    </P
1921
><PRE
1922
CLASS="screen"
1923
>&#13;       $ <KBD
1924
CLASS="userinput"
1925
>python</KBD
1926
>
1927
       Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
1928
       [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
1929
       Type "help", "copyright", "credits" or "license" for more information.
1930
       &#62;&#62;&#62; <KBD
1931
CLASS="userinput"
1932
>^D</KBD
1933
>
1934
    </PRE
1935
><P
1936
>&#13;
1937
    And on a Windows system with Python installed:
1938
1939
    </P
1940
><PRE
1941
CLASS="screen"
1942
>&#13;       C:\&#62;<KBD
1943
CLASS="userinput"
1944
>python</KBD
1945
>
1946
       Python 2.2.2 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
1947
       Type "help", "copyright", "credits" or "license" for more information.
1948
       &#62;&#62;&#62; <KBD
1949
CLASS="userinput"
1950
>^Z</KBD
1951
>
1952
    </PRE
1953
><P
1954
>&#13;
1955
    The <SAMP
1956
CLASS="prompt"
1957
>&#62;&#62;&#62;</SAMP
1958
> is the input prompt
1959
    for the Python interpreter.
1960
    The <KBD
1961
CLASS="userinput"
1962
>^D</KBD
1963
> and <KBD
1964
CLASS="userinput"
1965
>^Z</KBD
1966
>
1967
    represent the CTRL-D and CTRL-Z characters
1968
    that you will need to type to get out of the interpreter
1969
    before proceeding to installing <SPAN
1970
CLASS="application"
1971
>SCons</SPAN
1972
>.
1973
1974
    </P
1975
><P
1976
>&#13;
1977
    If Python is not installed on your system,
1978
    you will see an error message
1979
    stating something like "command not found"
1980
    (on UNIX or Linux)
1981
    or "'python' is not recognized
1982
    as an internal or external command, operable progam or batch file"
1983
    (on Windows).
1984
    In that case, you need to install Python
1985
    before you can install <SPAN
1986
CLASS="application"
1987
>SCons</SPAN
1988
>.
1989
1990
    </P
1991
><P
1992
>&#13;
1993
    The standard location for information
1994
    about downloading and installing Python is
1995
    <A
1996
HREF="http://www.python.org/download/"
1997
TARGET="_top"
1998
>http://www.python.org/download/</A
1999
>.
2000
    See that page for information about
2001
    how to download and install Python on your system.
2002
2003
    </P
2004
></DIV
2005
><DIV
2006
CLASS="section"
2007
><HR><H2
2008
CLASS="section"
2009
><A
2010
NAME="AEN124"
2011
>1.2. Installing <SPAN
2012
CLASS="application"
2013
>SCons</SPAN
2014
> From Pre-Built Packages</A
2015
></H2
2016
><P
2017
>&#13;
2018
    <SPAN
2019
CLASS="application"
2020
>SCons</SPAN
2021
> comes pre-packaged for installation on a number of systems,
2022
    including Linux and Windows systems.
2023
    You do not need to read this entire section,
2024
    you should only need to read the section
2025
    appropriate to the type of system you're running on.
2026
2027
    </P
2028
><DIV
2029
CLASS="section"
2030
><HR><H3
2031
CLASS="section"
2032
><A
2033
NAME="AEN129"
2034
>1.2.1. Installing <SPAN
2035
CLASS="application"
2036
>SCons</SPAN
2037
> on Red Hat (and Other RPM-based) Linux Systems</A
2038
></H3
2039
><P
2040
>&#13;
2041
      <SPAN
2042
CLASS="application"
2043
>SCons</SPAN
2044
> comes in RPM (Red Hat Package Manager) format,
2045
      pre-built and ready to install on Red Hat Linux,
2046
      Fedora Core,
2047
      or any other Linux distribution that uses RPM.
2048
      Your distribution may
2049
      already have an <SPAN
2050
CLASS="application"
2051
>SCons</SPAN
2052
> RPM built specifically for it;
2053
      many do, including SuSe, Mandrake and Fedora.
2054
      You can check for the availability of an <SPAN
2055
CLASS="application"
2056
>SCons</SPAN
2057
> RPM
2058
      on your distribution's download servers,
2059
      or by consulting an RPM search site like
2060
      <A
2061
HREF="http://www.rpmfind.net/"
2062
TARGET="_top"
2063
>http://www.rpmfind.net/</A
2064
> or
2065
      <A
2066
HREF="http://rpm.pbone.net/"
2067
TARGET="_top"
2068
>http://rpm.pbone.net/</A
2069
>.
2070
2071
      </P
2072
><P
2073
>&#13;
2074
      If your Linux distribution does not already have
2075
      a specific <SPAN
2076
CLASS="application"
2077
>SCons</SPAN
2078
> RPM file,
2079
      you can download and install from the
2080
      generic RPM provided by the <SPAN
2081
CLASS="application"
2082
>SCons</SPAN
2083
> project.
2084
      This will install the 
2085
      SCons script(s) in <TT
2086
CLASS="filename"
2087
>/usr/bin</TT
2088
>,
2089
      and the SCons library modules in
2090
      <TT
2091
CLASS="filename"
2092
>/usr/lib/scons</TT
2093
>.
2094
2095
      </P
2096
><P
2097
>&#13;
2098
      To install from the command line, simply download the
2099
      appropriate <TT
2100
CLASS="filename"
2101
>.rpm</TT
2102
> file,
2103
      and then run:
2104
2105
      </P
2106
><PRE
2107
CLASS="screen"
2108
>&#13;        # <KBD
2109
CLASS="userinput"
2110
>rpm -Uvh scons-0.96-1.noarch.rpm</KBD
2111
>
2112
      </PRE
2113
><P
2114
>&#13;
2115
      Or, you can use a graphical RPM package manager
2116
      like <SPAN
2117
CLASS="application"
2118
>gnorpm</SPAN
2119
>.
2120
      See your package manager application's documention
2121
      for specific instructions about
2122
      how to use it to install a downloaded RPM.
2123
2124
      </P
2125
></DIV
2126
><DIV
2127
CLASS="section"
2128
><HR><H3
2129
CLASS="section"
2130
><A
2131
NAME="AEN149"
2132
>1.2.2. Installing <SPAN
2133
CLASS="application"
2134
>SCons</SPAN
2135
> on Debian Linux Systems</A
2136
></H3
2137
><P
2138
>&#13;
2139
      Debian Linux systems use a different package management
2140
      format that also makes it very easy to install <SPAN
2141
CLASS="application"
2142
>SCons</SPAN
2143
>.
2144
2145
      </P
2146
><P
2147
>&#13;
2148
      If your system is connected to the Internet,
2149
      you can install the latest official Debian package
2150
      by running:
2151
2152
      </P
2153
><PRE
2154
CLASS="screen"
2155
>&#13;        # <KBD
2156
CLASS="userinput"
2157
>apt-get install scons</KBD
2158
>
2159
      </PRE
2160
></DIV
2161
><DIV
2162
CLASS="section"
2163
><HR><H3
2164
CLASS="section"
2165
><A
2166
NAME="AEN157"
2167
>1.2.3. Installing <SPAN
2168
CLASS="application"
2169
>SCons</SPAN
2170
> on Windows Systems</A
2171
></H3
2172
><P
2173
>&#13;
2174
      <SPAN
2175
CLASS="application"
2176
>SCons</SPAN
2177
> provides a Windows installer
2178
      that makes installation extremely easy.
2179
      Download the <TT
2180
CLASS="filename"
2181
>scons-0.95.win32.exe</TT
2182
>
2183
      file from the <SPAN
2184
CLASS="application"
2185
>SCons</SPAN
2186
> download page at
2187
      <A
2188
HREF="http://www.scons.org/download.html"
2189
TARGET="_top"
2190
>http://www.scons.org/download.html</A
2191
>.
2192
      Then all you need to do is execute the file
2193
      (usually by clicking on its icon in Windows Explorer).
2194
      These will take you through a small
2195
      sequence of windows that will install
2196
      <SPAN
2197
CLASS="application"
2198
>SCons</SPAN
2199
> on your system.
2200
2201
      
2202
2203
      </P
2204
></DIV
2205
></DIV
2206
><DIV
2207
CLASS="section"
2208
><HR><H2
2209
CLASS="section"
2210
><A
2211
NAME="AEN166"
2212
>1.3. Building and Installing <SPAN
2213
CLASS="application"
2214
>SCons</SPAN
2215
> on Any System</A
2216
></H2
2217
><P
2218
>&#13;
2219
    If a pre-built <SPAN
2220
CLASS="application"
2221
>SCons</SPAN
2222
> package is not available for your system,
2223
    then you can still easily build and install <SPAN
2224
CLASS="application"
2225
>SCons</SPAN
2226
> using the native
2227
    Python <TT
2228
CLASS="filename"
2229
>distutils</TT
2230
> package.
2231
2232
    </P
2233
><P
2234
>&#13;
2235
    The first step is to download either the
2236
    <TT
2237
CLASS="filename"
2238
>scons-0.98.3.tar.gz</TT
2239
>
2240
    or <TT
2241
CLASS="filename"
2242
>scons-0.98.3.zip</TT
2243
>,
2244
    which are available from the SCons download page at
2245
    <A
2246
HREF="http://www.scons.org/download.html"
2247
TARGET="_top"
2248
>http://www.scons.org/download.html</A
2249
>.
2250
2251
    </P
2252
><P
2253
>&#13;
2254
    Unpack the archive you downloaded,
2255
    using a utility like <SPAN
2256
CLASS="application"
2257
>tar</SPAN
2258
>
2259
    on Linux or UNIX,
2260
    or <SPAN
2261
CLASS="application"
2262
>WinZip</SPAN
2263
> on Windows.
2264
    This will create a directory called
2265
    <TT
2266
CLASS="filename"
2267
>scons-0.98.3</TT
2268
>,
2269
    usually in your local directory.
2270
    Then change your working directory to that directory
2271
    and install <SPAN
2272
CLASS="application"
2273
>SCons</SPAN
2274
> by executing the following commands:
2275
2276
    </P
2277
><PRE
2278
CLASS="screen"
2279
>&#13;      # <KBD
2280
CLASS="userinput"
2281
>cd scons-0.98.3</KBD
2282
>
2283
      # <KBD
2284
CLASS="userinput"
2285
>python setup.py install</KBD
2286
>
2287
    </PRE
2288
><P
2289
>&#13;
2290
    This will build <SPAN
2291
CLASS="application"
2292
>SCons</SPAN
2293
>,
2294
    install the <SPAN
2295
CLASS="application"
2296
>scons</SPAN
2297
> script
2298
    in the default system scripts directory
2299
    (<TT
2300
CLASS="filename"
2301
>/usr/local/bin</TT
2302
> or
2303
    <TT
2304
CLASS="filename"
2305
>C:\Python2.2\Scripts</TT
2306
>),
2307
    and will install the <SPAN
2308
CLASS="application"
2309
>SCons</SPAN
2310
> build engine
2311
    in an appropriate stand-alone library directory
2312
    (<TT
2313
CLASS="filename"
2314
>/usr/local/lib/scons</TT
2315
> or
2316
    <TT
2317
CLASS="filename"
2318
>C:\Python2.2\scons</TT
2319
>).
2320
    Because these are system directories,
2321
    you may need root (on Linux or UNIX) or Administrator (on Windows)
2322
    privileges to install <SPAN
2323
CLASS="application"
2324
>SCons</SPAN
2325
> like this.
2326
2327
    </P
2328
><DIV
2329
CLASS="section"
2330
><HR><H3
2331
CLASS="section"
2332
><A
2333
NAME="AEN194"
2334
>1.3.1. Building and Installing Multiple Versions of <SPAN
2335
CLASS="application"
2336
>SCons</SPAN
2337
> Side-by-Side</A
2338
></H3
2339
><P
2340
>&#13;
2341
      The <SPAN
2342
CLASS="application"
2343
>SCons</SPAN
2344
> <TT
2345
CLASS="filename"
2346
>setup.py</TT
2347
> script
2348
      has some extensions that support
2349
      easy installation of multiple versions of <SPAN
2350
CLASS="application"
2351
>SCons</SPAN
2352
>
2353
      in side-by-side locations.
2354
      This makes it easier to download and
2355
      experiment with different versions of <SPAN
2356
CLASS="application"
2357
>SCons</SPAN
2358
>
2359
      before moving your official build process to a new version,
2360
      for example.
2361
2362
      </P
2363
><P
2364
>&#13;
2365
      To install <SPAN
2366
CLASS="application"
2367
>SCons</SPAN
2368
> in a version-specific location,
2369
      add the <CODE
2370
CLASS="option"
2371
>--version-lib</CODE
2372
> option
2373
      when you call <TT
2374
CLASS="filename"
2375
>setup.py</TT
2376
>:
2377
2378
      </P
2379
><PRE
2380
CLASS="screen"
2381
>&#13;        # <KBD
2382
CLASS="userinput"
2383
>python setup.py install --version-lib</KBD
2384
>
2385
      </PRE
2386
><P
2387
>&#13;
2388
      This will install the <SPAN
2389
CLASS="application"
2390
>SCons</SPAN
2391
> build engine
2392
      in the
2393
      <TT
2394
CLASS="filename"
2395
>/usr/lib/scons-0.98.3</TT
2396
>
2397
      or
2398
      <TT
2399
CLASS="filename"
2400
>C:\Python2.2\scons-0.98.3</TT
2401
>
2402
      directory, for example.
2403
2404
      </P
2405
><P
2406
>&#13;
2407
      If you use the <CODE
2408
CLASS="option"
2409
>--version-lib</CODE
2410
> option
2411
      the first time you install <SPAN
2412
CLASS="application"
2413
>SCons</SPAN
2414
>,
2415
      you do not need to specify it each time you install
2416
      a new version.
2417
      The <SPAN
2418
CLASS="application"
2419
>SCons</SPAN
2420
> <TT
2421
CLASS="filename"
2422
>setup.py</TT
2423
> script
2424
      will detect the version-specific directory name(s)
2425
      and assume you want to install all versions
2426
      in version-specific directories.
2427
      You can override that assumption in the future
2428
      by explicitly specifying the <CODE
2429
CLASS="option"
2430
>--standalone-lib</CODE
2431
> option.
2432
2433
      </P
2434
></DIV
2435
><DIV
2436
CLASS="section"
2437
><HR><H3
2438
CLASS="section"
2439
><A
2440
NAME="AEN218"
2441
>1.3.2. Installing <SPAN
2442
CLASS="application"
2443
>SCons</SPAN
2444
> in Other Locations</A
2445
></H3
2446
><P
2447
>&#13;
2448
      You can install <SPAN
2449
CLASS="application"
2450
>SCons</SPAN
2451
> in locations other than
2452
      the default by specifying the <CODE
2453
CLASS="option"
2454
>--prefix=</CODE
2455
> option:
2456
2457
      </P
2458
><PRE
2459
CLASS="screen"
2460
>&#13;        # <KBD
2461
CLASS="userinput"
2462
>python setup.py install --prefix=/opt/scons</KBD
2463
>
2464
      </PRE
2465
><P
2466
>&#13;
2467
      This would
2468
      install the <SPAN
2469
CLASS="application"
2470
>scons</SPAN
2471
> script in
2472
      <TT
2473
CLASS="filename"
2474
>/opt/scons/bin</TT
2475
>
2476
      and the build engine in 
2477
      <TT
2478
CLASS="filename"
2479
>/opt/scons/lib/scons</TT
2480
>,
2481
2482
      </P
2483
><P
2484
>&#13;
2485
      Note that you can specify both the <CODE
2486
CLASS="option"
2487
>--prefix=</CODE
2488
>
2489
      and the <CODE
2490
CLASS="option"
2491
>--version-lib</CODE
2492
> options
2493
      at the same type,
2494
      in which case <TT
2495
CLASS="filename"
2496
>setup.py</TT
2497
>
2498
      will install the build engine
2499
      in a version-specific directory
2500
      relative to the specified prefix.
2501
      Adding <CODE
2502
CLASS="option"
2503
>--version-lib</CODE
2504
> to the
2505
      above example would install the build engine in
2506
      <TT
2507
CLASS="filename"
2508
>/opt/scons/lib/scons-0.98.3</TT
2509
>.
2510
2511
      </P
2512
></DIV
2513
><DIV
2514
CLASS="section"
2515
><HR><H3
2516
CLASS="section"
2517
><A
2518
NAME="AEN236"
2519
>1.3.3. Building and Installing <SPAN
2520
CLASS="application"
2521
>SCons</SPAN
2522
> Without Administrative Privileges</A
2523
></H3
2524
><P
2525
>&#13;
2526
      If you don't have the right privileges to install <SPAN
2527
CLASS="application"
2528
>SCons</SPAN
2529
>
2530
      in a system location,
2531
      simply use the <TT
2532
CLASS="literal"
2533
>--prefix=</TT
2534
> option
2535
      to install it in a location of your choosing.
2536
      For example,
2537
      to install <SPAN
2538
CLASS="application"
2539
>SCons</SPAN
2540
> in appropriate locations
2541
      relative to the user's <TT
2542
CLASS="literal"
2543
>$HOME</TT
2544
> directory,
2545
      the <SPAN
2546
CLASS="application"
2547
>scons</SPAN
2548
> script in
2549
      <TT
2550
CLASS="filename"
2551
>$HOME/bin</TT
2552
>
2553
      and the build engine in 
2554
      <TT
2555
CLASS="filename"
2556
>$HOME/lib/scons</TT
2557
>,
2558
      simply type:
2559
2560
      </P
2561
><PRE
2562
CLASS="screen"
2563
>&#13;        $ <KBD
2564
CLASS="userinput"
2565
>python setup.py install --prefix=$HOME</KBD
2566
>
2567
      </PRE
2568
><P
2569
>&#13;
2570
      You may, of course, specify any other location you prefer,
2571
      and may use the <CODE
2572
CLASS="option"
2573
>--version-lib</CODE
2574
> option
2575
      if you would like to install version-specific directories
2576
      relative to the specified prefix.
2577
2578
      </P
2579
></DIV
2580
></DIV
2581
></DIV
2582
><DIV
2583
CLASS="chapter"
2584
><HR><H1
2585
><A
2586
NAME="chap-simple"
2587
></A
2588
>Chapter 2. Simple Builds</H1
2589
><P
2590
>&#13;
2591
 In this chapter,
2592
 you will see several examples of
2593
 very simple build configurations using <SPAN
2594
CLASS="application"
2595
>SCons</SPAN
2596
>,
2597
 which will demonstrate how easy
2598
 it is to use <SPAN
2599
CLASS="application"
2600
>SCons</SPAN
2601
> to
2602
 build programs from several different programming languages
2603
 on different types of systems.
2604
2605
 </P
2606
><DIV
2607
CLASS="section"
2608
><HR><H2
2609
CLASS="section"
2610
><A
2611
NAME="AEN256"
2612
>2.1. Building Simple C / C++ Programs</A
2613
></H2
2614
><P
2615
>&#13;
2616
   Here's the famous "Hello, World!" program in C:
2617
2618
   </P
2619
><PRE
2620
CLASS="programlisting"
2621
>&#13;      int
2622
      main()
2623
      {
2624
          printf("Hello, world!\n");
2625
      }
2626
   </PRE
2627
><P
2628
>&#13;
2629
   And here's how to build it using <SPAN
2630
CLASS="application"
2631
>SCons</SPAN
2632
>.
2633
   Enter the following into a file named <TT
2634
CLASS="filename"
2635
>SConstruct</TT
2636
>:
2637
2638
   </P
2639
><PRE
2640
CLASS="programlisting"
2641
>&#13;      Program('hello.c')
2642
   </PRE
2643
><P
2644
>&#13;
2645
   This minimal configuration file gives
2646
   <SPAN
2647
CLASS="application"
2648
>SCons</SPAN
2649
> two pieces of information:
2650
   what you want to build
2651
   (an executable program),
2652
   and the input file from
2653
   which you want it built
2654
   (the <TT
2655
CLASS="filename"
2656
>hello.c</TT
2657
> file).
2658
   <A
2659
HREF="#b-Program"
2660
><CODE
2661
CLASS="function"
2662
>Program</CODE
2663
></A
2664
> is a <I
2665
CLASS="firstterm"
2666
>builder_method</I
2667
>,
2668
   a Python call that tells <SPAN
2669
CLASS="application"
2670
>SCons</SPAN
2671
> that you want to build an
2672
   executable program.
2673
2674
   </P
2675
><P
2676
>&#13;
2677
   That's it.  Now run the <SPAN
2678
CLASS="application"
2679
>scons</SPAN
2680
> command to build the program.
2681
   On a POSIX-compliant system like Linux or UNIX,
2682
   you'll see something like:
2683
2684
   </P
2685
><PRE
2686
CLASS="screen"
2687
>&#13;      % <KBD
2688
CLASS="userinput"
2689
>scons</KBD
2690
>
2691
      scons: Reading SConscript files ...
2692
      scons: done reading SConscript files.
2693
      scons: Building targets ...
2694
      cc -o hello.o -c hello.c
2695
      cc -o hello hello.o
2696
      scons: done building targets.
2697
   </PRE
2698
><P
2699
>&#13;
2700
   On a Windows system with the Microsoft Visual C++ compiler,
2701
   you'll see something like:
2702
2703
   </P
2704
><PRE
2705
CLASS="screen"
2706
>&#13;      C:\&#62;<KBD
2707
CLASS="userinput"
2708
>scons</KBD
2709
>
2710
      scons: Reading SConscript files ...
2711
      scons: done reading SConscript files.
2712
      scons: Building targets ...
2713
      cl /nologo /c hello.c /Fohello.obj
2714
      link /nologo /OUT:hello.exe hello.obj
2715
      scons: done building targets.
2716
   </PRE
2717
><P
2718
>&#13;
2719
   First, notice that you only need
2720
   to specify the name of the source file,
2721
   and that <SPAN
2722
CLASS="application"
2723
>SCons</SPAN
2724
> correctly deduces the names of
2725
   the object and executable files to be built
2726
   from the base of the source file name.
2727
2728
   </P
2729
><P
2730
>&#13;
2731
   Second, notice that the same input <TT
2732
CLASS="filename"
2733
>SConstruct</TT
2734
> file,
2735
   without any changes,
2736
   generates the correct output file names on both systems:
2737
   <TT
2738
CLASS="filename"
2739
>hello.o</TT
2740
> and <TT
2741
CLASS="filename"
2742
>hello</TT
2743
>
2744
   on POSIX systems,
2745
   <TT
2746
CLASS="filename"
2747
>hello.obj</TT
2748
> and <TT
2749
CLASS="filename"
2750
>hello.exe</TT
2751
>
2752
   on Windows systems.
2753
   This is a simple example of how <SPAN
2754
CLASS="application"
2755
>SCons</SPAN
2756
>
2757
   makes it extremely easy to
2758
   write portable software builds.
2759
2760
   </P
2761
><P
2762
>&#13;
2763
   (Note that we won't provide duplicate side-by-side
2764
   POSIX and Windows output for all of the examples in this guide;
2765
   just keep in mind that, unless otherwise specified,
2766
   any of the examples should work equally well on both types of systems.)
2767
2768
   </P
2769
></DIV
2770
><DIV
2771
CLASS="section"
2772
><HR><H2
2773
CLASS="section"
2774
><A
2775
NAME="AEN288"
2776
>2.2. Building Object Files</A
2777
></H2
2778
><P
2779
>&#13;
2780
   The <A
2781
HREF="#b-Program"
2782
><CODE
2783
CLASS="function"
2784
>Program</CODE
2785
></A
2786
> builder method is only one of
2787
   many builder methods that <SPAN
2788
CLASS="application"
2789
>SCons</SPAN
2790
> provides
2791
   to build different types of files.
2792
   Another is the <A
2793
HREF="#b-Object"
2794
><CODE
2795
CLASS="function"
2796
>Object</CODE
2797
></A
2798
> builder method,
2799
   which tells <SPAN
2800
CLASS="application"
2801
>SCons</SPAN
2802
> to build an object file
2803
   from the specified source file:
2804
2805
   </P
2806
><PRE
2807
CLASS="programlisting"
2808
>&#13;      Object('hello.c')
2809
   </PRE
2810
><P
2811
>&#13;
2812
   Now when you run the <SPAN
2813
CLASS="application"
2814
>scons</SPAN
2815
> command to build the program,
2816
   it will build just the <TT
2817
CLASS="filename"
2818
>hello.o</TT
2819
> object file on a POSIX system:
2820
2821
   </P
2822
><PRE
2823
CLASS="screen"
2824
>&#13;      % <KBD
2825
CLASS="userinput"
2826
>scons</KBD
2827
>
2828
      scons: Reading SConscript files ...
2829
      scons: done reading SConscript files.
2830
      scons: Building targets ...
2831
      cc -o hello.o -c hello.c
2832
      scons: done building targets.
2833
   </PRE
2834
><P
2835
>&#13;
2836
   And just the <TT
2837
CLASS="filename"
2838
>hello.obj</TT
2839
> object file
2840
   on a Windows system (with the Microsoft Visual C++ compiler):
2841
2842
   </P
2843
><PRE
2844
CLASS="screen"
2845
>&#13;      C:\&#62;<KBD
2846
CLASS="userinput"
2847
>scons</KBD
2848
>
2849
      scons: Reading SConscript files ...
2850
      scons: done reading SConscript files.
2851
      scons: Building targets ...
2852
      cl /nologo /c hello.c /Fohello.obj
2853
      scons: done building targets.
2854
   </PRE
2855
></DIV
2856
><DIV
2857
CLASS="section"
2858
><HR><H2
2859
CLASS="section"
2860
><A
2861
NAME="AEN307"
2862
>2.3. Simple Java Builds</A
2863
></H2
2864
><P
2865
>&#13;
2866
   <SPAN
2867
CLASS="application"
2868
>SCons</SPAN
2869
> also makes building with Java extremely easy.
2870
   Unlike the <A
2871
HREF="#b-Program"
2872
><CODE
2873
CLASS="function"
2874
>Program</CODE
2875
></A
2876
> and <A
2877
HREF="#b-Object"
2878
><CODE
2879
CLASS="function"
2880
>Object</CODE
2881
></A
2882
> builder methods,
2883
   however, the <A
2884
HREF="#b-Java"
2885
><CODE
2886
CLASS="function"
2887
>Java</CODE
2888
></A
2889
> builder method
2890
   requires that you specify
2891
   the name of a destination directory in which
2892
   you want the class files placed,
2893
   followed by the source directory
2894
   in which the <TT
2895
CLASS="filename"
2896
>.java</TT
2897
> files live:
2898
2899
   </P
2900
><PRE
2901
CLASS="programlisting"
2902
>&#13;     Java('classes', 'src')
2903
   </PRE
2904
><P
2905
>&#13;
2906
   If the <TT
2907
CLASS="filename"
2908
>src</TT
2909
> directory
2910
   contains a single <TT
2911
CLASS="filename"
2912
>hello.java</TT
2913
> file,
2914
   then the output from running the <SPAN
2915
CLASS="application"
2916
>scons</SPAN
2917
> command
2918
   would look something like this
2919
   (on a POSIX system):
2920
2921
   </P
2922
><PRE
2923
CLASS="screen"
2924
>&#13;      % <KBD
2925
CLASS="userinput"
2926
>scons</KBD
2927
>
2928
      scons: Reading SConscript files ...
2929
      scons: done reading SConscript files.
2930
      scons: Building targets ...
2931
      javac -d classes -sourcepath src src/hello.java
2932
      scons: done building targets.
2933
   </PRE
2934
><P
2935
>&#13;
2936
   We'll cover Java builds in more detail,
2937
   including building Java archive (<TT
2938
CLASS="filename"
2939
>.jar</TT
2940
>)
2941
   and other types of file,
2942
   in <A
2943
HREF="#chap-java"
2944
>Chapter 25</A
2945
>.
2946
2947
   </P
2948
></DIV
2949
><DIV
2950
CLASS="section"
2951
><HR><H2
2952
CLASS="section"
2953
><A
2954
NAME="AEN328"
2955
>2.4. Cleaning Up After a Build</A
2956
></H2
2957
><P
2958
>&#13;
2959
   When using <SPAN
2960
CLASS="application"
2961
>SCons</SPAN
2962
>, it is unnecessary to add special
2963
   commands or target names to clean up after a build.
2964
   Instead, you simply use the
2965
   <TT
2966
CLASS="literal"
2967
>-c</TT
2968
> or <TT
2969
CLASS="literal"
2970
>--clean</TT
2971
>
2972
   option when you invoke <SPAN
2973
CLASS="application"
2974
>SCons</SPAN
2975
>,
2976
   and <SPAN
2977
CLASS="application"
2978
>SCons</SPAN
2979
> removes the appropriate built files.
2980
   So if we build our example above
2981
   and then invoke <TT
2982
CLASS="literal"
2983
>scons -c</TT
2984
>
2985
   afterwards, the output on POSIX looks like:
2986
2987
   </P
2988
><PRE
2989
CLASS="screen"
2990
>&#13;      % <KBD
2991
CLASS="userinput"
2992
>scons</KBD
2993
>
2994
      scons: Reading SConscript files ...
2995
      scons: done reading SConscript files.
2996
      scons: Building targets ...
2997
      cc -o hello.o -c hello.c
2998
      cc -o hello hello.o
2999
      scons: done building targets.
3000
      % <KBD
3001
CLASS="userinput"
3002
>scons -c</KBD
3003
>
3004
      scons: Reading SConscript files ...
3005
      scons: done reading SConscript files.
3006
      scons: Cleaning targets ...
3007
      Removed hello.o
3008
      Removed hello
3009
      scons: done cleaning targets.
3010
   </PRE
3011
><P
3012
>&#13;
3013
   And the output on Windows looks like:
3014
3015
   </P
3016
><PRE
3017
CLASS="screen"
3018
>&#13;      C:\&#62;<KBD
3019
CLASS="userinput"
3020
>scons</KBD
3021
>
3022
      scons: Reading SConscript files ...
3023
      scons: done reading SConscript files.
3024
      scons: Building targets ...
3025
      cl /nologo /c hello.c /Fohello.obj
3026
      link /nologo /OUT:hello.exe hello.obj
3027
      scons: done building targets.
3028
      C:\&#62;<KBD
3029
CLASS="userinput"
3030
>scons -c</KBD
3031
>
3032
      scons: Reading SConscript files ...
3033
      scons: done reading SConscript files.
3034
      scons: Cleaning targets ...
3035
      Removed hello.obj
3036
      Removed hello.exe
3037
      scons: done cleaning targets.
3038
   </PRE
3039
><P
3040
>&#13;
3041
   Notice that <SPAN
3042
CLASS="application"
3043
>SCons</SPAN
3044
> changes its output to tell you that it
3045
   is <TT
3046
CLASS="literal"
3047
>Cleaning targets ...</TT
3048
> and
3049
   <TT
3050
CLASS="literal"
3051
>done cleaning targets.</TT
3052
>
3053
3054
   </P
3055
></DIV
3056
><DIV
3057
CLASS="section"
3058
><HR><H2
3059
CLASS="section"
3060
><A
3061
NAME="AEN348"
3062
>2.5. The <TT
3063
CLASS="filename"
3064
>SConstruct</TT
3065
> File</A
3066
></H2
3067
><P
3068
>&#13;
3069
   If you're used to build systems like <SPAN
3070
CLASS="application"
3071
>Make</SPAN
3072
>
3073
   you've already figured out that the <TT
3074
CLASS="filename"
3075
>SConstruct</TT
3076
> file
3077
   is the <SPAN
3078
CLASS="application"
3079
>SCons</SPAN
3080
> equivalent of a <TT
3081
CLASS="filename"
3082
>Makefile</TT
3083
>.
3084
   That is, the <TT
3085
CLASS="filename"
3086
>SConstruct</TT
3087
> file is the input file
3088
   that <SPAN
3089
CLASS="application"
3090
>SCons</SPAN
3091
> reads to control the build.
3092
3093
   </P
3094
><DIV
3095
CLASS="section"
3096
><HR><H3
3097
CLASS="section"
3098
><A
3099
NAME="AEN358"
3100
>2.5.1. <TT
3101
CLASS="filename"
3102
>SConstruct</TT
3103
> Files Are Python Scripts</A
3104
></H3
3105
><P
3106
>&#13;
3107
     There is, however, an important difference between
3108
     an <TT
3109
CLASS="filename"
3110
>SConstruct</TT
3111
> file and a <TT
3112
CLASS="filename"
3113
>Makefile</TT
3114
>:
3115
     the <TT
3116
CLASS="filename"
3117
>SConstruct</TT
3118
> file is actually a Python script.
3119
     If you're not already familiar with Python, don't worry.
3120
     This User's Guide will introduce you step-by-step
3121
     to the relatively small amount of Python you'll
3122
     need to know to be able to use <SPAN
3123
CLASS="application"
3124
>SCons</SPAN
3125
> effectively.
3126
     And Python is very easy to learn.
3127
3128
     </P
3129
><P
3130
>&#13;
3131
     One aspect of using Python as the
3132
     scripting language is that you can put comments
3133
     in your <TT
3134
CLASS="filename"
3135
>SConstruct</TT
3136
> file using Python's commenting convention;
3137
     that is, everything between a '#' and the end of the line
3138
     will be ignored:
3139
3140
     </P
3141
><PRE
3142
CLASS="programlisting"
3143
>&#13;        # Arrange to build the "hello" program.
3144
        Program('hello.c')    # "hello.c" is the source file.
3145
     </PRE
3146
><P
3147
>&#13;
3148
     You'll see throughout the remainder of this Guide
3149
     that being able to use the power of a
3150
     real scripting language
3151
     can greatly simplify the solutions
3152
     to complex requirements of real-world builds.
3153
3154
     </P
3155
></DIV
3156
><DIV
3157
CLASS="section"
3158
><HR><H3
3159
CLASS="section"
3160
><A
3161
NAME="AEN370"
3162
>2.5.2. <SPAN
3163
CLASS="application"
3164
>SCons</SPAN
3165
> Functions Are Order-Independent</A
3166
></H3
3167
><P
3168
>&#13;
3169
     One important way in which the <TT
3170
CLASS="filename"
3171
>SConstruct</TT
3172
>
3173
     file is not exactly like a normal Python script,
3174
     and is more like a <TT
3175
CLASS="filename"
3176
>Makefile</TT
3177
>,
3178
     is that the order in which
3179
     the <SPAN
3180
CLASS="application"
3181
>SCons</SPAN
3182
> functions are called in
3183
     the <TT
3184
CLASS="filename"
3185
>SConstruct</TT
3186
> file
3187
     does <SPAN
3188
CLASS="emphasis"
3189
><I
3190
CLASS="emphasis"
3191
>not</I
3192
></SPAN
3193
>
3194
     affect the order in which <SPAN
3195
CLASS="application"
3196
>SCons</SPAN
3197
>
3198
     actually builds the programs and object files
3199
     you want it to build.<A
3200
NAME="AEN380"
3201
HREF="#FTN.AEN380"
3202
><SPAN
3203
CLASS="footnote"
3204
>[1]</SPAN
3205
></A
3206
>
3207
     In other words, when you call the <A
3208
HREF="#b-Program"
3209
><CODE
3210
CLASS="function"
3211
>Program</CODE
3212
></A
3213
> builder
3214
     (or any other builder method),
3215
     you're not telling <SPAN
3216
CLASS="application"
3217
>SCons</SPAN
3218
> to build
3219
     the program at the instant the builder method is called.
3220
     Instead, you're telling <SPAN
3221
CLASS="application"
3222
>SCons</SPAN
3223
> to build the program
3224
     that you want, for example,
3225
     a program built from a file named <TT
3226
CLASS="filename"
3227
>hello.c</TT
3228
>,
3229
     and it's up to <SPAN
3230
CLASS="application"
3231
>SCons</SPAN
3232
> to build that program
3233
     (and any other files) whenever it's necessary.
3234
     (We'll learn more about how
3235
     <SPAN
3236
CLASS="application"
3237
>SCons</SPAN
3238
> decides when building or rebuilding a file
3239
     is necessary in <A
3240
HREF="#chap-depends"
3241
>Chapter 6</A
3242
>, below.)
3243
 
3244
     </P
3245
><P
3246
>&#13;
3247
     <SPAN
3248
CLASS="application"
3249
>SCons</SPAN
3250
> reflects this distinction between
3251
     <SPAN
3252
CLASS="emphasis"
3253
><I
3254
CLASS="emphasis"
3255
>calling a builder method like</I
3256
></SPAN
3257
> <CODE
3258
CLASS="function"
3259
>Program</CODE
3260
>&#62;
3261
     and <SPAN
3262
CLASS="emphasis"
3263
><I
3264
CLASS="emphasis"
3265
>actually building the program</I
3266
></SPAN
3267
>
3268
     by printing the status messages that indicate
3269
     when it's "just reading" the <TT
3270
CLASS="filename"
3271
>SConstruct</TT
3272
> file,
3273
     and when it's actually building the target files.
3274
     This is to make it clear when <SPAN
3275
CLASS="application"
3276
>SCons</SPAN
3277
> is
3278
     executing the Python statements that make up the <TT
3279
CLASS="filename"
3280
>SConstruct</TT
3281
> file,
3282
     and when <SPAN
3283
CLASS="application"
3284
>SCons</SPAN
3285
> is actually executing the
3286
     commands or other actions to
3287
     build the necessary files.
3288
3289
     </P
3290
><P
3291
>&#13;
3292
     Let's clarify this with an example.
3293
     Python has a <TT
3294
CLASS="literal"
3295
>print</TT
3296
> statement that
3297
     prints a string of characters to the screen.
3298
     If we put <TT
3299
CLASS="literal"
3300
>print</TT
3301
> statements around
3302
     our calls to the <CODE
3303
CLASS="function"
3304
>Program</CODE
3305
> builder method:
3306
3307
     </P
3308
><PRE
3309
CLASS="programlisting"
3310
>&#13;       print "Calling Program('hello.c')"
3311
       Program('hello.c')
3312
       print "Calling Program('goodbye.c')"
3313
       Program('goodbye.c')
3314
       print "Finished calling Program()"
3315
     </PRE
3316
><P
3317
>&#13;
3318
     Then when we execute <SPAN
3319
CLASS="application"
3320
>SCons</SPAN
3321
>,
3322
     we see the output from the <TT
3323
CLASS="literal"
3324
>print</TT
3325
>
3326
     statements in between the messages about
3327
     reading the <TT
3328
CLASS="filename"
3329
>SConscript</TT
3330
> files,
3331
     indicating that that is when the
3332
     Python statements are being executed:
3333
3334
     </P
3335
><PRE
3336
CLASS="screen"
3337
>&#13;       % <KBD
3338
CLASS="userinput"
3339
>scons</KBD
3340
>
3341
       scons: Reading SConscript files ...
3342
       Calling Program('hello.c')
3343
       Calling Program('goodbye.c')
3344
       Finished calling Program()
3345
       scons: done reading SConscript files.
3346
       scons: Building targets ...
3347
       cc -o goodbye.o -c goodbye.c
3348
       cc -o goodbye goodbye.o
3349
       cc -o hello.o -c hello.c
3350
       cc -o hello hello.o
3351
       scons: done building targets.
3352
     </PRE
3353
><P
3354
>&#13;
3355
     Notice also that <SPAN
3356
CLASS="application"
3357
>SCons</SPAN
3358
> built the <SPAN
3359
CLASS="application"
3360
>goodbye</SPAN
3361
> program first,
3362
     even though the "reading <TT
3363
CLASS="filename"
3364
>SConscript</TT
3365
>" output
3366
     shows that we called <TT
3367
CLASS="literal"
3368
>Program('hello.c')</TT
3369
>
3370
     first in the <TT
3371
CLASS="filename"
3372
>SConstruct</TT
3373
> file.
3374
3375
     </P
3376
></DIV
3377
></DIV
3378
><DIV
3379
CLASS="section"
3380
><HR><H2
3381
CLASS="section"
3382
><A
3383
NAME="AEN420"
3384
>2.6. Making the <SPAN
3385
CLASS="application"
3386
>SCons</SPAN
3387
> Output Less Verbose</A
3388
></H2
3389
><P
3390
>&#13;
3391
   You've already seen how <SPAN
3392
CLASS="application"
3393
>SCons</SPAN
3394
> prints
3395
   some messages about what it's doing,
3396
   surrounding the actual commands used to build the software:
3397
3398
   </P
3399
><PRE
3400
CLASS="screen"
3401
>&#13;      C:\&#62;<KBD
3402
CLASS="userinput"
3403
>scons</KBD
3404
>
3405
      scons: Reading SConscript files ...
3406
      scons: done reading SConscript files.
3407
      scons: Building targets ...
3408
      cl /nologo /c hello.c /Fohello.obj
3409
      link /nologo /OUT:hello.exe hello.obj
3410
      scons: done building targets.
3411
   </PRE
3412
><P
3413
>&#13;
3414
   These messages emphasize the
3415
   order in which <SPAN
3416
CLASS="application"
3417
>SCons</SPAN
3418
> does its work:
3419
   all of the configuration files
3420
   (generically referred to as <TT
3421
CLASS="filename"
3422
>SConscript</TT
3423
> files)
3424
   are read and executed first,
3425
   and only then are the target files built.
3426
   Among other benefits, these messages help to distinguish between
3427
   errors that occur while the configuration files are read,
3428
   and errors that occur while targets are being built.
3429
3430
   </P
3431
><P
3432
>&#13;
3433
   One drawback, of course, is that these messages clutter the output.
3434
   Fortunately, they're easily disabled by using
3435
   the <TT
3436
CLASS="literal"
3437
>-Q</TT
3438
> option when invoking <SPAN
3439
CLASS="application"
3440
>SCons</SPAN
3441
>:
3442
3443
   </P
3444
><PRE
3445
CLASS="screen"
3446
>&#13;      C:\&#62;<KBD
3447
CLASS="userinput"
3448
>scons -Q</KBD
3449
>
3450
      cl /nologo /c hello.c /Fohello.obj
3451
      link /nologo /OUT:hello.exe hello.obj
3452
   </PRE
3453
><P
3454
>&#13;
3455
   Because we want this User's Guide to focus
3456
   on what <SPAN
3457
CLASS="application"
3458
>SCons</SPAN
3459
> is actually doing,
3460
   we're going to use the <TT
3461
CLASS="literal"
3462
>-Q</TT
3463
> option
3464
   to remove these messages from the
3465
   output of all the remaining examples in this Guide.
3466
3467
   </P
3468
></DIV
3469
></DIV
3470
><DIV
3471
CLASS="chapter"
3472
><HR><H1
3473
><A
3474
NAME="chap-less-simple"
3475
></A
3476
>Chapter 3. Less Simple Things to Do With Builds</H1
3477
><P
3478
>&#13;
3479
  In this chapter,
3480
  you will see several examples of
3481
  very simple build configurations using <SPAN
3482
CLASS="application"
3483
>SCons</SPAN
3484
>,
3485
  which will demonstrate how easy
3486
  it is to use <SPAN
3487
CLASS="application"
3488
>SCons</SPAN
3489
> to
3490
  build programs from several different programming languages
3491
  on different types of systems.
3492
3493
  </P
3494
><DIV
3495
CLASS="section"
3496
><HR><H2
3497
CLASS="section"
3498
><A
3499
NAME="AEN443"
3500
>3.1. Specifying the Name of the Target (Output) File</A
3501
></H2
3502
><P
3503
>&#13;
3504
    You've seen that when you call the <A
3505
HREF="#b-Program"
3506
><CODE
3507
CLASS="function"
3508
>Program</CODE
3509
></A
3510
> builder method,
3511
    it builds the resulting program with the same
3512
    base name as the source file.
3513
    That is, the following call to build an
3514
    executable program from the <TT
3515
CLASS="filename"
3516
>hello.c</TT
3517
> source file
3518
    will build an executable program named <SPAN
3519
CLASS="application"
3520
>hello</SPAN
3521
> on POSIX systems,
3522
    and an executable program named <TT
3523
CLASS="filename"
3524
>hello.exe</TT
3525
> on Windows systems:
3526
3527
    </P
3528
><PRE
3529
CLASS="programlisting"
3530
>&#13;       Program('hello.c')
3531
    </PRE
3532
><P
3533
>&#13;
3534
    If you want to build a program with
3535
    a different name than the base of the source file name,
3536
    you simply put the target file name
3537
    to the left of the source file name:
3538
3539
    </P
3540
><PRE
3541
CLASS="programlisting"
3542
>&#13;       Program('new_hello', 'hello.c')
3543
    </PRE
3544
><P
3545
>&#13;
3546
    (<SPAN
3547
CLASS="application"
3548
>SCons</SPAN
3549
> requires the target file name first,
3550
    followed by the source file name,
3551
    so that the order mimics that of an
3552
    assignment statement in most programming languages,
3553
    including Python:
3554
    <TT
3555
CLASS="literal"
3556
>"program = source files"</TT
3557
>.)
3558
3559
    </P
3560
><P
3561
>&#13;
3562
    Now <SPAN
3563
CLASS="application"
3564
>SCons</SPAN
3565
> will build an executable program
3566
    named <SPAN
3567
CLASS="application"
3568
>new_hello</SPAN
3569
> when run on a POSIX system:
3570
3571
    </P
3572
><PRE
3573
CLASS="screen"
3574
>&#13;       % <KBD
3575
CLASS="userinput"
3576
>scons -Q</KBD
3577
>
3578
       cc -o hello.o -c hello.c
3579
       cc -o new_hello hello.o
3580
    </PRE
3581
><P
3582
>&#13;
3583
    And <SPAN
3584
CLASS="application"
3585
>SCons</SPAN
3586
> will build an executable program
3587
    named <SPAN
3588
CLASS="application"
3589
>new_hello.exe</SPAN
3590
> when run on a Windows system:
3591
3592
    </P
3593
><PRE
3594
CLASS="screen"
3595
>&#13;       C:\&#62;<KBD
3596
CLASS="userinput"
3597
>scons -Q</KBD
3598
>
3599
       cl /nologo /c hello.c /Fohello.obj
3600
       link /nologo /OUT:new_hello.exe hello.obj
3601
    </PRE
3602
></DIV
3603
><DIV
3604
CLASS="section"
3605
><HR><H2
3606
CLASS="section"
3607
><A
3608
NAME="AEN467"
3609
>3.2. Compiling Multiple Source Files</A
3610
></H2
3611
><P
3612
>&#13;
3613
    You've just seen how to configure <SPAN
3614
CLASS="application"
3615
>SCons</SPAN
3616
>
3617
    to compile a program from a single source file.
3618
    It's more common, of course,
3619
    that you'll need to build a program from
3620
    many input source files, not just one.
3621
    To do this, you need to put the
3622
    source files in a Python list
3623
    (enclosed in square brackets),
3624
    like so:
3625
3626
    </P
3627
><PRE
3628
CLASS="programlisting"
3629
>&#13;       Program(['prog.c', 'file1.c', 'file2.c'])
3630
    </PRE
3631
><P
3632
>&#13;
3633
    A build of the above example would look like:
3634
3635
    </P
3636
><PRE
3637
CLASS="screen"
3638
>&#13;       % <KBD
3639
CLASS="userinput"
3640
>scons -Q</KBD
3641
>
3642
       cc -o file1.o -c file1.c
3643
       cc -o file2.o -c file2.c
3644
       cc -o prog.o -c prog.c
3645
       cc -o prog prog.o file1.o file2.o
3646
    </PRE
3647
><P
3648
>&#13;
3649
    Notice that <SPAN
3650
CLASS="application"
3651
>SCons</SPAN
3652
>
3653
    deduces the output program name
3654
    from the first source file specified
3655
    in the list--that is,
3656
    because the first source file was <TT
3657
CLASS="filename"
3658
>prog.c</TT
3659
>,
3660
    <SPAN
3661
CLASS="application"
3662
>SCons</SPAN
3663
> will name the resulting program <TT
3664
CLASS="filename"
3665
>prog</TT
3666
>
3667
    (or <TT
3668
CLASS="filename"
3669
>prog.exe</TT
3670
> on a Windows system).
3671
    If you want to specify a different program name,
3672
    then (as we've seen in the previous section)
3673
    you slide the list of source files
3674
    over to the right
3675
    to make room for the output program file name.
3676
    (<SPAN
3677
CLASS="application"
3678
>SCons</SPAN
3679
> puts the output file name to the left
3680
    of the source file names
3681
    so that the order mimics that of an
3682
    assignment statement:  "program = source files".)
3683
    This makes our example:
3684
3685
    </P
3686
><PRE
3687
CLASS="programlisting"
3688
>&#13;       Program('program', ['prog.c', 'file1.c', 'file2.c'])
3689
    </PRE
3690
><P
3691
>&#13;
3692
    On Linux, a build of this example would look like:
3693
3694
    </P
3695
><PRE
3696
CLASS="screen"
3697
>&#13;       % <KBD
3698
CLASS="userinput"
3699
>scons -Q</KBD
3700
>
3701
       cc -o file1.o -c file1.c
3702
       cc -o file2.o -c file2.c
3703
       cc -o prog.o -c prog.c
3704
       cc -o program prog.o file1.o file2.o
3705
    </PRE
3706
><P
3707
>&#13;
3708
    Or on Windows:
3709
3710
    </P
3711
><PRE
3712
CLASS="screen"
3713
>&#13;       C:\&#62;<KBD
3714
CLASS="userinput"
3715
>scons -Q</KBD
3716
>
3717
       cl /nologo /c file1.c /Fofile1.obj
3718
       cl /nologo /c file2.c /Fofile2.obj
3719
       cl /nologo /c prog.c /Foprog.obj
3720
       link /nologo /OUT:program.exe prog.obj file1.obj file2.obj
3721
    </PRE
3722
></DIV
3723
><DIV
3724
CLASS="section"
3725
><HR><H2
3726
CLASS="section"
3727
><A
3728
NAME="AEN489"
3729
>3.3. Making a list of files with Glob()</A
3730
></H2
3731
><P
3732
>&#13;
3733
    You can also use the Glob() function to find all files matching a
3734
    certain template, using standard the shell pattern matching
3735
    characters *, ?, and [abc] to match any of a, b, or c.  [!abc] is
3736
    also supported, to match any character <SPAN
3737
CLASS="emphasis"
3738
><I
3739
CLASS="emphasis"
3740
>except</I
3741
></SPAN
3742
>
3743
    a, b, or c.  This makes many multi-source-file builds quite easy:
3744
3745
    </P
3746
><PRE
3747
CLASS="programlisting"
3748
>&#13;       Program('program', Glob('*.c'))
3749
    </PRE
3750
><P
3751
>&#13;
3752
    The SCons man page has more details on using Glob() with Variant
3753
    dirs and Repositories and returning strings rather than Nodes.
3754
3755
    </P
3756
></DIV
3757
><DIV
3758
CLASS="section"
3759
><HR><H2
3760
CLASS="section"
3761
><A
3762
NAME="AEN495"
3763
>3.4. Specifying Single Files Vs. Lists of Files</A
3764
></H2
3765
><P
3766
>&#13;
3767
    We've now shown you two ways to specify
3768
    the source for a program,
3769
    one with a list of files:
3770
3771
    </P
3772
><PRE
3773
CLASS="programlisting"
3774
>&#13;       Program('hello', ['file1.c', 'file2.c'])
3775
    </PRE
3776
><P
3777
>&#13;
3778
    And one with a single file:
3779
3780
    </P
3781
><PRE
3782
CLASS="programlisting"
3783
>&#13;       Program('hello', 'hello.c')
3784
    </PRE
3785
><P
3786
>&#13;
3787
    You could actually put a single file name in a list, too,
3788
    which you might prefer just for the sake of consistency:
3789
3790
    </P
3791
><PRE
3792
CLASS="programlisting"
3793
>&#13;       Program('hello', ['hello.c'])
3794
    </PRE
3795
><P
3796
>&#13;
3797
    <SPAN
3798
CLASS="application"
3799
>SCons</SPAN
3800
> functions will accept a single file name in either form.
3801
    In fact, internally, <SPAN
3802
CLASS="application"
3803
>SCons</SPAN
3804
> treats all input as lists of files,
3805
    but allows you to omit the square brackets
3806
    to cut down a little on the typing
3807
    when there's only a single file name.
3808
3809
    </P
3810
><DIV
3811
CLASS="important"
3812
><P
3813
></P
3814
><TABLE
3815
CLASS="important"
3816
WIDTH="100%"
3817
BORDER="0"
3818
><TR
3819
><TD
3820
WIDTH="25"
3821
ALIGN="CENTER"
3822
VALIGN="TOP"
3823
><IMG
3824
SRC="../images/important.gif"
3825
HSPACE="5"
3826
ALT="Important"></TD
3827
><TD
3828
ALIGN="LEFT"
3829
VALIGN="TOP"
3830
><P
3831
>&#13;
3832
    Although <SPAN
3833
CLASS="application"
3834
>SCons</SPAN
3835
> functions
3836
    are forgiving about whether or not you
3837
    use a string vs. a list for a single file name,
3838
    Python itself is more strict about
3839
    treating lists and strings differently.
3840
    So where <SPAN
3841
CLASS="application"
3842
>SCons</SPAN
3843
> allows either
3844
    a string or list:
3845
3846
    </P
3847
><PRE
3848
CLASS="programlisting"
3849
>&#13;       # The following two calls both work correctly:
3850
       Program('program1', 'program1.c')
3851
       Program('program2', ['program2.c'])
3852
    </PRE
3853
><P
3854
>&#13;
3855
    Trying to do "Python things" that mix strings and
3856
    lists will cause errors or lead to incorrect results:
3857
3858
    </P
3859
><PRE
3860
CLASS="programlisting"
3861
>&#13;       common_sources = ['file1.c', 'file2.c']
3862
3863
       # THE FOLLOWING IS INCORRECT AND GENERATES A PYTHON ERROR
3864
       # BECAUSE IT TRIES TO ADD A STRING TO A LIST:
3865
       Program('program1', common_sources + 'program1.c')
3866
3867
       # The following works correctly, because it's adding two
3868
       # lists together to make another list.
3869
       Program('program2', common_sources + ['program2.c'])
3870
    </PRE
3871
></TD
3872
></TR
3873
></TABLE
3874
></DIV
3875
></DIV
3876
><DIV
3877
CLASS="section"
3878
><HR><H2
3879
CLASS="section"
3880
><A
3881
NAME="AEN513"
3882
>3.5. Making Lists of Files Easier to Read</A
3883
></H2
3884
><P
3885
>&#13;
3886
    One drawback to the use of a Python list
3887
    for source files is that 
3888
    each file name must be enclosed in quotes
3889
    (either single quotes or double quotes).
3890
    This can get cumbersome and difficult to read
3891
    when the list of file names is long.
3892
    Fortunately, <SPAN
3893
CLASS="application"
3894
>SCons</SPAN
3895
> and Python provide a number of ways
3896
    to make sure that
3897
    the <TT
3898
CLASS="filename"
3899
>SConstruct</TT
3900
> file stays easy to read.
3901
3902
    </P
3903
><P
3904
>&#13;
3905
    To make long lists of file names
3906
    easier to deal with, <SPAN
3907
CLASS="application"
3908
>SCons</SPAN
3909
> provides a
3910
    <CODE
3911
CLASS="function"
3912
>Split</CODE
3913
> function
3914
    that takes a quoted list of file names,
3915
    with the names separated by spaces or other white-space characters,
3916
    and turns it into a list of separate file names.
3917
    Using the <CODE
3918
CLASS="function"
3919
>Split</CODE
3920
> function turns the
3921
    previous example into:
3922
3923
    </P
3924
><PRE
3925
CLASS="programlisting"
3926
>&#13;       Program('program', Split('main.c file1.c file2.c'))
3927
    </PRE
3928
><P
3929
>&#13;
3930
    (If you're already familiar with Python,
3931
    you'll have realized that this is similar to the
3932
    <CODE
3933
CLASS="function"
3934
>split()</CODE
3935
> method
3936
    in the Python standard <CODE
3937
CLASS="function"
3938
>string</CODE
3939
> module.
3940
    Unlike the <CODE
3941
CLASS="function"
3942
>string.split()</CODE
3943
> method,
3944
    however, the <CODE
3945
CLASS="function"
3946
>Split</CODE
3947
> function
3948
    does not require a string as input
3949
    and will wrap up a single non-string object in a list,
3950
    or return its argument untouched if it's already a list.
3951
    This comes in handy as a way to make sure
3952
    arbitrary values can be passed to <SPAN
3953
CLASS="application"
3954
>SCons</SPAN
3955
> functions
3956
    without having to check the type of the variable by hand.)
3957
3958
    </P
3959
><P
3960
>&#13;
3961
    Putting the call to the <CODE
3962
CLASS="function"
3963
>Split</CODE
3964
> function
3965
    inside the <CODE
3966
CLASS="function"
3967
>Program</CODE
3968
> call
3969
    can also be a little unwieldy.
3970
    A more readable alternative is to
3971
    assign the output from the <CODE
3972
CLASS="function"
3973
>Split</CODE
3974
> call
3975
    to a variable name,
3976
    and then use the variable when calling the
3977
    <CODE
3978
CLASS="function"
3979
>Program</CODE
3980
> function:
3981
3982
    </P
3983
><PRE
3984
CLASS="programlisting"
3985
>&#13;       list = Split('main.c file1.c file2.c')
3986
       Program('program', list)
3987
    </PRE
3988
><P
3989
>&#13;
3990
    Lastly, the <CODE
3991
CLASS="function"
3992
>Split</CODE
3993
> function
3994
    doesn't care how much white space separates
3995
    the file names in the quoted string.
3996
    This allows you to create lists of file
3997
    names that span multiple lines,
3998
    which often makes for easier editing:
3999
4000
    </P
4001
><PRE
4002
CLASS="programlisting"
4003
>&#13;       list = Split("""main.c
4004
                       file1.c
4005
                       file2.c""")
4006
       Program('program', list)
4007
    </PRE
4008
><P
4009
>&#13;
4010
    (Note in this example that we used
4011
    the Python "triple-quote" syntax,
4012
    which allows a string to contain
4013
    multiple lines.
4014
    The three quotes can be either
4015
    single or double quotes.)
4016
4017
    </P
4018
></DIV
4019
><DIV
4020
CLASS="section"
4021
><HR><H2
4022
CLASS="section"
4023
><A
4024
NAME="AEN539"
4025
>3.6. Keyword Arguments</A
4026
></H2
4027
><P
4028
>&#13;
4029
    <SPAN
4030
CLASS="application"
4031
>SCons</SPAN
4032
> also allows you to identify
4033
    the output file and input source files
4034
    using Python keyword arguments.
4035
    The output file is known as the
4036
    <SPAN
4037
CLASS="emphasis"
4038
><I
4039
CLASS="emphasis"
4040
>target</I
4041
></SPAN
4042
>,
4043
    and the source file(s) are known (logically enough) as the
4044
    <SPAN
4045
CLASS="emphasis"
4046
><I
4047
CLASS="emphasis"
4048
>source</I
4049
></SPAN
4050
>.
4051
    The Python syntax for this is:
4052
4053
    </P
4054
><PRE
4055
CLASS="programlisting"
4056
>&#13;       list = Split('main.c file1.c file2.c')
4057
       Program(target = 'program', source = list)
4058
    </PRE
4059
><P
4060
>&#13;
4061
    Because the keywords explicitly identify
4062
    what each argument is,
4063
    you can actually reverse the order if you prefer:
4064
4065
    </P
4066
><PRE
4067
CLASS="programlisting"
4068
>&#13;       list = Split('main.c file1.c file2.c')
4069
       Program(source = list, target = 'program')
4070
    </PRE
4071
><P
4072
>&#13;
4073
    Whether or not you choose to use keyword arguments
4074
    to identify the target and source files,
4075
    and the order in which you specify them
4076
    when using keywords,
4077
    are purely personal choices;
4078
    <SPAN
4079
CLASS="application"
4080
>SCons</SPAN
4081
> functions the same regardless.
4082
4083
    </P
4084
></DIV
4085
><DIV
4086
CLASS="section"
4087
><HR><H2
4088
CLASS="section"
4089
><A
4090
NAME="AEN550"
4091
>3.7. Compiling Multiple Programs</A
4092
></H2
4093
><P
4094
>&#13;
4095
    In order to compile multiple programs
4096
    within the same <TT
4097
CLASS="filename"
4098
>SConstruct</TT
4099
> file,
4100
    simply call the <CODE
4101
CLASS="function"
4102
>Program</CODE
4103
> method
4104
    multiple times,
4105
    once for each program you need to build:
4106
4107
    </P
4108
><PRE
4109
CLASS="programlisting"
4110
>&#13;       Program('foo.c')
4111
       Program('bar', ['bar1.c', 'bar2.c'])
4112
    </PRE
4113
><P
4114
>&#13;
4115
    <SPAN
4116
CLASS="application"
4117
>SCons</SPAN
4118
> would then build the programs as follows:
4119
4120
    </P
4121
><PRE
4122
CLASS="screen"
4123
>&#13;       % <KBD
4124
CLASS="userinput"
4125
>scons -Q</KBD
4126
>
4127
       cc -o bar1.o -c bar1.c
4128
       cc -o bar2.o -c bar2.c
4129
       cc -o bar bar1.o bar2.o
4130
       cc -o foo.o -c foo.c
4131
       cc -o foo foo.o
4132
    </PRE
4133
><P
4134
>&#13;
4135
    Notice that <SPAN
4136
CLASS="application"
4137
>SCons</SPAN
4138
> does not necessarily build the
4139
    programs in the same order in which you specify
4140
    them in the <TT
4141
CLASS="filename"
4142
>SConstruct</TT
4143
> file.
4144
    <SPAN
4145
CLASS="application"
4146
>SCons</SPAN
4147
> does, however, recognize that
4148
    the individual object files must be built
4149
    before the resulting program can be built.
4150
    We'll discuss this in greater detail in
4151
    the "Dependencies" section, below.
4152
4153
    </P
4154
></DIV
4155
><DIV
4156
CLASS="section"
4157
><HR><H2
4158
CLASS="section"
4159
><A
4160
NAME="AEN564"
4161
>3.8. Sharing Source Files Between Multiple Programs</A
4162
></H2
4163
><P
4164
>&#13;
4165
    It's common to re-use code by sharing source files
4166
    between multiple programs.
4167
    One way to do this is to create a library
4168
    from the common source files,
4169
    which can then be linked into resulting programs.
4170
    (Creating libraries is discussed in
4171
    <A
4172
HREF="#chap-libraries"
4173
>Chapter 4</A
4174
>, below.)
4175
4176
    </P
4177
><P
4178
>&#13;
4179
    A more straightforward, but perhaps less convenient,
4180
    way to share source files between multiple programs
4181
    is simply to include the common files
4182
    in the lists of source files for each program:
4183
4184
    </P
4185
><PRE
4186
CLASS="programlisting"
4187
>&#13;       Program(Split('foo.c common1.c common2.c'))
4188
       Program('bar', Split('bar1.c bar2.c common1.c common2.c'))
4189
    </PRE
4190
><P
4191
>&#13;
4192
    <SPAN
4193
CLASS="application"
4194
>SCons</SPAN
4195
> recognizes that the object files for
4196
    the <TT
4197
CLASS="filename"
4198
>common1.c</TT
4199
> and <TT
4200
CLASS="filename"
4201
>common2.c</TT
4202
> source files
4203
    each only need to be built once,
4204
    even though the resulting object files are
4205
    each linked in to both of the resulting executable programs:
4206
4207
    </P
4208
><PRE
4209
CLASS="screen"
4210
>&#13;       % <KBD
4211
CLASS="userinput"
4212
>scons -Q</KBD
4213
>
4214
       cc -o bar1.o -c bar1.c
4215
       cc -o bar2.o -c bar2.c
4216
       cc -o common1.o -c common1.c
4217
       cc -o common2.o -c common2.c
4218
       cc -o bar bar1.o bar2.o common1.o common2.o
4219
       cc -o foo.o -c foo.c
4220
       cc -o foo foo.o common1.o common2.o
4221
    </PRE
4222
><P
4223
>&#13;
4224
    If two or more programs
4225
    share a lot of common source files,
4226
    repeating the common files in the list for each program
4227
    can be a maintenance problem when you need to change the
4228
    list of common files.
4229
    You can simplify this by creating a separate Python list
4230
    to hold the common file names,
4231
    and concatenating it with other lists
4232
    using the Python <TT
4233
CLASS="literal"
4234
>+</TT
4235
> operator:
4236
4237
    </P
4238
><PRE
4239
CLASS="programlisting"
4240
>&#13;       common = ['common1.c', 'common2.c']
4241
       foo_files = ['foo.c'] + common
4242
       bar_files = ['bar1.c', 'bar2.c'] + common
4243
       Program('foo', foo_files)
4244
       Program('bar', bar_files)
4245
    </PRE
4246
><P
4247
>&#13;
4248
    This is functionally equivalent to the previous example.
4249
4250
    </P
4251
></DIV
4252
></DIV
4253
><DIV
4254
CLASS="chapter"
4255
><HR><H1
4256
><A
4257
NAME="chap-libraries"
4258
></A
4259
>Chapter 4. Building and Linking with Libraries</H1
4260
><P
4261
>&#13;
4262
  It's often useful to organize large software projects
4263
  by collecting parts of the software into one or more libraries.
4264
  <SPAN
4265
CLASS="application"
4266
>SCons</SPAN
4267
> makes it easy to create libraries
4268
  and to use them in the programs.
4269
4270
  </P
4271
><DIV
4272
CLASS="section"
4273
><HR><H2
4274
CLASS="section"
4275
><A
4276
NAME="AEN584"
4277
>4.1. Building Libraries</A
4278
></H2
4279
><P
4280
>&#13;
4281
    You build your own libraries by specifying <A
4282
HREF="#b-Library"
4283
><CODE
4284
CLASS="function"
4285
>Library</CODE
4286
></A
4287
>
4288
    instead of <A
4289
HREF="#b-Program"
4290
><CODE
4291
CLASS="function"
4292
>Program</CODE
4293
></A
4294
>:
4295
4296
    </P
4297
><PRE
4298
CLASS="programlisting"
4299
>&#13;      Library('foo', ['f1.c', 'f2.c', 'f3.c'])
4300
    </PRE
4301
><P
4302
>&#13;
4303
    <SPAN
4304
CLASS="application"
4305
>SCons</SPAN
4306
> uses the appropriate library prefix and suffix for your system.
4307
    So on POSIX or Linux systems,
4308
    the above example would build as follows
4309
    (although <SPAN
4310
CLASS="application"
4311
>ranlib</SPAN
4312
> may not be called on all systems):
4313
4314
    </P
4315
><PRE
4316
CLASS="screen"
4317
>&#13;      % <KBD
4318
CLASS="userinput"
4319
>scons -Q</KBD
4320
>
4321
      cc -o f1.o -c f1.c
4322
      cc -o f2.o -c f2.c
4323
      cc -o f3.o -c f3.c
4324
      ar rc libfoo.a f1.o f2.o f3.o
4325
      ranlib libfoo.a
4326
    </PRE
4327
><P
4328
>&#13;
4329
    On a Windows system,
4330
    a build of the above example would look like:
4331
4332
    </P
4333
><PRE
4334
CLASS="screen"
4335
>&#13;      C:\&#62;<KBD
4336
CLASS="userinput"
4337
>scons -Q</KBD
4338
>
4339
      cl /nologo /c f1.c /Fof1.obj
4340
      cl /nologo /c f2.c /Fof2.obj
4341
      cl /nologo /c f3.c /Fof3.obj
4342
      lib /nologo /OUT:foo.lib f1.obj f2.obj f3.obj
4343
    </PRE
4344
><P
4345
>&#13;
4346
    The rules for the target name of the library
4347
    are similar to those for programs:
4348
    if you don't explicitly specify a target library name,
4349
    <SPAN
4350
CLASS="application"
4351
>SCons</SPAN
4352
> will deduce one from the
4353
    name of the first source file specified,
4354
    and <SPAN
4355
CLASS="application"
4356
>SCons</SPAN
4357
> will add an appropriate
4358
    file prefix and suffix if you leave them off.
4359
4360
    </P
4361
><DIV
4362
CLASS="section"
4363
><HR><H3
4364
CLASS="section"
4365
><A
4366
NAME="AEN603"
4367
>4.1.1. Building Libraries From Source Code or Object Files</A
4368
></H3
4369
><P
4370
>&#13;
4371
      The previous example shows building a library from a
4372
      list of source files.
4373
      You can, however, also give the <A
4374
HREF="#b-Library"
4375
><CODE
4376
CLASS="function"
4377
>Library</CODE
4378
></A
4379
> call
4380
      object files,
4381
      and it will correctly realize
4382
      In fact, you can arbitrarily mix source code files
4383
      and object files in the source list:
4384
4385
      </P
4386
><PRE
4387
CLASS="programlisting"
4388
>&#13;        Library('foo', ['f1.c', 'f2.o', 'f3.c', 'f4.o'])
4389
      </PRE
4390
><P
4391
>&#13;
4392
      And SCons realizes that only the source code files
4393
      must be compiled into object files
4394
      before creating the final library:
4395
4396
      </P
4397
><PRE
4398
CLASS="screen"
4399
>&#13;        % <KBD
4400
CLASS="userinput"
4401
>scons -Q</KBD
4402
>
4403
        cc -o f1.o -c f1.c
4404
        cc -o f3.o -c f3.c
4405
        ar rc libfoo.a f1.o f2.o f3.o f4.o
4406
        ranlib libfoo.a
4407
      </PRE
4408
><P
4409
>&#13;
4410
      Of course, in this example, the object files
4411
      must already exist for the build to succeed.
4412
      See <A
4413
HREF="#chap-nodes"
4414
>Chapter 5</A
4415
>, below,
4416
      for information about how you can
4417
      build object files explicitly
4418
      and include the built files in a library.
4419
4420
      </P
4421
></DIV
4422
><DIV
4423
CLASS="section"
4424
><HR><H3
4425
CLASS="section"
4426
><A
4427
NAME="AEN614"
4428
>4.1.2. Building Static Libraries Explicitly:  the <CODE
4429
CLASS="function"
4430
>StaticLibrary</CODE
4431
> Builder</A
4432
></H3
4433
><P
4434
>&#13;
4435
      The <A
4436
HREF="#b-Library"
4437
><CODE
4438
CLASS="function"
4439
>Library</CODE
4440
></A
4441
> function builds a traditional static library.
4442
      If you want to be explicit about the type of library being built,
4443
      you can use the synonym <A
4444
HREF="#b-StaticLibrary"
4445
><CODE
4446
CLASS="function"
4447
>StaticLibrary</CODE
4448
></A
4449
> function
4450
      instead of <CODE
4451
CLASS="function"
4452
>Library</CODE
4453
>:
4454
4455
      </P
4456
><PRE
4457
CLASS="programlisting"
4458
>&#13;        StaticLibrary('foo', ['f1.c', 'f2.c', 'f3.c'])
4459
      </PRE
4460
><P
4461
>&#13;
4462
      There is no functional difference between the
4463
      <A
4464
HREF="#b-StaticLibrary"
4465
><CODE
4466
CLASS="function"
4467
>StaticLibrary</CODE
4468
></A
4469
> and <CODE
4470
CLASS="function"
4471
>Library</CODE
4472
> functions.
4473
4474
      </P
4475
></DIV
4476
><DIV
4477
CLASS="section"
4478
><HR><H3
4479
CLASS="section"
4480
><A
4481
NAME="AEN628"
4482
>4.1.3. Building Shared (DLL) Libraries:  the <CODE
4483
CLASS="function"
4484
>SharedLibrary</CODE
4485
> Builder</A
4486
></H3
4487
><P
4488
>&#13;
4489
      If you want to build a shared library (on POSIX systems)
4490
      or a DLL file (on Windows systems),
4491
      you use the <A
4492
HREF="#b-SharedLibrary"
4493
><CODE
4494
CLASS="function"
4495
>SharedLibrary</CODE
4496
></A
4497
> function:
4498
4499
      </P
4500
><PRE
4501
CLASS="programlisting"
4502
>&#13;        SharedLibrary('foo', ['f1.c', 'f2.c', 'f3.c'])
4503
      </PRE
4504
><P
4505
>&#13;
4506
      The output on POSIX:
4507
4508
      </P
4509
><PRE
4510
CLASS="screen"
4511
>&#13;        % <KBD
4512
CLASS="userinput"
4513
>scons -Q</KBD
4514
>
4515
        cc -o f1.os -c f1.c
4516
        cc -o f2.os -c f2.c
4517
        cc -o f3.os -c f3.c
4518
        cc -o libfoo.so -shared f1.os f2.os f3.os
4519
      </PRE
4520
><P
4521
>&#13;
4522
      And the output on Windows:
4523
4524
      </P
4525
><PRE
4526
CLASS="screen"
4527
>&#13;        C:\&#62;<KBD
4528
CLASS="userinput"
4529
>scons -Q</KBD
4530
>
4531
        cl /nologo /c f1.c /Fof1.obj
4532
        cl /nologo /c f2.c /Fof2.obj
4533
        cl /nologo /c f3.c /Fof3.obj
4534
        link /nologo /dll /out:foo.dll /implib:foo.lib f1.obj f2.obj f3.obj
4535
        RegServerFunc(target, source, env)
4536
      </PRE
4537
><P
4538
>&#13;
4539
      Notice again that <SPAN
4540
CLASS="application"
4541
>SCons</SPAN
4542
> takes care of
4543
      building the output file correctly,
4544
      adding the <TT
4545
CLASS="literal"
4546
>-shared</TT
4547
> option
4548
      for a POSIX compilation,
4549
      and the <TT
4550
CLASS="literal"
4551
>/dll</TT
4552
> option on Windows.
4553
4554
      </P
4555
></DIV
4556
></DIV
4557
><DIV
4558
CLASS="section"
4559
><HR><H2
4560
CLASS="section"
4561
><A
4562
NAME="AEN645"
4563
>4.2. Linking with Libraries</A
4564
></H2
4565
><P
4566
>&#13;
4567
    Usually, you build a library
4568
    because you want to link it with one or more programs.
4569
    You link libraries with a program by specifying
4570
    the libraries in the <A
4571
HREF="#cv-LIBS"
4572
><CODE
4573
CLASS="envar"
4574
>$LIBS</CODE
4575
></A
4576
> construction variable,
4577
    and by specifying the directory in which
4578
    the library will be found in the 
4579
    <A
4580
HREF="#cv-LIBPATH"
4581
><CODE
4582
CLASS="envar"
4583
>$LIBPATH</CODE
4584
></A
4585
> construction variable:
4586
4587
    
4588
4589
    </P
4590
><PRE
4591
CLASS="programlisting"
4592
>&#13;      Library('foo', ['f1.c', 'f2.c', 'f3.c'])
4593
      Program('prog.c', LIBS=['foo', 'bar'], LIBPATH='.')
4594
    </PRE
4595
><P
4596
>&#13;
4597
    Notice, of course, that you don't need to specify a library
4598
    prefix (like <TT
4599
CLASS="literal"
4600
>lib</TT
4601
>)
4602
    or suffix (like <TT
4603
CLASS="literal"
4604
>.a</TT
4605
> or <TT
4606
CLASS="literal"
4607
>.lib</TT
4608
>).
4609
    <SPAN
4610
CLASS="application"
4611
>SCons</SPAN
4612
> uses the correct prefix or suffix for the current system.
4613
4614
    </P
4615
><P
4616
>&#13;
4617
    On a POSIX or Linux system,
4618
    a build of the above example would look like:
4619
4620
    </P
4621
><PRE
4622
CLASS="screen"
4623
>&#13;      % <KBD
4624
CLASS="userinput"
4625
>scons -Q</KBD
4626
>
4627
      cc -o f1.o -c f1.c
4628
      cc -o f2.o -c f2.c
4629
      cc -o f3.o -c f3.c
4630
      ar rc libfoo.a f1.o f2.o f3.o
4631
      ranlib libfoo.a
4632
      cc -o prog.o -c prog.c
4633
      cc -o prog prog.o -L. -lfoo -lbar
4634
    </PRE
4635
><P
4636
>&#13;
4637
    On a Windows system,
4638
    a build of the above example would look like:
4639
4640
    </P
4641
><PRE
4642
CLASS="screen"
4643
>&#13;      C:\&#62;<KBD
4644
CLASS="userinput"
4645
>scons -Q</KBD
4646
>
4647
      cl /nologo /c f1.c /Fof1.obj
4648
      cl /nologo /c f2.c /Fof2.obj
4649
      cl /nologo /c f3.c /Fof3.obj
4650
      lib /nologo /OUT:foo.lib f1.obj f2.obj f3.obj
4651
      cl /nologo /c prog.c /Foprog.obj
4652
      link /nologo /OUT:prog.exe /LIBPATH:. foo.lib bar.lib prog.obj
4653
    </PRE
4654
><P
4655
>&#13;
4656
    As usual, notice that <SPAN
4657
CLASS="application"
4658
>SCons</SPAN
4659
> has taken care
4660
    of constructing the correct command lines
4661
    to link with the specified library on each system.
4662
4663
    </P
4664
><P
4665
>&#13;
4666
    Note also that,
4667
    if you only have a single library to link with,
4668
    you can specify the library name in single string,
4669
    instead of a Python list,
4670
    so that:
4671
4672
    </P
4673
><PRE
4674
CLASS="programlisting"
4675
>&#13;      Program('prog.c', LIBS='foo', LIBPATH='.')
4676
    </PRE
4677
><P
4678
>&#13;
4679
    is equivalent to:
4680
4681
    </P
4682
><PRE
4683
CLASS="programlisting"
4684
>&#13;      Program('prog.c', LIBS=['foo'], LIBPATH='.')
4685
    </PRE
4686
><P
4687
>&#13;
4688
    This is similar to the way that <SPAN
4689
CLASS="application"
4690
>SCons</SPAN
4691
>
4692
    handles either a string or a list to
4693
    specify a single source file.
4694
4695
    </P
4696
></DIV
4697
><DIV
4698
CLASS="section"
4699
><HR><H2
4700
CLASS="section"
4701
><A
4702
NAME="AEN672"
4703
>4.3. Finding Libraries:  the <CODE
4704
CLASS="envar"
4705
>$LIBPATH</CODE
4706
> Construction Variable</A
4707
></H2
4708
><P
4709
>&#13;
4710
    By default, the linker will only look in
4711
    certain system-defined directories for libraries.
4712
    <SPAN
4713
CLASS="application"
4714
>SCons</SPAN
4715
> knows how to look for libraries
4716
    in directories that you specify with the
4717
    <A
4718
HREF="#cv-LIBPATH"
4719
><CODE
4720
CLASS="envar"
4721
>$LIBPATH</CODE
4722
></A
4723
> construction variable.
4724
    <CODE
4725
CLASS="envar"
4726
>$LIBPATH</CODE
4727
> consists of a list of
4728
    directory names, like so:
4729
4730
    </P
4731
><PRE
4732
CLASS="programlisting"
4733
>&#13;      Program('prog.c', LIBS = 'm',
4734
                        LIBPATH = ['/usr/lib', '/usr/local/lib'])
4735
    </PRE
4736
><P
4737
>&#13;
4738
    Using a Python list is preferred because it's portable
4739
    across systems.  Alternatively, you could put all of
4740
    the directory names in a single string, separated by the
4741
    system-specific path separator character:
4742
    a colon on POSIX systems:
4743
4744
    </P
4745
><PRE
4746
CLASS="programlisting"
4747
>&#13;      LIBPATH = '/usr/lib:/usr/local/lib'
4748
    </PRE
4749
><P
4750
>&#13;
4751
    or a semi-colon on Windows systems:
4752
4753
    </P
4754
><PRE
4755
CLASS="programlisting"
4756
>&#13;      LIBPATH = 'C:\\lib;D:\\lib'
4757
    </PRE
4758
><P
4759
>&#13;
4760
    (Note that Python requires that the backslash
4761
    separators in a Windows path name
4762
    be escaped within strings.)
4763
4764
    </P
4765
><P
4766
>&#13;
4767
    When the linker is executed,
4768
    <SPAN
4769
CLASS="application"
4770
>SCons</SPAN
4771
> will create appropriate flags
4772
    so that the linker will look for
4773
    libraries in the same directories as <SPAN
4774
CLASS="application"
4775
>SCons</SPAN
4776
>.
4777
    So on a POSIX or Linux system,
4778
    a build of the above example would look like:
4779
4780
    </P
4781
><PRE
4782
CLASS="screen"
4783
>&#13;      % <KBD
4784
CLASS="userinput"
4785
>scons -Q</KBD
4786
>
4787
      cc -o prog.o -c prog.c
4788
      cc -o prog prog.o -L/usr/lib -L/usr/local/lib -lm
4789
    </PRE
4790
><P
4791
>&#13;
4792
    On a Windows system,
4793
    a build of the above example would look like:
4794
4795
    </P
4796
><PRE
4797
CLASS="screen"
4798
>&#13;      C:\&#62;<KBD
4799
CLASS="userinput"
4800
>scons -Q</KBD
4801
>
4802
      cl /nologo /c prog.c /Foprog.obj
4803
      link /nologo /OUT:prog.exe /LIBPATH:\usr\lib /LIBPATH:\usr\local\lib m.lib prog.obj
4804
    </PRE
4805
><P
4806
>&#13;
4807
    Note again that <SPAN
4808
CLASS="application"
4809
>SCons</SPAN
4810
> has taken care of
4811
    the system-specific details of creating
4812
    the right command-line options.
4813
4814
    </P
4815
></DIV
4816
></DIV
4817
><DIV
4818
CLASS="chapter"
4819
><HR><H1
4820
><A
4821
NAME="chap-nodes"
4822
></A
4823
>Chapter 5. Node Objects</H1
4824
><P
4825
>&#13;
4826
  Internally, <SPAN
4827
CLASS="application"
4828
>SCons</SPAN
4829
> represents all of the files
4830
  and directories it knows about as <TT
4831
CLASS="literal"
4832
>Nodes</TT
4833
>.
4834
  These internal objects
4835
  (not object <SPAN
4836
CLASS="emphasis"
4837
><I
4838
CLASS="emphasis"
4839
>files</I
4840
></SPAN
4841
>)
4842
  can be used in a variety of ways
4843
  to make your <TT
4844
CLASS="filename"
4845
>SConscript</TT
4846
>
4847
  files portable and easy to read.
4848
4849
  </P
4850
><DIV
4851
CLASS="section"
4852
><HR><H2
4853
CLASS="section"
4854
><A
4855
NAME="AEN703"
4856
>5.1. Builder Methods Return Lists of Target Nodes</A
4857
></H2
4858
><P
4859
>&#13;
4860
    All builder methods return a list of
4861
    <CODE
4862
CLASS="classname"
4863
>Node</CODE
4864
> objects that identify the
4865
    target file or files that will be built.
4866
    These returned <TT
4867
CLASS="literal"
4868
>Nodes</TT
4869
> can be passed
4870
    as source files to other builder methods,
4871
4872
    </P
4873
><P
4874
>&#13;
4875
    For example, suppose that we want to build
4876
    the two object files that make up a program with different options.
4877
    This would mean calling the <A
4878
HREF="#b-Object"
4879
><CODE
4880
CLASS="function"
4881
>Object</CODE
4882
></A
4883
>
4884
    builder once for each object file,
4885
    specifying the desired options:
4886
4887
    </P
4888
><PRE
4889
CLASS="programlisting"
4890
>&#13;    Object('hello.c', CCFLAGS='-DHELLO')
4891
    Object('goodbye.c', CCFLAGS='-DGOODBYE')
4892
    </PRE
4893
><P
4894
>&#13;
4895
    One way to combine these object files
4896
    into the resulting program
4897
    would be to call the <A
4898
HREF="#b-Program"
4899
><CODE
4900
CLASS="function"
4901
>Program</CODE
4902
></A
4903
>
4904
    builder with the names of the object files
4905
    listed as sources:
4906
4907
    </P
4908
><PRE
4909
CLASS="programlisting"
4910
>&#13;    Object('hello.c', CCFLAGS='-DHELLO')
4911
    Object('goodbye.c', CCFLAGS='-DGOODBYE')
4912
    Program(['hello.o', 'goodbye.o'])
4913
    </PRE
4914
><P
4915
>&#13;
4916
    The problem with listing the names as strings
4917
    is that our <TT
4918
CLASS="filename"
4919
>SConstruct</TT
4920
> file is no longer portable
4921
    across operating systems.
4922
    It won't, for example, work on Windows
4923
    because the object files there would be
4924
    named <TT
4925
CLASS="filename"
4926
>hello.obj</TT
4927
> and <TT
4928
CLASS="filename"
4929
>goodbye.obj</TT
4930
>,
4931
    not <TT
4932
CLASS="filename"
4933
>hello.o</TT
4934
> and <TT
4935
CLASS="filename"
4936
>goodbye.o</TT
4937
>.
4938
4939
    </P
4940
><P
4941
>&#13;
4942
    A better solution is to assign the lists of targets
4943
    returned by the calls to the <CODE
4944
CLASS="function"
4945
>Object</CODE
4946
> builder to variables,
4947
    which we can then concatenate in our
4948
    call to the <CODE
4949
CLASS="function"
4950
>Program</CODE
4951
> builder:
4952
4953
    </P
4954
><PRE
4955
CLASS="programlisting"
4956
>&#13;      hello_list = Object('hello.c', CCFLAGS='-DHELLO')
4957
      goodbye_list = Object('goodbye.c', CCFLAGS='-DGOODBYE')
4958
      Program(hello_list + goodbye_list)
4959
    </PRE
4960
><P
4961
>&#13;
4962
    This makes our <TT
4963
CLASS="filename"
4964
>SConstruct</TT
4965
> file portable again,
4966
    the build output on Linux looking like:
4967
4968
    </P
4969
><PRE
4970
CLASS="screen"
4971
>&#13;       % <KBD
4972
CLASS="userinput"
4973
>scons -Q</KBD
4974
>
4975
       cc -o goodbye.o -c -DGOODBYE goodbye.c
4976
       cc -o hello.o -c -DHELLO hello.c
4977
       cc -o hello hello.o goodbye.o
4978
    </PRE
4979
><P
4980
>&#13;
4981
    And on Windows:
4982
4983
    </P
4984
><PRE
4985
CLASS="screen"
4986
>&#13;       C:\&#62;<KBD
4987
CLASS="userinput"
4988
>scons -Q</KBD
4989
>
4990
       cl -DGOODBYE /c goodbye.c /Fogoodbye.obj
4991
       cl -DHELLO /c hello.c /Fohello.obj
4992
       link /nologo /OUT:hello.exe hello.obj goodbye.obj
4993
    </PRE
4994
><P
4995
>&#13;
4996
    We'll see examples of using the list of nodes
4997
    returned by builder methods throughout
4998
    the rest of this guide.
4999
5000
    </P
5001
></DIV
5002
><DIV
5003
CLASS="section"
5004
><HR><H2
5005
CLASS="section"
5006
><A
5007
NAME="AEN734"
5008
>5.2. Explicitly Creating File and Directory Nodes</A
5009
></H2
5010
><P
5011
>&#13;
5012
    It's worth mentioning here that
5013
    <SPAN
5014
CLASS="application"
5015
>SCons</SPAN
5016
> maintains a clear distinction
5017
    between Nodes that represent files
5018
    and Nodes that represent directories.
5019
    <SPAN
5020
CLASS="application"
5021
>SCons</SPAN
5022
> supports <CODE
5023
CLASS="function"
5024
>File</CODE
5025
> and <CODE
5026
CLASS="function"
5027
>Dir</CODE
5028
>
5029
    functions that, repectively,
5030
    return a file or directory Node:
5031
5032
    </P
5033
><PRE
5034
CLASS="programlisting"
5035
>&#13;      hello_c = File('hello.c')
5036
      Program(hello_c)
5037
5038
      classes = Dir('classes')
5039
      Java(classes, 'src')
5040
    </PRE
5041
><P
5042
>&#13;
5043
    Normally, you don't need to call
5044
    <CODE
5045
CLASS="function"
5046
>File</CODE
5047
> or <CODE
5048
CLASS="function"
5049
>Dir</CODE
5050
> directly,
5051
    because calling a builder method automatically
5052
    treats strings as the names of files or directories,
5053
    and translates them into
5054
    the Node objects for you.
5055
    The <CODE
5056
CLASS="function"
5057
>File</CODE
5058
> and <CODE
5059
CLASS="function"
5060
>Dir</CODE
5061
> functions can come in handy
5062
    in situations where you need to explicitly
5063
    instruct <SPAN
5064
CLASS="application"
5065
>SCons</SPAN
5066
> about the type of Node being
5067
    passed to a builder or other function,
5068
    or unambiguously refer to a specific
5069
    file in a directory tree.
5070
    
5071
5072
    </P
5073
><P
5074
>&#13;
5075
    There are also times when you may need to
5076
    refer to an entry in a file system
5077
    without knowing in advance
5078
    whether it's a file or a directory.
5079
    For those situations,
5080
    <SPAN
5081
CLASS="application"
5082
>SCons</SPAN
5083
> also supports an <CODE
5084
CLASS="function"
5085
>Entry</CODE
5086
> function,
5087
    which returns a Node
5088
    that can represent either a file or a directory.
5089
5090
    </P
5091
><PRE
5092
CLASS="programlisting"
5093
>&#13;    xyzzy = Entry('xyzzy')
5094
    </PRE
5095
><P
5096
>&#13;
5097
    The returned <TT
5098
CLASS="literal"
5099
>xyzzy</TT
5100
> Node
5101
    will be turned into a file or directory Node
5102
    the first time it is used by a builder method
5103
    or other function that
5104
    requires one vs. the other.
5105
5106
    </P
5107
></DIV
5108
><DIV
5109
CLASS="section"
5110
><HR><H2
5111
CLASS="section"
5112
><A
5113
NAME="AEN754"
5114
>5.3. Printing <CODE
5115
CLASS="classname"
5116
>Node</CODE
5117
> File Names</A
5118
></H2
5119
><P
5120
>&#13;
5121
    One of the most common things you can do
5122
    with a Node is use it to print the
5123
    file name that the node represents.
5124
    For example, the following <TT
5125
CLASS="filename"
5126
>SConstruct</TT
5127
> file:
5128
5129
    </P
5130
><PRE
5131
CLASS="programlisting"
5132
>&#13;      hello_c = File('hello.c')
5133
      Program(hello_c)
5134
5135
      classes = Dir('classes')
5136
      Java(classes, 'src')
5137
5138
      object_list = Object('hello.c')
5139
      program_list = Program(object_list)
5140
      print "The object file is:", object_list[0]
5141
      print "The program file is:", program_list[0]
5142
    </PRE
5143
><P
5144
>&#13;
5145
    Would print the following file names on a POSIX system:
5146
5147
    </P
5148
><PRE
5149
CLASS="screen"
5150
>&#13;      % <KBD
5151
CLASS="userinput"
5152
>scons -Q</KBD
5153
>
5154
      The object file is: hello.o
5155
      The program file is: hello
5156
      cc -o hello.o -c hello.c
5157
      cc -o hello hello.o
5158
    </PRE
5159
><P
5160
>&#13;
5161
    And the following file names on a Windows system:
5162
5163
    </P
5164
><PRE
5165
CLASS="screen"
5166
>&#13;      C:\&#62;<KBD
5167
CLASS="userinput"
5168
>scons -Q</KBD
5169
>
5170
      The object file is: hello.obj
5171
      The program file is: hello.exe
5172
      cl /nologo /c hello.c /Fohello.obj
5173
      link /nologo /OUT:hello.exe hello.obj
5174
    </PRE
5175
></DIV
5176
><DIV
5177
CLASS="section"
5178
><HR><H2
5179
CLASS="section"
5180
><A
5181
NAME="AEN766"
5182
>5.4. Using a <CODE
5183
CLASS="classname"
5184
>Node</CODE
5185
>'s File Name as a String</A
5186
></H2
5187
><P
5188
>&#13;
5189
    Printing a <CODE
5190
CLASS="classname"
5191
>Node</CODE
5192
>'s name
5193
    as described in the previous section
5194
    works because the string representation of a <CODE
5195
CLASS="classname"
5196
>Node</CODE
5197
>
5198
    is the name of the file.
5199
    If you want to do something other than
5200
    print the name of the file,
5201
    you can fetch it by using the builtin Python
5202
    <CODE
5203
CLASS="function"
5204
>str</CODE
5205
> function.
5206
    For example, if you want to use the Python
5207
    <CODE
5208
CLASS="function"
5209
>os.path.exists</CODE
5210
>
5211
    to figure out whether a file
5212
    exists while the <TT
5213
CLASS="filename"
5214
>SConstruct</TT
5215
> file
5216
    is being read and executed,
5217
    you can fetch the string as follows:
5218
5219
    </P
5220
><PRE
5221
CLASS="programlisting"
5222
>&#13;      import os.path
5223
      program_list = Program('hello.c')
5224
      program_name = str(program_list[0])
5225
      if not os.path.exists(program_name):
5226
          print program_name, "does not exist!"
5227
    </PRE
5228
><P
5229
>&#13;
5230
    Which executes as follows on a POSIX system:
5231
5232
    </P
5233
><PRE
5234
CLASS="screen"
5235
>&#13;      % <KBD
5236
CLASS="userinput"
5237
>scons -Q</KBD
5238
>
5239
      hello does not exist!
5240
      cc -o hello.o -c hello.c
5241
      cc -o hello hello.o
5242
    </PRE
5243
></DIV
5244
></DIV
5245
><DIV
5246
CLASS="chapter"
5247
><HR><H1
5248
><A
5249
NAME="chap-depends"
5250
></A
5251
>Chapter 6. Dependencies</H1
5252
><P
5253
>&#13;
5254
  So far we've seen how <SPAN
5255
CLASS="application"
5256
>SCons</SPAN
5257
> handles one-time builds.
5258
  But one of the main functions of a build tool like <SPAN
5259
CLASS="application"
5260
>SCons</SPAN
5261
>
5262
  is to rebuild only the necessary things
5263
  when source files change--or, put another way,
5264
  <SPAN
5265
CLASS="application"
5266
>SCons</SPAN
5267
> should <SPAN
5268
CLASS="emphasis"
5269
><I
5270
CLASS="emphasis"
5271
>not</I
5272
></SPAN
5273
>
5274
  waste time rebuilding things that have already been built.
5275
  You can see this at work simply by re-invoking <SPAN
5276
CLASS="application"
5277
>SCons</SPAN
5278
>
5279
  after building our simple <SPAN
5280
CLASS="application"
5281
>hello</SPAN
5282
> example:
5283
5284
  </P
5285
><PRE
5286
CLASS="screen"
5287
>&#13;     % <KBD
5288
CLASS="userinput"
5289
>scons -Q</KBD
5290
>
5291
     cc -o hello.o -c hello.c
5292
     cc -o hello hello.o
5293
     % <KBD
5294
CLASS="userinput"
5295
>scons -Q</KBD
5296
>
5297
     scons: `.' is up to date.
5298
  </PRE
5299
><P
5300
>&#13;
5301
  The second time it is executed,
5302
  <SPAN
5303
CLASS="application"
5304
>SCons</SPAN
5305
> realizes that the <SPAN
5306
CLASS="application"
5307
>hello</SPAN
5308
> program
5309
  is up-to-date with respect to the current <TT
5310
CLASS="filename"
5311
>hello.c</TT
5312
> source file,
5313
  and avoids rebuilding it.
5314
  You can see this more clearly by naming
5315
  the <SPAN
5316
CLASS="application"
5317
>hello</SPAN
5318
> program explicitly on the command line:
5319
5320
  </P
5321
><PRE
5322
CLASS="screen"
5323
>&#13;     % <KBD
5324
CLASS="userinput"
5325
>scons -Q hello</KBD
5326
>
5327
     cc -o hello.o -c hello.c
5328
     cc -o hello hello.o
5329
     % <KBD
5330
CLASS="userinput"
5331
>scons -Q hello</KBD
5332
>
5333
     scons: `hello' is up to date.
5334
  </PRE
5335
><P
5336
>&#13;
5337
  Note that <SPAN
5338
CLASS="application"
5339
>SCons</SPAN
5340
> reports <TT
5341
CLASS="literal"
5342
>"...is up to date"</TT
5343
>
5344
  only for target files named explicitly on the command line,
5345
  to avoid cluttering the output.
5346
5347
  </P
5348
><DIV
5349
CLASS="section"
5350
><HR><H2
5351
CLASS="section"
5352
><A
5353
NAME="AEN802"
5354
>6.1. Deciding When an Input File Has Changed:  the <CODE
5355
CLASS="function"
5356
>Decider</CODE
5357
> Function</A
5358
></H2
5359
><P
5360
>&#13;
5361
    Another aspect of avoiding unnecessary rebuilds
5362
    is the fundamental build tool behavior
5363
    of <SPAN
5364
CLASS="emphasis"
5365
><I
5366
CLASS="emphasis"
5367
>rebuilding</I
5368
></SPAN
5369
>
5370
    things when an input file changes,
5371
    so that the built software is up to date.
5372
    By default,
5373
    <SPAN
5374
CLASS="application"
5375
>SCons</SPAN
5376
> keeps track of this through an
5377
    MD5 <TT
5378
CLASS="literal"
5379
>signature</TT
5380
>, or checksum, of the contents of each file,
5381
    although you can easily configure
5382
    <SPAN
5383
CLASS="application"
5384
>SCons</SPAN
5385
> to use the
5386
    modification times (or time stamps)
5387
    instead.
5388
    You can even specify your own Python function
5389
    for deciding if an input file has changed.
5390
5391
    </P
5392
><DIV
5393
CLASS="section"
5394
><HR><H3
5395
CLASS="section"
5396
><A
5397
NAME="AEN810"
5398
>6.1.1. Using MD5 Signatures to Decide if a File Has Changed</A
5399
></H3
5400
><P
5401
>&#13;
5402
      By default,
5403
      <SPAN
5404
CLASS="application"
5405
>SCons</SPAN
5406
> keeps track of whether a file has changed
5407
      based on an MD5 checksum of the file's contents,
5408
      not the file's modification time.
5409
      This means that you may be surprised by the
5410
      default <SPAN
5411
CLASS="application"
5412
>SCons</SPAN
5413
> behavior if you are used to the
5414
      <SPAN
5415
CLASS="application"
5416
>Make</SPAN
5417
> convention of forcing
5418
      a rebuild by updating the file's modification time
5419
      (using the <SPAN
5420
CLASS="application"
5421
>touch</SPAN
5422
> command, for example):
5423
5424
      </P
5425
><PRE
5426
CLASS="screen"
5427
>&#13;         % <KBD
5428
CLASS="userinput"
5429
>scons -Q hello</KBD
5430
>
5431
         cc -o hello.o -c hello.c
5432
         cc -o hello hello.o
5433
         % <KBD
5434
CLASS="userinput"
5435
>touch hello.c</KBD
5436
>
5437
         % <KBD
5438
CLASS="userinput"
5439
>scons -Q hello</KBD
5440
>
5441
         scons: `hello' is up to date.
5442
      </PRE
5443
><P
5444
>&#13;
5445
      Even though the file's modification time has changed,
5446
      <SPAN
5447
CLASS="application"
5448
>SCons</SPAN
5449
> realizes that the contents of the
5450
      <TT
5451
CLASS="filename"
5452
>hello.c</TT
5453
> file have <SPAN
5454
CLASS="emphasis"
5455
><I
5456
CLASS="emphasis"
5457
>not</I
5458
></SPAN
5459
> changed,
5460
      and therefore that the <SPAN
5461
CLASS="application"
5462
>hello</SPAN
5463
> program
5464
      need not be rebuilt.
5465
      This avoids unnecessary rebuilds when,
5466
      for example, someone rewrites the
5467
      contents of a file without making a change.
5468
      But if the contents of the file really do change,
5469
      then <SPAN
5470
CLASS="application"
5471
>SCons</SPAN
5472
> detects the change
5473
      and rebuilds the program as required:
5474
5475
      </P
5476
><PRE
5477
CLASS="screen"
5478
>&#13;         % <KBD
5479
CLASS="userinput"
5480
>scons -Q hello</KBD
5481
>
5482
         cc -o hello.o -c hello.c
5483
         cc -o hello hello.o
5484
         % <KBD
5485
CLASS="userinput"
5486
>edit hello.c</KBD
5487
>
5488
             [CHANGE THE CONTENTS OF hello.c]
5489
         % <KBD
5490
CLASS="userinput"
5491
>scons -Q hello</KBD
5492
>
5493
         cc -o hello.o -c hello.c
5494
         cc -o hello hello.o
5495
      </PRE
5496
><P
5497
>&#13;
5498
      Note that you can, if you wish,
5499
      specify this default behavior
5500
      (MD5 signatures) explicitly
5501
      using the <CODE
5502
CLASS="function"
5503
>Decider</CODE
5504
> function as follows:
5505
5506
      </P
5507
><PRE
5508
CLASS="programlisting"
5509
>&#13;        Program('hello.c')
5510
        Decider('MD5')
5511
      </PRE
5512
><P
5513
>&#13;
5514
      You can also use the string <TT
5515
CLASS="literal"
5516
>'content'</TT
5517
>
5518
      as a synonym for <TT
5519
CLASS="literal"
5520
>'MD5'</TT
5521
>
5522
      when calling the <CODE
5523
CLASS="function"
5524
>Decider</CODE
5525
> function.
5526
5527
      </P
5528
><DIV
5529
CLASS="section"
5530
><HR><H4
5531
CLASS="section"
5532
><A
5533
NAME="AEN838"
5534
>6.1.1.1. Ramifications of Using MD5 Signatures</A
5535
></H4
5536
><P
5537
>&#13;
5538
        Using MD5 Signatures to decide if an input file has changed
5539
        has one surprising benefit:
5540
        if a source file has been changed
5541
        in such a way that the contents of the
5542
        rebuilt target file(s)
5543
        will be exactly the same as the last time
5544
        the file was built,
5545
        then any "downstream" target files
5546
        that depend on the rebuilt-but-not-changed target
5547
        file actually need not be rebuilt.
5548
5549
        </P
5550
><P
5551
>&#13;
5552
        So if, for example,
5553
        a user were to only change a comment in a <TT
5554
CLASS="filename"
5555
>hello.c</TT
5556
> file,
5557
        then the rebuilt <TT
5558
CLASS="filename"
5559
>hello.o</TT
5560
> file
5561
        would be exactly the same as the one previously built
5562
        (assuming the compiler doesn't put any build-specific
5563
        information in the object file).
5564
        <SPAN
5565
CLASS="application"
5566
>SCons</SPAN
5567
> would then realize that it would not
5568
        need to rebuild the <SPAN
5569
CLASS="application"
5570
>hello</SPAN
5571
> program as follows:
5572
5573
        </P
5574
><PRE
5575
CLASS="screen"
5576
>&#13;           % <KBD
5577
CLASS="userinput"
5578
>scons -Q hello</KBD
5579
>
5580
           cc -o hello.o -c hello.c
5581
           cc -o hello hello.o
5582
           % <KBD
5583
CLASS="userinput"
5584
>edit hello.c</KBD
5585
>
5586
             [CHANGE A COMMENT IN hello.c]
5587
           % <KBD
5588
CLASS="userinput"
5589
>scons -Q hello</KBD
5590
>
5591
           cc -o hello.o -c hello.c
5592
           scons: `hello' is up to date.
5593
        </PRE
5594
><P
5595
>&#13;
5596
        In essence, <SPAN
5597
CLASS="application"
5598
>SCons</SPAN
5599
>
5600
        "short-circuits" any dependent builds
5601
        when it realizes that a target file
5602
        has been rebuilt to exactly the same file as the last build.
5603
        This does take some extra processing time
5604
        to read the contents of the target (<TT
5605
CLASS="filename"
5606
>hello.o</TT
5607
>) file,
5608
        but often saves time when the rebuild that was avoided
5609
        would have been time-consuming and expensive.
5610
5611
        </P
5612
></DIV
5613
></DIV
5614
><DIV
5615
CLASS="section"
5616
><HR><H3
5617
CLASS="section"
5618
><A
5619
NAME="AEN853"
5620
>6.1.2. Using Time Stamps to Decide If a File Has Changed</A
5621
></H3
5622
><P
5623
>&#13;
5624
      If you prefer, you can
5625
      configure <SPAN
5626
CLASS="application"
5627
>SCons</SPAN
5628
> to use the modification time
5629
      of a file, not the file contents,
5630
      when deciding if a target needs to be rebuilt.
5631
      <SPAN
5632
CLASS="application"
5633
>SCons</SPAN
5634
> gives you two ways to use time stamps
5635
      to decide if an input file has changed
5636
      since the last time a target has been built.
5637
5638
      </P
5639
><P
5640
>&#13;
5641
      The most familiar way to use time stamps
5642
      is the way <SPAN
5643
CLASS="application"
5644
>Make</SPAN
5645
> does:
5646
      that is, have <SPAN
5647
CLASS="application"
5648
>SCons</SPAN
5649
> decide
5650
      and target must be rebuilt if
5651
      if a source file's modification time is
5652
      <SPAN
5653
CLASS="emphasis"
5654
><I
5655
CLASS="emphasis"
5656
>newer</I
5657
></SPAN
5658
>
5659
      than the target file.
5660
      To do this, call the <CODE
5661
CLASS="function"
5662
>Decider</CODE
5663
>
5664
      function as follows:
5665
5666
      </P
5667
><PRE
5668
CLASS="programlisting"
5669
>&#13;        Program('hello.c')
5670
        Decider('timestamp-newer')
5671
      </PRE
5672
><P
5673
>&#13;
5674
      This makes <SPAN
5675
CLASS="application"
5676
>SCons</SPAN
5677
> act like <SPAN
5678
CLASS="application"
5679
>Make</SPAN
5680
>
5681
      when a file's modification time is updated
5682
      (using the <SPAN
5683
CLASS="application"
5684
>touch</SPAN
5685
> command, for example):
5686
5687
      </P
5688
><PRE
5689
CLASS="screen"
5690
>&#13;         % <KBD
5691
CLASS="userinput"
5692
>scons -Q hello</KBD
5693
>
5694
         cc -o hello.o -c hello.c
5695
         cc -o hello hello.o
5696
         % <KBD
5697
CLASS="userinput"
5698
>touch hello.c</KBD
5699
>
5700
         % <KBD
5701
CLASS="userinput"
5702
>scons -Q hello</KBD
5703
>
5704
         cc -o hello.o -c hello.c
5705
         cc -o hello hello.o
5706
      </PRE
5707
><P
5708
>&#13;
5709
      And, in fact, because this behavior is the same
5710
      as the behavior of <SPAN
5711
CLASS="application"
5712
>Make</SPAN
5713
>,
5714
      you can also use the string <TT
5715
CLASS="literal"
5716
>'make'</TT
5717
>
5718
      as a synonym for <TT
5719
CLASS="literal"
5720
>'timestamp-newer'</TT
5721
>
5722
      when calling the <CODE
5723
CLASS="function"
5724
>Decider</CODE
5725
> function:
5726
5727
      </P
5728
><PRE
5729
CLASS="programlisting"
5730
>&#13;        Program('hello.c')
5731
        Decider('make')
5732
      </PRE
5733
><P
5734
>&#13;
5735
      One drawback to using times stamps exactly like <SPAN
5736
CLASS="application"
5737
>Make</SPAN
5738
>
5739
      is that if an input file's modification time suddenly
5740
      becomes <SPAN
5741
CLASS="emphasis"
5742
><I
5743
CLASS="emphasis"
5744
>older</I
5745
></SPAN
5746
> than a target file,
5747
      the target file will not be rebuilt.
5748
      This can happen if an old copy of a source file is restored
5749
      from a backup archive, for example.
5750
      The contents of the restored file will likely be different
5751
      than they were the last time a dependent target was built,
5752
      but the target won't be rebuilt
5753
      because the modification time of the source file
5754
      is not newer than the target.
5755
5756
      </P
5757
><P
5758
>&#13;
5759
      Because <SPAN
5760
CLASS="application"
5761
>SCons</SPAN
5762
> actually stores information
5763
      about the source files' time stamps whenever a target is built,
5764
      it can handle this situation by checking for
5765
      an exact match of the source file time stamp,
5766
      instead of just whether or not the source file
5767
      is newer than the target file.
5768
      To do this, specify the argument
5769
      <TT
5770
CLASS="literal"
5771
>'timestamp-match'</TT
5772
>
5773
      when calling the <CODE
5774
CLASS="function"
5775
>Decider</CODE
5776
> function:
5777
5778
      </P
5779
><PRE
5780
CLASS="programlisting"
5781
>&#13;        Program('hello.c')
5782
        Decider('timestamp-match')
5783
      </PRE
5784
><P
5785
>&#13;
5786
      When configured this way,
5787
      <SPAN
5788
CLASS="application"
5789
>SCons</SPAN
5790
> will rebuild a target whenever
5791
      a source file's modification time has changed.
5792
      So if we use the <TT
5793
CLASS="literal"
5794
>touch -t</TT
5795
>
5796
      option to change the modification time of
5797
      <TT
5798
CLASS="filename"
5799
>hello.c</TT
5800
> to an old date (January 1, 1989),
5801
      <SPAN
5802
CLASS="application"
5803
>SCons</SPAN
5804
> will still rebuild the target file:
5805
5806
      </P
5807
><PRE
5808
CLASS="screen"
5809
>&#13;         % <KBD
5810
CLASS="userinput"
5811
>scons -Q hello</KBD
5812
>
5813
         cc -o hello.o -c hello.c
5814
         cc -o hello hello.o
5815
         % <KBD
5816
CLASS="userinput"
5817
>touch -t 198901010000 hello.c</KBD
5818
>
5819
         % <KBD
5820
CLASS="userinput"
5821
>scons -Q hello</KBD
5822
>
5823
         cc -o hello.o -c hello.c
5824
         scons: `hello' is up to date.
5825
      </PRE
5826
><P
5827
>&#13;
5828
      In general, the only reason to prefer
5829
      <TT
5830
CLASS="literal"
5831
>timestamp-newer</TT
5832
>
5833
      instead of
5834
      <TT
5835
CLASS="literal"
5836
>timestamp-match</TT
5837
>,
5838
      would be if you have some specific reason
5839
      to require this <SPAN
5840
CLASS="application"
5841
>Make</SPAN
5842
>-like behavior of 
5843
      not rebuilding a target when an otherwise-modified
5844
      source file is older.
5845
5846
      </P
5847
></DIV
5848
><DIV
5849
CLASS="section"
5850
><HR><H3
5851
CLASS="section"
5852
><A
5853
NAME="AEN899"
5854
>6.1.3. Deciding If a File Has Changed Using Both MD Signatures and Time Stamps</A
5855
></H3
5856
><P
5857
>&#13;
5858
      As a performance enhancement,
5859
      <SPAN
5860
CLASS="application"
5861
>SCons</SPAN
5862
> provides a way to use
5863
      MD5 checksums of file contents
5864
      but to only read the contents
5865
      whenever the file's timestamp has changed.
5866
      To do this, call the <CODE
5867
CLASS="function"
5868
>Decider</CODE
5869
>
5870
      function with <TT
5871
CLASS="literal"
5872
>'MD5-timestamp'</TT
5873
>
5874
      argument as follows:
5875
5876
      </P
5877
><PRE
5878
CLASS="programlisting"
5879
>&#13;        Program('hello.c')
5880
        Decider('MD5-timestamp')
5881
      </PRE
5882
><P
5883
>&#13;
5884
      So configured, <SPAN
5885
CLASS="application"
5886
>SCons</SPAN
5887
> will still behave like
5888
      it does when using <TT
5889
CLASS="literal"
5890
>Decider('MD5')</TT
5891
>:
5892
5893
      </P
5894
><PRE
5895
CLASS="screen"
5896
>&#13;         % <KBD
5897
CLASS="userinput"
5898
>scons -Q hello</KBD
5899
>
5900
         cc -o hello.o -c hello.c
5901
         cc -o hello hello.o
5902
         % <KBD
5903
CLASS="userinput"
5904
>touch hello.c</KBD
5905
>
5906
         % <KBD
5907
CLASS="userinput"
5908
>scons -Q hello</KBD
5909
>
5910
         scons: `hello' is up to date.
5911
         % <KBD
5912
CLASS="userinput"
5913
>edit hello.c</KBD
5914
>
5915
             [CHANGE THE CONTENTS OF hello.c]
5916
         % <KBD
5917
CLASS="userinput"
5918
>scons -Q hello</KBD
5919
>
5920
         scons: `hello' is up to date.
5921
      </PRE
5922
><P
5923
>&#13;
5924
      However, the second call to <SPAN
5925
CLASS="application"
5926
>SCons</SPAN
5927
> in the above output,
5928
      when the build is up-to-date,
5929
      will have been performed by simply looking at the
5930
      modification time of the <TT
5931
CLASS="filename"
5932
>hello.c</TT
5933
> file,
5934
      not by opening it and performing
5935
      an MD5 checksum calcuation on its contents.
5936
      This can significantly speed up many up-to-date builds.
5937
5938
      </P
5939
><P
5940
>&#13;
5941
      The only drawback to using
5942
      <TT
5943
CLASS="literal"
5944
>Decider('MD5-timestamp')</TT
5945
>
5946
      is that <SPAN
5947
CLASS="application"
5948
>SCons</SPAN
5949
> will <SPAN
5950
CLASS="emphasis"
5951
><I
5952
CLASS="emphasis"
5953
>not</I
5954
></SPAN
5955
>
5956
      rebuild a target file if a source file was modified
5957
      within one second of the last time <SPAN
5958
CLASS="application"
5959
>SCons</SPAN
5960
> built the file.
5961
      While most developers are programming,
5962
      this isn't a problem in practice,
5963
      since it's unlikely that someone will have built
5964
      and then thought quickly enought to make a substantive
5965
      change to a source file within one second.
5966
      Certain build scripts or
5967
      continuous integration tools may, however,
5968
      rely on the ability to applying changes to files
5969
      automatically and then rebuild as quickly as possible,
5970
      in which case use of
5971
      <TT
5972
CLASS="literal"
5973
>Decider('MD5-timestamp')</TT
5974
>
5975
      may not be appropriate.
5976
5977
      </P
5978
></DIV
5979
><DIV
5980
CLASS="section"
5981
><HR><H3
5982
CLASS="section"
5983
><A
5984
NAME="AEN924"
5985
>6.1.4. Writing Your Own Custom <CODE
5986
CLASS="function"
5987
>Decider</CODE
5988
> Function</A
5989
></H3
5990
><P
5991
>&#13;
5992
      The different string values that we've passed to
5993
      the <CODE
5994
CLASS="function"
5995
>Decider</CODE
5996
> function are essentially used by <SPAN
5997
CLASS="application"
5998
>SCons</SPAN
5999
>
6000
      to pick one of several specific internal functions
6001
      that implement various ways of deciding if a dependency
6002
      (usually a source file)
6003
      has changed since a target file has been built.
6004
      As it turns out,
6005
      you can also supply your own function
6006
      to decide if a dependency has changed.
6007
6008
      </P
6009
><P
6010
>&#13;
6011
      For example, suppose we have an input file
6012
      that contains a lot of data,
6013
      in some specific regular format,
6014
      that is used to rebuild a lot of different target files,
6015
      but each target file really only depends on
6016
      one particular section of the input file.
6017
      We'd like to have each target file depend on
6018
      only its section of the input file.
6019
      However, since the input file may contain a lot of data,
6020
      we only want to open the input file if its timestamp has changed.
6021
      This could done with a custom
6022
      <CODE
6023
CLASS="function"
6024
>Decider</CODE
6025
> function that might look something like this:
6026
6027
      </P
6028
><PRE
6029
CLASS="programlisting"
6030
>&#13;        Program('hello.c')
6031
        def decide_if_changed(dependency, target, prev_ni):
6032
            if self.get_timestamp() != prev_ni.timestamp:
6033
                dep = str(dependency)
6034
                tgt = str(target)
6035
                if specific_part_of_file_has_changed(dep, tgt):
6036
                    return True
6037
            return False
6038
        Decider(decide_if_changed)
6039
      </PRE
6040
><P
6041
>&#13;
6042
      Note that in the function definition,
6043
      the <TT
6044
CLASS="literal"
6045
>dependency</TT
6046
>
6047
      (input file) is the first argument,
6048
      and then the <TT
6049
CLASS="literal"
6050
>target</TT
6051
>.
6052
      Both of these are passed to the functions as
6053
      SCons <CODE
6054
CLASS="classname"
6055
>Node</CODE
6056
> objects,
6057
      which we convert to strings using the Python
6058
      <CODE
6059
CLASS="function"
6060
>str()</CODE
6061
>.
6062
      The third argument, <TT
6063
CLASS="literal"
6064
>prev_ni</TT
6065
>,
6066
      is an object that holds the
6067
      signature or timestamp information
6068
      that was recorded about the dependency
6069
      the last time the target was built.
6070
6071
      </P
6072
><P
6073
>&#13;
6074
      Note that ignoring some of the arguments
6075
      in your custom <CODE
6076
CLASS="function"
6077
>Decider</CODE
6078
> function
6079
      is a perfectly normal thing to do,
6080
      if they don't impact the way you want to
6081
      decide if the dependency file has changed.
6082
6083
      </P
6084
></DIV
6085
><DIV
6086
CLASS="section"
6087
><HR><H3
6088
CLASS="section"
6089
><A
6090
NAME="AEN941"
6091
>6.1.5. Mixing Different Ways of Deciding If a File Has Changed</A
6092
></H3
6093
><P
6094
>&#13;
6095
      The previous examples have all demonstrated calling
6096
      the global <CODE
6097
CLASS="function"
6098
>Decider</CODE
6099
> function
6100
      to configure all dependency decisions that <SPAN
6101
CLASS="application"
6102
>SCons</SPAN
6103
> makes.
6104
      Sometimes, however, you want to be able to configure
6105
      different decision-making for different targets.
6106
      When that's necessary, you can use the
6107
      <CODE
6108
CLASS="function"
6109
>env.Decider</CODE
6110
>
6111
      method to affect only the configuration
6112
      decisions for targets built with a
6113
      specific construction environment.
6114
6115
      </P
6116
><P
6117
>&#13;
6118
      For example, if we arbitrarily want to build
6119
      one program using MD5 checkums
6120
      and another use file modification times
6121
      from the same source
6122
      we might configure it this way:
6123
6124
      </P
6125
><PRE
6126
CLASS="programlisting"
6127
>&#13;        env1 = Environment(CPPPATH = ['.'])
6128
        env2 = env1.Clone()
6129
        env2.Decider('timestamp-match')
6130
        env1.Program('prog-MD5', 'program1.c')
6131
        env2.Program('prog-timestamp', 'program2.c')
6132
      </PRE
6133
><P
6134
>&#13;
6135
      If both of the programs include the same
6136
      <TT
6137
CLASS="filename"
6138
>inc.h</TT
6139
> file,
6140
      then updating the modification time of
6141
      <TT
6142
CLASS="filename"
6143
>inc.h</TT
6144
>
6145
      (using the <SPAN
6146
CLASS="application"
6147
>touch</SPAN
6148
> command)
6149
      will cause only <TT
6150
CLASS="filename"
6151
>prog-timestamp</TT
6152
>
6153
      to be rebuilt:
6154
6155
      </P
6156
><PRE
6157
CLASS="screen"
6158
>&#13;         % <KBD
6159
CLASS="userinput"
6160
>scons -Q</KBD
6161
>
6162
         cc -o program1.o -c -I. program1.c
6163
         cc -o prog-MD5 program1.o
6164
         cc -o program2.o -c -I. program2.c
6165
         cc -o prog-timestamp program2.o
6166
         % <KBD
6167
CLASS="userinput"
6168
>touch inc.h</KBD
6169
>
6170
         % <KBD
6171
CLASS="userinput"
6172
>scons -Q</KBD
6173
>
6174
         cc -o program2.o -c -I. program2.c
6175
         cc -o prog-timestamp program2.o
6176
      </PRE
6177
></DIV
6178
></DIV
6179
><DIV
6180
CLASS="section"
6181
><HR><H2
6182
CLASS="section"
6183
><A
6184
NAME="AEN958"
6185
>6.2. Older Functions for Deciding When an Input File Has Changed</A
6186
></H2
6187
><P
6188
>&#13;
6189
    <SPAN
6190
CLASS="application"
6191
>SCons</SPAN
6192
> still supports two functions that used to be the
6193
    primary methods for configuring the
6194
    decision about whether or not an input file has changed.
6195
    Although they're not officially deprecated yet,
6196
    their use is discouraged,
6197
    mainly because they rely on a somewhat
6198
    confusing distinction between how
6199
    source files and target files are handled.
6200
    These functions are documented here mainly in case you
6201
    encounter them in existing <TT
6202
CLASS="filename"
6203
>SConscript</TT
6204
> files.
6205
6206
    </P
6207
><DIV
6208
CLASS="section"
6209
><HR><H3
6210
CLASS="section"
6211
><A
6212
NAME="AEN963"
6213
>6.2.1. The <CODE
6214
CLASS="function"
6215
>SourceSignatures</CODE
6216
> Function</A
6217
></H3
6218
><P
6219
>&#13;
6220
      The <CODE
6221
CLASS="function"
6222
>SourceSignatures</CODE
6223
> function is fairly straightforward,
6224
      and supports two different argument values
6225
      to configure whether source file changes should be decided
6226
      using MD5 signatures:
6227
6228
      </P
6229
><PRE
6230
CLASS="programlisting"
6231
>&#13;        Program('hello.c')
6232
        SourceSignatures('MD5')
6233
      </PRE
6234
><P
6235
>&#13;
6236
      Or using time stamps:
6237
6238
      </P
6239
><PRE
6240
CLASS="programlisting"
6241
>&#13;        Program('hello.c')
6242
        SourceSignatures('timestamp')
6243
      </PRE
6244
><P
6245
>&#13;
6246
      These are roughly equivalent to specifying
6247
      <CODE
6248
CLASS="function"
6249
>Decider('MD5')</CODE
6250
>
6251
      or
6252
      <CODE
6253
CLASS="function"
6254
>Decider('timestamp-match')</CODE
6255
>,
6256
      respectively,
6257
      although it only affects how SCons makes
6258
      decisions about dependencies on
6259
      <SPAN
6260
CLASS="emphasis"
6261
><I
6262
CLASS="emphasis"
6263
>source</I
6264
></SPAN
6265
> files--that is,
6266
      files that are not built from any other files.
6267
6268
      </P
6269
></DIV
6270
><DIV
6271
CLASS="section"
6272
><HR><H3
6273
CLASS="section"
6274
><A
6275
NAME="AEN975"
6276
>6.2.2. The <CODE
6277
CLASS="function"
6278
>TargetSignatures</CODE
6279
> Function</A
6280
></H3
6281
><P
6282
>&#13;
6283
      The <CODE
6284
CLASS="function"
6285
>TargetSignatures</CODE
6286
> function
6287
      specifies how <SPAN
6288
CLASS="application"
6289
>SCons</SPAN
6290
> decides
6291
      when a target file has changed
6292
      <SPAN
6293
CLASS="emphasis"
6294
><I
6295
CLASS="emphasis"
6296
>when it is used as a
6297
      dependency of (input to) another target</I
6298
></SPAN
6299
>--that is,
6300
      the <CODE
6301
CLASS="function"
6302
>TargetSignatures</CODE
6303
> function configures
6304
      how the signatures of "intermediate" target files
6305
      are used when deciding if a "downstream" target file
6306
      must be rebuilt.
6307
      <A
6308
NAME="AEN983"
6309
HREF="#FTN.AEN983"
6310
><SPAN
6311
CLASS="footnote"
6312
>[2]</SPAN
6313
></A
6314
>
6315
6316
      </P
6317
><P
6318
>&#13;
6319
      The <CODE
6320
CLASS="function"
6321
>TargetSignatures</CODE
6322
> function supports the same
6323
      <TT
6324
CLASS="literal"
6325
>'MD5'</TT
6326
> and <TT
6327
CLASS="literal"
6328
>'timestamp'</TT
6329
>
6330
      argument values that are supported by the <CODE
6331
CLASS="function"
6332
>SourceSignatures</CODE
6333
>,
6334
      with the same meanings, but applied to target files.
6335
      That is, in the example:
6336
6337
      </P
6338
><PRE
6339
CLASS="programlisting"
6340
>&#13;        Program('hello.c')
6341
        TargetSignatures('MD5')
6342
      </PRE
6343
><P
6344
>&#13;
6345
      The MD5 checksum of the <TT
6346
CLASS="filename"
6347
>hello.o</TT
6348
> target file
6349
      will be used to decide if it has changed since the last
6350
      time the "downstream" <SPAN
6351
CLASS="application"
6352
>hello</SPAN
6353
> target file was built.
6354
      And in the example:
6355
      
6356
      </P
6357
><PRE
6358
CLASS="programlisting"
6359
>&#13;        Program('hello.c')
6360
        TargetSignatures('timestamp')
6361
      </PRE
6362
><P
6363
>&#13;
6364
      The modification time of the <TT
6365
CLASS="filename"
6366
>hello.o</TT
6367
> target file
6368
      will be used to decide if it has changed since the last
6369
      time the "downstream" <SPAN
6370
CLASS="application"
6371
>hello</SPAN
6372
> target file was built.
6373
6374
      </P
6375
><P
6376
>&#13;
6377
      The <CODE
6378
CLASS="function"
6379
>TargetSignatures</CODE
6380
> function supports
6381
      two additional argument values:
6382
      <TT
6383
CLASS="literal"
6384
>'source'</TT
6385
> and <TT
6386
CLASS="literal"
6387
>'build'</TT
6388
>.
6389
      The <TT
6390
CLASS="literal"
6391
>'source'</TT
6392
> argument
6393
      specifies that decisions involving
6394
      whether target files have changed
6395
      since a previous build
6396
      should use the same behavior
6397
      for the decisions configured for source files
6398
      (using the <CODE
6399
CLASS="function"
6400
>SourceSignatures</CODE
6401
> function).
6402
      So in the example:
6403
6404
      </P
6405
><PRE
6406
CLASS="programlisting"
6407
>&#13;        Program('hello.c')
6408
        TargetSignatures('source')
6409
        SourceSignatures('timestamp')
6410
      </PRE
6411
><P
6412
>&#13;
6413
      All files, both targets and sources,
6414
      will use modification times
6415
      when deciding if an input file
6416
      has changed since the last
6417
      time a target was built.
6418
6419
      </P
6420
><P
6421
>&#13;
6422
      Lastly, the <TT
6423
CLASS="literal"
6424
>'build'</TT
6425
> argument
6426
      specifies that <SPAN
6427
CLASS="application"
6428
>SCons</SPAN
6429
> should examine
6430
      the build status of a target file
6431
      and always rebuild a "downstream" target
6432
      if the target file was itself rebuilt,
6433
      without re-examining the contents or timestamp
6434
      of the newly-built target file.
6435
      If the target file was not rebuilt during
6436
      this <SPAN
6437
CLASS="application"
6438
>scons</SPAN
6439
> invocation,
6440
      then the target file will be examined
6441
      the same way as configured by
6442
      the <CODE
6443
CLASS="function"
6444
>SourceSignature</CODE
6445
> call
6446
      to decide if it has changed.
6447
6448
      </P
6449
><P
6450
>&#13;
6451
      This mimics the behavior of
6452
      <TT
6453
CLASS="literal"
6454
>build signatures</TT
6455
>
6456
      in earlier versions of <SPAN
6457
CLASS="application"
6458
>SCons</SPAN
6459
>.
6460
      A <TT
6461
CLASS="literal"
6462
>build signature</TT
6463
> re-combined
6464
      signatures of all the input files
6465
      that went into making the target file,
6466
      so that the target file itself
6467
      did not need to have its contents read
6468
      to compute an MD5 signature.
6469
      This can improve performance for some configurations,
6470
      but is generally not as effective as using
6471
      <TT
6472
CLASS="literal"
6473
>Decider('MD5-timestamp')</TT
6474
>.
6475
6476
      </P
6477
></DIV
6478
></DIV
6479
><DIV
6480
CLASS="section"
6481
><HR><H2
6482
CLASS="section"
6483
><A
6484
NAME="AEN1020"
6485
>6.3. Implicit Dependencies:  The <CODE
6486
CLASS="envar"
6487
>$CPPPATH</CODE
6488
> Construction Variable</A
6489
></H2
6490
><P
6491
>&#13;
6492
    Now suppose that our "Hello, World!" program
6493
    actually has an <TT
6494
CLASS="literal"
6495
>#include</TT
6496
> line
6497
    to include the <TT
6498
CLASS="filename"
6499
>hello.h</TT
6500
> file in the compilation:
6501
6502
    </P
6503
><PRE
6504
CLASS="programlisting"
6505
>&#13;       #include &#60;hello.h&#62;
6506
       int
6507
       main()
6508
       {
6509
           printf("Hello, %s!\n", string);
6510
       }
6511
    </PRE
6512
><P
6513
>&#13;
6514
    And, for completeness, the <TT
6515
CLASS="filename"
6516
>hello.h</TT
6517
> file looks like this:
6518
6519
    </P
6520
><PRE
6521
CLASS="programlisting"
6522
>&#13;       #define string    "world"
6523
      </PRE
6524
><P
6525
>&#13;
6526
    In this case, we want <SPAN
6527
CLASS="application"
6528
>SCons</SPAN
6529
> to recognize that,
6530
    if the contents of the <TT
6531
CLASS="filename"
6532
>hello.h</TT
6533
> file change,
6534
    the <SPAN
6535
CLASS="application"
6536
>hello</SPAN
6537
> program must be recompiled.
6538
    To do this, we need to modify the
6539
    <TT
6540
CLASS="filename"
6541
>SConstruct</TT
6542
> file like so:
6543
6544
    </P
6545
><PRE
6546
CLASS="programlisting"
6547
>&#13;       Program('hello.c', CPPPATH = '.')
6548
      </PRE
6549
><P
6550
>&#13;
6551
    The <A
6552
HREF="#cv-CPPPATH"
6553
><CODE
6554
CLASS="envar"
6555
>$CPPPATH</CODE
6556
></A
6557
> value
6558
    tells <SPAN
6559
CLASS="application"
6560
>SCons</SPAN
6561
> to look in the current directory
6562
    (<TT
6563
CLASS="literal"
6564
>'.'</TT
6565
>)
6566
    for any files included by C source files
6567
    (<TT
6568
CLASS="filename"
6569
>.c</TT
6570
> or <TT
6571
CLASS="filename"
6572
>.h</TT
6573
> files).
6574
    With this assignment in the <TT
6575
CLASS="filename"
6576
>SConstruct</TT
6577
> file:
6578
6579
    </P
6580
><PRE
6581
CLASS="screen"
6582
>&#13;       % <KBD
6583
CLASS="userinput"
6584
>scons -Q hello</KBD
6585
>
6586
       cc -o hello.o -c -I. hello.c
6587
       cc -o hello hello.o
6588
       % <KBD
6589
CLASS="userinput"
6590
>scons -Q hello</KBD
6591
>
6592
       scons: `hello' is up to date.
6593
       % <KBD
6594
CLASS="userinput"
6595
>edit hello.h</KBD
6596
>
6597
           [CHANGE THE CONTENTS OF hello.h]
6598
       % <KBD
6599
CLASS="userinput"
6600
>scons -Q hello</KBD
6601
>
6602
       cc -o hello.o -c -I. hello.c
6603
       cc -o hello hello.o
6604
    </PRE
6605
><P
6606
>&#13;
6607
    First, notice that <SPAN
6608
CLASS="application"
6609
>SCons</SPAN
6610
>
6611
    added the <TT
6612
CLASS="literal"
6613
>-I.</TT
6614
> argument
6615
    from the <CODE
6616
CLASS="envar"
6617
>$CPPPATH</CODE
6618
> variable
6619
    so that the compilation would find the
6620
    <TT
6621
CLASS="filename"
6622
>hello.h</TT
6623
> file in the local directory.
6624
6625
    </P
6626
><P
6627
>&#13;
6628
    Second, realize that <SPAN
6629
CLASS="application"
6630
>SCons</SPAN
6631
> knows that the <SPAN
6632
CLASS="application"
6633
>hello</SPAN
6634
>
6635
    program must be rebuilt
6636
    because it scans the contents of
6637
    the <TT
6638
CLASS="filename"
6639
>hello.c</TT
6640
> file
6641
    for the <TT
6642
CLASS="literal"
6643
>#include</TT
6644
> lines that indicate
6645
    another file is being included in the compilation.
6646
    <SPAN
6647
CLASS="application"
6648
>SCons</SPAN
6649
> records these as
6650
    <SPAN
6651
CLASS="emphasis"
6652
><I
6653
CLASS="emphasis"
6654
>implicit dependencies</I
6655
></SPAN
6656
>
6657
    of the target file,
6658
    Consequently,
6659
    when the <TT
6660
CLASS="filename"
6661
>hello.h</TT
6662
> file changes,
6663
    <SPAN
6664
CLASS="application"
6665
>SCons</SPAN
6666
> realizes that the <TT
6667
CLASS="filename"
6668
>hello.c</TT
6669
> file includes it,
6670
    and rebuilds the resulting <SPAN
6671
CLASS="application"
6672
>hello</SPAN
6673
> program
6674
    that depends on both the <TT
6675
CLASS="filename"
6676
>hello.c</TT
6677
> and <TT
6678
CLASS="filename"
6679
>hello.h</TT
6680
> files.
6681
6682
    </P
6683
><P
6684
>&#13;
6685
    Like the <A
6686
HREF="#cv-LIBPATH"
6687
><CODE
6688
CLASS="envar"
6689
>$LIBPATH</CODE
6690
></A
6691
> variable,
6692
    the <CODE
6693
CLASS="envar"
6694
>$CPPPATH</CODE
6695
> variable
6696
    may be a list of directories,
6697
    or a string separated by
6698
    the system-specific path separation character
6699
    (':' on POSIX/Linux, ';' on Windows).
6700
    Either way, <SPAN
6701
CLASS="application"
6702
>SCons</SPAN
6703
> creates the
6704
    right command-line options
6705
    so that the following example:
6706
6707
    </P
6708
><PRE
6709
CLASS="programlisting"
6710
>&#13;       Program('hello.c', CPPPATH = ['include', '/home/project/inc'])
6711
    </PRE
6712
><P
6713
>&#13;
6714
    Will look like this on POSIX or Linux:
6715
6716
    </P
6717
><PRE
6718
CLASS="screen"
6719
>&#13;       % <KBD
6720
CLASS="userinput"
6721
>scons -Q hello</KBD
6722
>
6723
       cc -o hello.o -c -Iinclude -I/home/project/inc hello.c
6724
       cc -o hello hello.o
6725
    </PRE
6726
><P
6727
>&#13;
6728
    And like this on Windows:
6729
6730
    </P
6731
><PRE
6732
CLASS="screen"
6733
>&#13;       C:\&#62;<KBD
6734
CLASS="userinput"
6735
>scons -Q hello.exe</KBD
6736
>
6737
       cl /nologo /Iinclude /I\home\project\inc /c hello.c /Fohello.obj
6738
       link /nologo /OUT:hello.exe hello.obj
6739
    </PRE
6740
></DIV
6741
><DIV
6742
CLASS="section"
6743
><HR><H2
6744
CLASS="section"
6745
><A
6746
NAME="AEN1079"
6747
>6.4. Caching Implicit Dependencies</A
6748
></H2
6749
><P
6750
>&#13;
6751
    Scanning each file for <TT
6752
CLASS="literal"
6753
>#include</TT
6754
> lines
6755
    does take some extra processing time.
6756
    When you're doing a full build of a large system,
6757
    the scanning time is usually a very small percentage
6758
    of the overall time spent on the build.
6759
    You're most likely to notice the scanning time,
6760
    however, when you <SPAN
6761
CLASS="emphasis"
6762
><I
6763
CLASS="emphasis"
6764
>rebuild</I
6765
></SPAN
6766
>
6767
    all or part of a large system:
6768
    <SPAN
6769
CLASS="application"
6770
>SCons</SPAN
6771
> will likely take some extra time to "think about"
6772
    what must be built before it issues the
6773
    first build command
6774
    (or decides that everything is up to date
6775
    and nothing must be rebuilt).
6776
6777
 
6778
6779
    </P
6780
><P
6781
>&#13;
6782
    In practice, having <SPAN
6783
CLASS="application"
6784
>SCons</SPAN
6785
> scan files saves time
6786
    relative to the amount of potential time
6787
    lost to tracking down subtle problems
6788
    introduced by incorrect dependencies.
6789
    Nevertheless, the "waiting time"
6790
    while <SPAN
6791
CLASS="application"
6792
>SCons</SPAN
6793
> scans files can annoy
6794
    individual developers waiting for their builds to finish.
6795
    Consequently, <SPAN
6796
CLASS="application"
6797
>SCons</SPAN
6798
> lets you cache
6799
    the implicit dependencies
6800
    that its scanners find,
6801
    for use by later builds.
6802
    You can do this by specifying the
6803
    <TT
6804
CLASS="literal"
6805
>--implicit-cache</TT
6806
> option on the command line:
6807
6808
    </P
6809
><PRE
6810
CLASS="screen"
6811
>&#13;       % <KBD
6812
CLASS="userinput"
6813
>scons -Q --implicit-cache hello</KBD
6814
>
6815
       cc -o hello.o -c hello.c
6816
       cc -o hello hello.o
6817
       % <KBD
6818
CLASS="userinput"
6819
>scons -Q hello</KBD
6820
>
6821
       scons: `hello' is up to date.
6822
    </PRE
6823
><P
6824
>&#13;
6825
    If you don't want to specify <TT
6826
CLASS="literal"
6827
>--implicit-cache</TT
6828
>
6829
    on the command line each time,
6830
    you can make it the default behavior for your build
6831
    by setting the <TT
6832
CLASS="literal"
6833
>implicit_cache</TT
6834
> option
6835
    in an <TT
6836
CLASS="filename"
6837
>SConscript</TT
6838
> file:
6839
6840
    </P
6841
><PRE
6842
CLASS="programlisting"
6843
>&#13;       SetOption('implicit_cache', 1)
6844
    </PRE
6845
><P
6846
>&#13;
6847
    <SPAN
6848
CLASS="application"
6849
>SCons</SPAN
6850
> does not cache implicit dependencies like this by default
6851
    because the <TT
6852
CLASS="literal"
6853
>--implicit-cache</TT
6854
> causes <SPAN
6855
CLASS="application"
6856
>SCons</SPAN
6857
> to simply use the implicit
6858
    dependencies stored during the last run, without any checking
6859
    for whether or not those dependencies are still correct.
6860
    Specifically, this means <TT
6861
CLASS="literal"
6862
>--implicit-cache</TT
6863
> instructs <SPAN
6864
CLASS="application"
6865
>SCons</SPAN
6866
>
6867
    to <SPAN
6868
CLASS="emphasis"
6869
><I
6870
CLASS="emphasis"
6871
>not</I
6872
></SPAN
6873
> rebuild "correctly" in the
6874
    following cases:
6875
6876
6877
    </P
6878
><P
6879
></P
6880
><UL
6881
><LI
6882
><P
6883
>&#13;
6884
        When <TT
6885
CLASS="literal"
6886
>--implicit-cache</TT
6887
> is used, <SPAN
6888
CLASS="application"
6889
>SCons</SPAN
6890
> will ignore any changes that
6891
        may have been made to search paths
6892
        (like <CODE
6893
CLASS="envar"
6894
>$CPPPATH</CODE
6895
> or <CODE
6896
CLASS="envar"
6897
>$LIBPATH</CODE
6898
>,).
6899
        This can lead to <SPAN
6900
CLASS="application"
6901
>SCons</SPAN
6902
> not rebuilding a file if a change to
6903
        <CODE
6904
CLASS="envar"
6905
>$CPPPATH</CODE
6906
> would normally cause a different, same-named file from
6907
        a different directory to be used.
6908
6909
        </P
6910
></LI
6911
><LI
6912
><P
6913
>&#13;
6914
        When <TT
6915
CLASS="literal"
6916
>--implicit-cache</TT
6917
> is used, <SPAN
6918
CLASS="application"
6919
>SCons</SPAN
6920
> will not detect if a
6921
        same-named file has been added to a directory that is earlier in
6922
        the search path than the directory in which the file was found
6923
        last time.
6924
6925
        </P
6926
></LI
6927
></UL
6928
><DIV
6929
CLASS="section"
6930
><HR><H3
6931
CLASS="section"
6932
><A
6933
NAME="AEN1118"
6934
>6.4.1. The <TT
6935
CLASS="literal"
6936
>--implicit-deps-changed</TT
6937
> Option</A
6938
></H3
6939
><P
6940
>&#13;
6941
      When using cached implicit dependencies,
6942
      sometimes you want to "start fresh"
6943
      and have <SPAN
6944
CLASS="application"
6945
>SCons</SPAN
6946
> re-scan the files
6947
      for which it previously cached the dependencies.
6948
      For example,
6949
      if you have recently installed a new version of
6950
      external code that you use for compilation,
6951
      the external header files will have changed
6952
      and the previously-cached implicit dependencies
6953
      will be out of date.
6954
      You can update them by
6955
      running <SPAN
6956
CLASS="application"
6957
>SCons</SPAN
6958
> with the <TT
6959
CLASS="literal"
6960
>--implicit-deps-changed</TT
6961
> option:
6962
6963
      </P
6964
><PRE
6965
CLASS="screen"
6966
>&#13;         % <KBD
6967
CLASS="userinput"
6968
>scons -Q --implicit-deps-changed hello</KBD
6969
>
6970
         cc -o hello.o -c hello.c
6971
         cc -o hello hello.o
6972
         % <KBD
6973
CLASS="userinput"
6974
>scons -Q hello</KBD
6975
>
6976
         scons: `hello' is up to date.
6977
      </PRE
6978
><P
6979
>&#13;
6980
      In this case, <SPAN
6981
CLASS="application"
6982
>SCons</SPAN
6983
> will re-scan all of the implicit dependencies
6984
      and cache updated copies of the information.
6985
6986
      </P
6987
></DIV
6988
><DIV
6989
CLASS="section"
6990
><HR><H3
6991
CLASS="section"
6992
><A
6993
NAME="AEN1130"
6994
>6.4.2. The <TT
6995
CLASS="literal"
6996
>--implicit-deps-unchanged</TT
6997
> Option</A
6998
></H3
6999
><P
7000
>&#13;
7001
      By default when caching dependencies,
7002
      <SPAN
7003
CLASS="application"
7004
>SCons</SPAN
7005
> notices when a file has been modified
7006
      and re-scans the file for any updated
7007
      implicit dependency information.
7008
      Sometimes, however, you may want
7009
      to force <SPAN
7010
CLASS="application"
7011
>SCons</SPAN
7012
> to use the cached implicit dependencies,
7013
      even if the source files changed.
7014
      This can speed up a build for example,
7015
      when you have changed your source files
7016
      but know that you haven't changed
7017
      any <TT
7018
CLASS="literal"
7019
>#include</TT
7020
> lines.
7021
      In this case,
7022
      you can use the <TT
7023
CLASS="literal"
7024
>--implicit-deps-unchanged</TT
7025
> option:
7026
7027
      </P
7028
><PRE
7029
CLASS="screen"
7030
>&#13;         % <KBD
7031
CLASS="userinput"
7032
>scons -Q --implicit-deps-unchanged hello</KBD
7033
>
7034
         cc -o hello.o -c hello.c
7035
         cc -o hello hello.o
7036
         % <KBD
7037
CLASS="userinput"
7038
>scons -Q hello</KBD
7039
>
7040
         scons: `hello' is up to date.
7041
      </PRE
7042
><P
7043
>&#13;
7044
      In this case,
7045
      <SPAN
7046
CLASS="application"
7047
>SCons</SPAN
7048
> will assume that the cached implicit
7049
      dependencies are correct and
7050
      will not bother to re-scan changed files.
7051
      For typical builds after small,
7052
      incremental changes to source files,
7053
      the savings may not be very big,
7054
      but sometimes every bit of
7055
      improved performance counts.
7056
7057
      </P
7058
></DIV
7059
></DIV
7060
><DIV
7061
CLASS="section"
7062
><HR><H2
7063
CLASS="section"
7064
><A
7065
NAME="AEN1143"
7066
>6.5. Explicit Dependencies:  the <CODE
7067
CLASS="function"
7068
>Depends</CODE
7069
> Function</A
7070
></H2
7071
><P
7072
>&#13;
7073
    Sometimes a file depends on another file
7074
    that is not detected by an <SPAN
7075
CLASS="application"
7076
>SCons</SPAN
7077
> scanner.
7078
    For this situation,
7079
    <SPAN
7080
CLASS="application"
7081
>SCons</SPAN
7082
> allows you to specific explicitly that one file
7083
    depends on another file,
7084
    and must be rebuilt whenever that file changes.
7085
    This is specified using the <CODE
7086
CLASS="function"
7087
>Depends</CODE
7088
> method:
7089
7090
    </P
7091
><PRE
7092
CLASS="programlisting"
7093
>&#13;       hello = Program('hello.c')
7094
       Depends(hello, 'other_file')
7095
    </PRE
7096
><PRE
7097
CLASS="screen"
7098
>&#13;       % <KBD
7099
CLASS="userinput"
7100
>scons -Q hello</KBD
7101
>
7102
       cc -c hello.c -o hello.o
7103
       cc -o hello hello.o
7104
       % <KBD
7105
CLASS="userinput"
7106
>scons -Q hello</KBD
7107
>
7108
       scons: `hello' is up to date.
7109
       % <KBD
7110
CLASS="userinput"
7111
>edit other_file</KBD
7112
>
7113
           [CHANGE THE CONTENTS OF other_file]
7114
       % <KBD
7115
CLASS="userinput"
7116
>scons -Q hello</KBD
7117
>
7118
       cc -c hello.c -o hello.o
7119
       cc -o hello hello.o
7120
    </PRE
7121
></DIV
7122
><DIV
7123
CLASS="section"
7124
><HR><H2
7125
CLASS="section"
7126
><A
7127
NAME="AEN1156"
7128
>6.6. Ignoring Dependencies:  the <CODE
7129
CLASS="function"
7130
>Ignore</CODE
7131
> Function</A
7132
></H2
7133
><P
7134
>&#13;
7135
    Sometimes it makes sense
7136
    to not rebuild a program,
7137
    even if a dependency file changes.
7138
    In this case,
7139
    you would tell <SPAN
7140
CLASS="application"
7141
>SCons</SPAN
7142
> specifically
7143
    to ignore a dependency as follows:
7144
7145
    </P
7146
><PRE
7147
CLASS="programlisting"
7148
>&#13;      hello = Program('hello.c')
7149
      Ignore(hello, 'hello.h')
7150
    </PRE
7151
><PRE
7152
CLASS="screen"
7153
>&#13;      % <KBD
7154
CLASS="userinput"
7155
>scons -Q hello</KBD
7156
>
7157
      cc -c -o hello.o hello.c
7158
      cc -o hello hello.o
7159
      % <KBD
7160
CLASS="userinput"
7161
>scons -Q hello</KBD
7162
>
7163
      scons: `hello' is up to date.
7164
      % <KBD
7165
CLASS="userinput"
7166
>edit hello.h</KBD
7167
>
7168
        [CHANGE THE CONTENTS OF hello.h]
7169
      % <KBD
7170
CLASS="userinput"
7171
>scons -Q hello</KBD
7172
>
7173
      scons: `hello' is up to date.
7174
    </PRE
7175
><P
7176
>&#13;
7177
    Now, the above example is a little contrived,
7178
    because it's hard to imagine a real-world situation
7179
    where you wouldn't want to rebuild <SPAN
7180
CLASS="application"
7181
>hello</SPAN
7182
>
7183
    if the <TT
7184
CLASS="filename"
7185
>hello.h</TT
7186
> file changed.
7187
    A more realistic example
7188
    might be if the <SPAN
7189
CLASS="application"
7190
>hello</SPAN
7191
>
7192
    program is being built in a
7193
    directory that is shared between multiple systems
7194
    that have different copies of the
7195
    <TT
7196
CLASS="filename"
7197
>stdio.h</TT
7198
> include file.
7199
    In that case,
7200
    <SPAN
7201
CLASS="application"
7202
>SCons</SPAN
7203
> would notice the differences between
7204
    the different systems' copies of <TT
7205
CLASS="filename"
7206
>stdio.h</TT
7207
>
7208
    and would rebuild <SPAN
7209
CLASS="application"
7210
>hello</SPAN
7211
>
7212
    each time you change systems.
7213
    You could avoid these rebuilds as follows:
7214
7215
    </P
7216
><PRE
7217
CLASS="programlisting"
7218
>&#13;       hello = Program('hello.c')
7219
       Ignore(hello, '/usr/include/stdio.h')
7220
    </PRE
7221
></DIV
7222
><DIV
7223
CLASS="section"
7224
><HR><H2
7225
CLASS="section"
7226
><A
7227
NAME="AEN1176"
7228
>6.7. The <CODE
7229
CLASS="function"
7230
>AlwaysBuild</CODE
7231
> Function</A
7232
></H2
7233
><P
7234
>&#13;
7235
    How <SPAN
7236
CLASS="application"
7237
>SCons</SPAN
7238
> handles dependencies can also be affected
7239
    by the <CODE
7240
CLASS="function"
7241
>AlwaysBuild</CODE
7242
> method.
7243
    When a file is passed to the <CODE
7244
CLASS="function"
7245
>AlwaysBuild</CODE
7246
> method,
7247
    like so:
7248
7249
    </P
7250
><PRE
7251
CLASS="programlisting"
7252
>&#13;      hello = Program('hello.c')
7253
      AlwaysBuild(hello)
7254
    </PRE
7255
><P
7256
>&#13;
7257
    Then the specified target file (<SPAN
7258
CLASS="application"
7259
>hello</SPAN
7260
> in our example)
7261
    will always be considered out-of-date and
7262
    rebuilt whenever that target file is evaluated
7263
    while walking the dependency graph:
7264
7265
    </P
7266
><PRE
7267
CLASS="screen"
7268
>&#13;      % <KBD
7269
CLASS="userinput"
7270
>scons -Q</KBD
7271
>
7272
      cc -o hello.o -c hello.c
7273
      cc -o hello hello.o
7274
      % <KBD
7275
CLASS="userinput"
7276
>scons -Q</KBD
7277
>
7278
      cc -o hello hello.o
7279
    </PRE
7280
><P
7281
>&#13;
7282
    The <CODE
7283
CLASS="function"
7284
>AlwaysBuild</CODE
7285
> function has a somewhat misleading name,
7286
    because it does not actually mean the target file will
7287
    be rebuilt every single time <SPAN
7288
CLASS="application"
7289
>SCons</SPAN
7290
> is invoked.
7291
    Instead, it means that the target will, in fact,
7292
    be rebuilt whenever the target file is encountered
7293
    while evaluating the targets specified on
7294
    the command line (and their dependencies).
7295
    So specifying some other target on the command line,
7296
    a target that does <SPAN
7297
CLASS="emphasis"
7298
><I
7299
CLASS="emphasis"
7300
>not</I
7301
></SPAN
7302
>
7303
    itself depend on the <CODE
7304
CLASS="function"
7305
>AlwaysBuild</CODE
7306
> target,
7307
    will still be rebuilt only if it's out-of-date
7308
    with respect to its dependencies:
7309
7310
    </P
7311
><PRE
7312
CLASS="screen"
7313
>&#13;      % <KBD
7314
CLASS="userinput"
7315
>scons -Q</KBD
7316
>
7317
      cc -o hello.o -c hello.c
7318
      cc -o hello hello.o
7319
      % <KBD
7320
CLASS="userinput"
7321
>scons -Q hello.o</KBD
7322
>
7323
      scons: `hello.o' is up to date.
7324
    </PRE
7325
></DIV
7326
></DIV
7327
><DIV
7328
CLASS="chapter"
7329
><HR><H1
7330
><A
7331
NAME="chap-environments"
7332
></A
7333
>Chapter 7. Construction Environments</H1
7334
><P
7335
>&#13;
7336
   It is rare that all of the software in a large,
7337
   complicated system needs to be built the same way.
7338
   For example, different source files may need different options
7339
   enabled on the command line,
7340
   or different executable programs need to be linked
7341
   with different libraries.
7342
   <SPAN
7343
CLASS="application"
7344
>SCons</SPAN
7345
> accommodates these different build
7346
   requirements by allowing you to create and
7347
   configure multiple <TT
7348
CLASS="literal"
7349
>construction environments</TT
7350
>
7351
   that control how the software is built.
7352
   Technically, a <TT
7353
CLASS="literal"
7354
>construction environment</TT
7355
> is an object
7356
   that has a number of associated
7357
   <TT
7358
CLASS="literal"
7359
>construction variables</TT
7360
>, each with a name and a value.
7361
   (A construction environment also has an attached
7362
   set of <CODE
7363
CLASS="classname"
7364
>Builder</CODE
7365
> methods,
7366
   about which we'll learn more later.)
7367
7368
 </P
7369
><P
7370
>&#13;
7371
   A <TT
7372
CLASS="literal"
7373
>construction environment</TT
7374
> is created by the <CODE
7375
CLASS="function"
7376
>Environment</CODE
7377
> method:
7378
7379
 </P
7380
><PRE
7381
CLASS="programlisting"
7382
>&#13;    env = Environment()
7383
  </PRE
7384
><P
7385
>&#13;
7386
   By default, <SPAN
7387
CLASS="application"
7388
>SCons</SPAN
7389
> initializes every
7390
   new construction environment
7391
   with a set of <TT
7392
CLASS="literal"
7393
>construction variables</TT
7394
>
7395
   based on the tools that it finds on your system,
7396
   plus the default set of builder methods
7397
   necessary for using those tools.
7398
   The construction variables
7399
   are initialized with values describing
7400
   the C compiler,
7401
   the Fortran compiler,
7402
   the linker,
7403
   etc.,
7404
   as well as the command lines to invoke them.
7405
7406
 </P
7407
><P
7408
>&#13;
7409
   When you initialize a construction environment
7410
   you can set the values of the
7411
   environment's <TT
7412
CLASS="literal"
7413
>construction variables</TT
7414
>
7415
   to control how a program is built.
7416
   For example:
7417
7418
 </P
7419
><PRE
7420
CLASS="programlisting"
7421
>&#13;    env = Environment(CC = 'gcc',
7422
                      CCFLAGS = '-O2')
7423
7424
    env.Program('foo.c')
7425
  </PRE
7426
><P
7427
>&#13;
7428
   The construction environment in this example
7429
   is still initialized with the same default
7430
   construction variable values,
7431
   except that the user has explicitly specified use of the
7432
   GNU C compiler <SPAN
7433
CLASS="application"
7434
>gcc</SPAN
7435
>,
7436
   and further specifies that the <TT
7437
CLASS="literal"
7438
>-O2</TT
7439
>
7440
   (optimization level two)
7441
   flag should be used when compiling the object file.
7442
   In other words, the explicit initializations of
7443
   <A
7444
HREF="#cv-CC"
7445
><CODE
7446
CLASS="envar"
7447
>$CC</CODE
7448
></A
7449
> and <A
7450
HREF="#cv-CCFLAGS"
7451
><CODE
7452
CLASS="envar"
7453
>$CCFLAGS</CODE
7454
></A
7455
>
7456
   override the default values in the newly-created
7457
   construction environment.
7458
   So a run from this example would look like:
7459
7460
 </P
7461
><PRE
7462
CLASS="screen"
7463
>&#13;    % <KBD
7464
CLASS="userinput"
7465
>scons -Q</KBD
7466
>
7467
    gcc -o foo.o -c -O2 foo.c
7468
    gcc -o foo foo.o
7469
 </PRE
7470
><DIV
7471
CLASS="section"
7472
><HR><H2
7473
CLASS="section"
7474
><A
7475
NAME="AEN1224"
7476
>7.1. Multiple <TT
7477
CLASS="literal"
7478
>Construction Environments</TT
7479
></A
7480
></H2
7481
><P
7482
>&#13;
7483
   The real advantage of construction environments
7484
   is that you can create as many different construction
7485
   environments as you need,
7486
   each tailored to a different way to build
7487
   some piece of software or other file.
7488
   If, for example, we need to build
7489
   one program with the <TT
7490
CLASS="literal"
7491
>-O2</TT
7492
> flag
7493
   and another with the <TT
7494
CLASS="literal"
7495
>-g</TT
7496
> (debug) flag,
7497
   we would do this like so:
7498
7499
   </P
7500
><PRE
7501
CLASS="programlisting"
7502
>&#13;      opt = Environment(CCFLAGS = '-O2')
7503
      dbg = Environment(CCFLAGS = '-g')
7504
7505
      opt.Program('foo', 'foo.c')
7506
7507
      dbg.Program('bar', 'bar.c')
7508
   </PRE
7509
><PRE
7510
CLASS="screen"
7511
>&#13;      % <KBD
7512
CLASS="userinput"
7513
>scons -Q</KBD
7514
>
7515
      cc -o bar.o -c -g bar.c
7516
      cc -o bar bar.o
7517
      cc -o foo.o -c -O2 foo.c
7518
      cc -o foo foo.o
7519
   </PRE
7520
><P
7521
>&#13;
7522
   We can even use multiple construction environments to build
7523
   multiple versions of a single program.
7524
   If you do this by simply trying to use the
7525
   <A
7526
HREF="#b-Program"
7527
><CODE
7528
CLASS="function"
7529
>Program</CODE
7530
></A
7531
> builder with both environments, though,
7532
   like this:
7533
7534
   </P
7535
><PRE
7536
CLASS="programlisting"
7537
>&#13;      opt = Environment(CCFLAGS = '-O2')
7538
      dbg = Environment(CCFLAGS = '-g')
7539
7540
      opt.Program('foo', 'foo.c')
7541
7542
      dbg.Program('foo', 'foo.c')
7543
   </PRE
7544
><P
7545
>&#13;
7546
   Then <SPAN
7547
CLASS="application"
7548
>SCons</SPAN
7549
> generates the following error:
7550
7551
   </P
7552
><PRE
7553
CLASS="screen"
7554
>&#13;      % <KBD
7555
CLASS="userinput"
7556
>scons -Q</KBD
7557
>
7558
      
7559
      scons: *** Two environments with different actions were specified for the same target: foo.o
7560
      File "/home/my/project/SConstruct", line 6, in &#60;module&#62;
7561
   </PRE
7562
><P
7563
>&#13;
7564
   This is because the two <CODE
7565
CLASS="function"
7566
>Program</CODE
7567
> calls have
7568
   each implicitly told <SPAN
7569
CLASS="application"
7570
>SCons</SPAN
7571
> to generate an object file named
7572
   <TT
7573
CLASS="filename"
7574
>foo.o</TT
7575
>,
7576
   one with a <A
7577
HREF="#cv-CCFLAGS"
7578
><CODE
7579
CLASS="envar"
7580
>$CCFLAGS</CODE
7581
></A
7582
> value of
7583
   <TT
7584
CLASS="literal"
7585
>-O2</TT
7586
>
7587
   and one with a <A
7588
HREF="#cv-CCFLAGS"
7589
><CODE
7590
CLASS="envar"
7591
>$CCFLAGS</CODE
7592
></A
7593
> value of
7594
   <TT
7595
CLASS="literal"
7596
>-g</TT
7597
>.
7598
   <SPAN
7599
CLASS="application"
7600
>SCons</SPAN
7601
> can't just decide that one of them
7602
   should take precedence over the other,
7603
   so it generates the error.
7604
   To avoid this problem,
7605
   we must explicitly specify
7606
   that each environment compile
7607
   <TT
7608
CLASS="filename"
7609
>foo.c</TT
7610
>
7611
   to a separately-named object file
7612
   using the <A
7613
HREF="#b-Object"
7614
><CODE
7615
CLASS="function"
7616
>Object</CODE
7617
></A
7618
> builder, like so:
7619
7620
   </P
7621
><PRE
7622
CLASS="programlisting"
7623
>&#13;      opt = Environment(CCFLAGS = '-O2')
7624
      dbg = Environment(CCFLAGS = '-g')
7625
7626
      o = opt.Object('foo-opt', 'foo.c')
7627
      opt.Program(o)
7628
7629
      d = dbg.Object('foo-dbg', 'foo.c')
7630
      dbg.Program(d)
7631
   </PRE
7632
><P
7633
>&#13;
7634
   Notice that each call to the <CODE
7635
CLASS="function"
7636
>Object</CODE
7637
> builder
7638
   returns a value,
7639
   an internal <SPAN
7640
CLASS="application"
7641
>SCons</SPAN
7642
> object that
7643
   represents the object file that will be built.
7644
   We then use that object
7645
   as input to the <CODE
7646
CLASS="function"
7647
>Program</CODE
7648
> builder.
7649
   This avoids having to specify explicitly
7650
   the object file name in multiple places,
7651
   and makes for a compact, readable
7652
   <TT
7653
CLASS="filename"
7654
>SConstruct</TT
7655
> file.
7656
   Our <SPAN
7657
CLASS="application"
7658
>SCons</SPAN
7659
> output then looks like:
7660
7661
   </P
7662
><PRE
7663
CLASS="screen"
7664
>&#13;      % <KBD
7665
CLASS="userinput"
7666
>scons -Q</KBD
7667
>
7668
      cc -o foo-dbg.o -c -g foo.c
7669
      cc -o foo-dbg foo-dbg.o
7670
      cc -o foo-opt.o -c -O2 foo.c
7671
      cc -o foo-opt foo-opt.o
7672
   </PRE
7673
></DIV
7674
><DIV
7675
CLASS="section"
7676
><HR><H2
7677
CLASS="section"
7678
><A
7679
NAME="AEN1264"
7680
>7.2. Copying <TT
7681
CLASS="literal"
7682
>Construction Environments</TT
7683
></A
7684
></H2
7685
><P
7686
>&#13;
7687
   Sometimes you want more than one construction environment
7688
   to share the same values for one or more variables.
7689
   Rather than always having to repeat all of the common
7690
   variables when you create each construction environment,
7691
   you can use the <CODE
7692
CLASS="function"
7693
>Clone</CODE
7694
> method
7695
   to create a copy of a construction environment.
7696
7697
   </P
7698
><P
7699
>&#13;
7700
   Like the <CODE
7701
CLASS="function"
7702
>Environment</CODE
7703
> call that creates a construction environment,
7704
   the <CODE
7705
CLASS="function"
7706
>Clone</CODE
7707
> method takes <TT
7708
CLASS="literal"
7709
>construction variable</TT
7710
> assignments,
7711
   which will override the values in the copied construction environment.
7712
   For example, suppose we want to use <SPAN
7713
CLASS="application"
7714
>gcc</SPAN
7715
>
7716
   to create three versions of a program,
7717
   one optimized, one debug, and one with neither.
7718
   We could do this by creating a "base" construction environment
7719
   that sets <A
7720
HREF="#cv-CC"
7721
><CODE
7722
CLASS="envar"
7723
>$CC</CODE
7724
></A
7725
> to <SPAN
7726
CLASS="application"
7727
>gcc</SPAN
7728
>,
7729
   and then creating two copies,
7730
   one which sets <A
7731
HREF="#cv-CCFLAGS"
7732
><CODE
7733
CLASS="envar"
7734
>$CCFLAGS</CODE
7735
></A
7736
> for optimization
7737
   and the other which sets <CODE
7738
CLASS="envar"
7739
>$CCFLAGS</CODE
7740
> for debugging:
7741
7742
   </P
7743
><PRE
7744
CLASS="programlisting"
7745
>&#13;      env = Environment(CC = 'gcc')
7746
      opt = env.Clone(CCFLAGS = '-O2')
7747
      dbg = env.Clone(CCFLAGS = '-g')
7748
7749
      env.Program('foo', 'foo.c')
7750
7751
      o = opt.Object('foo-opt', 'foo.c')
7752
      opt.Program(o)
7753
7754
      d = dbg.Object('foo-dbg', 'foo.c')
7755
      dbg.Program(d)
7756
   </PRE
7757
><P
7758
>&#13;
7759
   Then our output would look like:
7760
7761
   </P
7762
><PRE
7763
CLASS="screen"
7764
>&#13;      % <KBD
7765
CLASS="userinput"
7766
>scons -Q</KBD
7767
>
7768
      gcc -o foo.o -c foo.c
7769
      gcc -o foo foo.o
7770
      gcc -o foo-dbg.o -c -g foo.c
7771
      gcc -o foo-dbg foo-dbg.o
7772
      gcc -o foo-opt.o -c -O2 foo.c
7773
      gcc -o foo-opt foo-opt.o
7774
   </PRE
7775
></DIV
7776
><DIV
7777
CLASS="section"
7778
><HR><H2
7779
CLASS="section"
7780
><A
7781
NAME="AEN1284"
7782
>7.3. Fetching Values From a <TT
7783
CLASS="literal"
7784
>Construction Environment</TT
7785
></A
7786
></H2
7787
><P
7788
>&#13;
7789
   You can fetch individual construction variables
7790
   using the normal syntax
7791
   for accessing individual named items in a Python dictionary:
7792
7793
   </P
7794
><PRE
7795
CLASS="programlisting"
7796
>&#13;      env = Environment()
7797
      print "CC is:", env['CC']
7798
   </PRE
7799
><P
7800
>&#13;
7801
   This example <TT
7802
CLASS="filename"
7803
>SConstruct</TT
7804
> file doesn't build anything,
7805
   but because it's actually a Python script,
7806
   it will print the value of <A
7807
HREF="#cv-CC"
7808
><CODE
7809
CLASS="envar"
7810
>$CC</CODE
7811
></A
7812
> for us:
7813
7814
   </P
7815
><PRE
7816
CLASS="screen"
7817
>&#13;      % <KBD
7818
CLASS="userinput"
7819
>scons -Q</KBD
7820
>
7821
      CC is: cc
7822
      scons: `.' is up to date.
7823
   </PRE
7824
><P
7825
>&#13;
7826
   A construction environment, however,
7827
   is actually an object with associated methods, etc.
7828
   If you want to have direct access to only the
7829
   dictionary of construction variables,
7830
   you can fetch this using the <TT
7831
CLASS="literal"
7832
>Dictionary</TT
7833
> method:
7834
7835
   </P
7836
><PRE
7837
CLASS="programlisting"
7838
>&#13;      env = Environment(FOO = 'foo', BAR = 'bar')
7839
      dict = env.Dictionary()
7840
      for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']:
7841
          print "key = %s, value = %s" % (key, dict[key])
7842
   </PRE
7843
><P
7844
>&#13;
7845
   This <TT
7846
CLASS="filename"
7847
>SConstruct</TT
7848
> file
7849
   will print the specified dictionary items for us on POSIX
7850
   systems as follows:
7851
7852
   </P
7853
><PRE
7854
CLASS="screen"
7855
>&#13;      % <KBD
7856
CLASS="userinput"
7857
>scons -Q</KBD
7858
>
7859
      key = OBJSUFFIX, value = .o
7860
      key = LIBSUFFIX, value = .a
7861
      key = PROGSUFFIX, value = 
7862
      scons: `.' is up to date.
7863
   </PRE
7864
><P
7865
>&#13;
7866
   And on Windows:
7867
7868
   </P
7869
><PRE
7870
CLASS="screen"
7871
>&#13;      C:\&#62;<KBD
7872
CLASS="userinput"
7873
>scons -Q</KBD
7874
>
7875
      key = OBJSUFFIX, value = .obj
7876
      key = LIBSUFFIX, value = .lib
7877
      key = PROGSUFFIX, value = .exe
7878
      scons: `.' is up to date.
7879
   </PRE
7880
><P
7881
>&#13;
7882
   If you want to loop through and print the values of
7883
   all of the construction variables in a construction environment,
7884
   the Python code to do that in sorted order might look something like:
7885
7886
   </P
7887
><PRE
7888
CLASS="programlisting"
7889
>&#13;      env = Environment()
7890
      dict = env.Dictionary()
7891
      keys = dict.keys()
7892
      keys.sort()
7893
      for key in keys:
7894
          print "construction variable = '%s', value = '%s'" % (key, dict[key])
7895
   </PRE
7896
></DIV
7897
><DIV
7898
CLASS="section"
7899
><HR><H2
7900
CLASS="section"
7901
><A
7902
NAME="AEN1307"
7903
>7.4. Expanding Values From a <TT
7904
CLASS="literal"
7905
>Construction Environment</TT
7906
></A
7907
></H2
7908
><P
7909
>&#13;
7910
   Another way to get information from
7911
   a construction environment.
7912
   is to use the <CODE
7913
CLASS="function"
7914
>subst</CODE
7915
> method
7916
   on a string containing $-expansions
7917
   of construction variable names.
7918
   As a simple example,
7919
   the example from the previous
7920
   section that used
7921
   <TT
7922
CLASS="literal"
7923
>env['CC']</TT
7924
>
7925
   to fetch the value of <A
7926
HREF="#cv-CC"
7927
><CODE
7928
CLASS="envar"
7929
>$CC</CODE
7930
></A
7931
>
7932
   could also be written as:
7933
7934
   </P
7935
><PRE
7936
CLASS="programlisting"
7937
>&#13;     env = Environment()
7938
     print "CC is:", env.subst('$CC')
7939
   </PRE
7940
><P
7941
>&#13;
7942
   The real advantage of using
7943
   <CODE
7944
CLASS="function"
7945
>subst</CODE
7946
> to expand strings is
7947
   that construction variables
7948
   in the result get
7949
   re-expanded until
7950
   there are no expansions left in the string.
7951
   So a simple fetch of a value like
7952
   <A
7953
HREF="#cv-CCCOM"
7954
><CODE
7955
CLASS="envar"
7956
>$CCCOM</CODE
7957
></A
7958
>:
7959
7960
   </P
7961
><PRE
7962
CLASS="programlisting"
7963
>&#13;     env = Environment(CCFLAGS = '-DFOO')
7964
     print "CCCOM is:", env['CCCOM']
7965
   </PRE
7966
><P
7967
>&#13;
7968
   Will print the unexpanded value of <CODE
7969
CLASS="envar"
7970
>$CCCOM</CODE
7971
>,
7972
   showing us the construction
7973
   variables that still need to be expanded:
7974
7975
   </P
7976
><PRE
7977
CLASS="screen"
7978
>&#13;     % <KBD
7979
CLASS="userinput"
7980
>scons -Q</KBD
7981
>
7982
     CCCOM is: $CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES
7983
     scons: `.' is up to date.
7984
   </PRE
7985
><P
7986
>&#13;
7987
   Calling the <CODE
7988
CLASS="function"
7989
>subst</CODE
7990
> method on <CODE
7991
CLASS="varname"
7992
>$CCOM</CODE
7993
>,
7994
   however:
7995
7996
   </P
7997
><PRE
7998
CLASS="programlisting"
7999
>&#13;     env = Environment(CCFLAGS = '-DFOO')
8000
     print "CCCOM is:", env.subst('$CCCOM')
8001
   </PRE
8002
><P
8003
>&#13;
8004
   Will recursively expand all of
8005
   the $-prefixed construction variables,
8006
   showing us the final output:
8007
8008
   </P
8009
><PRE
8010
CLASS="screen"
8011
>&#13;     % <KBD
8012
CLASS="userinput"
8013
>scons -Q</KBD
8014
>
8015
     CCCOM is: gcc -DFOO -c -o
8016
     scons: `.' is up to date.
8017
   </PRE
8018
><P
8019
>&#13;
8020
   (Note that because we're not expanding this
8021
   in the context of building something
8022
   there are no target or source files
8023
   for <A
8024
HREF="#cv-TARGET"
8025
><CODE
8026
CLASS="envar"
8027
>$TARGET</CODE
8028
></A
8029
> and <A
8030
HREF="#cv-SOURCES"
8031
><CODE
8032
CLASS="envar"
8033
>$SOURCES</CODE
8034
></A
8035
> to expand.)
8036
8037
   </P
8038
></DIV
8039
><DIV
8040
CLASS="section"
8041
><HR><H2
8042
CLASS="section"
8043
><A
8044
NAME="AEN1337"
8045
>7.5. Modifying a <TT
8046
CLASS="literal"
8047
>Construction Environment</TT
8048
></A
8049
></H2
8050
><P
8051
>&#13;
8052
   <SPAN
8053
CLASS="application"
8054
>SCons</SPAN
8055
> provides various methods that
8056
   support modifying existing values in a construction environment.
8057
8058
   </P
8059
><DIV
8060
CLASS="section"
8061
><HR><H3
8062
CLASS="section"
8063
><A
8064
NAME="AEN1342"
8065
>7.5.1. Replacing Values in a <TT
8066
CLASS="literal"
8067
>Construction Environment</TT
8068
></A
8069
></H3
8070
><P
8071
>&#13;
8072
     You can replace existing construction variable values
8073
     using the <CODE
8074
CLASS="function"
8075
>Replace</CODE
8076
> method:
8077
8078
     </P
8079
><PRE
8080
CLASS="programlisting"
8081
>&#13;        env = Environment(CCFLAGS = '-DDEFINE1')
8082
        env.Replace(CCFLAGS = '-DDEFINE2')
8083
        env.Program('foo.c')
8084
     </PRE
8085
><P
8086
>&#13;
8087
     The replacing value
8088
     (<TT
8089
CLASS="literal"
8090
>-DDEFINE2</TT
8091
> in the above example)
8092
     completely replaces the value in the
8093
     construction environment:
8094
8095
     </P
8096
><PRE
8097
CLASS="screen"
8098
>&#13;        % <KBD
8099
CLASS="userinput"
8100
>scons -Q</KBD
8101
>
8102
        cc -o foo.o -c -DDEFINE2 foo.c
8103
        cc -o foo foo.o
8104
     </PRE
8105
><P
8106
>&#13;
8107
     You can safely call <CODE
8108
CLASS="function"
8109
>Replace</CODE
8110
>
8111
     for construction variables that
8112
     don't exist in the construction environment:
8113
8114
     </P
8115
><PRE
8116
CLASS="programlisting"
8117
>&#13;        env = Environment()
8118
        env.Replace(NEW_VARIABLE = 'xyzzy')
8119
        print "NEW_VARIABLE =", env['NEW_VARIABLE']
8120
     </PRE
8121
><P
8122
>&#13;
8123
     In this case,
8124
     the construction variable simply
8125
     gets added to the construction environment:
8126
8127
     </P
8128
><PRE
8129
CLASS="screen"
8130
>&#13;        % <KBD
8131
CLASS="userinput"
8132
>scons -Q</KBD
8133
>
8134
        NEW_VARIABLE = xyzzy
8135
        scons: `.' is up to date.
8136
     </PRE
8137
><P
8138
>&#13;
8139
     Because the variables
8140
     aren't expanded until the construction environment
8141
     is actually used to build the targets,
8142
     and because <SPAN
8143
CLASS="application"
8144
>SCons</SPAN
8145
> function and method calls
8146
     are order-independent,
8147
     the last replacement "wins"
8148
     and is used to build all targets,
8149
     regardless of the order in which
8150
     the calls to Replace() are
8151
     interspersed with calls to
8152
     builder methods:
8153
8154
     </P
8155
><PRE
8156
CLASS="programlisting"
8157
>&#13;        env = Environment(CCFLAGS = '-DDEFINE1')
8158
        print "CCFLAGS =", env['CCFLAGS']
8159
        env.Program('foo.c')
8160
8161
        env.Replace(CCFLAGS = '-DDEFINE2')
8162
        print "CCFLAGS =", env['CCFLAGS']
8163
        env.Program('bar.c')
8164
     </PRE
8165
><P
8166
>&#13;
8167
     The timing of when the replacement
8168
     actually occurs relative
8169
     to when the targets get built
8170
     becomes apparent
8171
     if we run <SPAN
8172
CLASS="application"
8173
>scons</SPAN
8174
> without the <TT
8175
CLASS="literal"
8176
>-Q</TT
8177
>
8178
     option:
8179
8180
     </P
8181
><PRE
8182
CLASS="screen"
8183
>&#13;        % <KBD
8184
CLASS="userinput"
8185
>scons</KBD
8186
>
8187
        scons: Reading SConscript files ...
8188
        CCFLAGS = -DDEFINE1
8189
        CCFLAGS = -DDEFINE2
8190
        scons: done reading SConscript files.
8191
        scons: Building targets ...
8192
        cc -o bar.o -c -DDEFINE2 bar.c
8193
        cc -o bar bar.o
8194
        cc -o foo.o -c -DDEFINE2 foo.c
8195
        cc -o foo foo.o
8196
        scons: done building targets.
8197
     </PRE
8198
><P
8199
>&#13;
8200
     Because the replacement occurs while
8201
     the <TT
8202
CLASS="filename"
8203
>SConscript</TT
8204
> files are being read,
8205
     the <A
8206
HREF="#cv-CCFLAGS"
8207
><CODE
8208
CLASS="envar"
8209
>$CCFLAGS</CODE
8210
></A
8211
>
8212
     variable has already been set to
8213
     <TT
8214
CLASS="literal"
8215
>-DDEFINE2</TT
8216
>
8217
     by the time the <TT
8218
CLASS="filename"
8219
>foo.o</TT
8220
> target is built,
8221
     even though the call to the <CODE
8222
CLASS="function"
8223
>Replace</CODE
8224
>
8225
     method does not occur until later in
8226
     the <TT
8227
CLASS="filename"
8228
>SConscript</TT
8229
> file.
8230
8231
     </P
8232
></DIV
8233
><DIV
8234
CLASS="section"
8235
><HR><H3
8236
CLASS="section"
8237
><A
8238
NAME="AEN1374"
8239
>7.5.2. Appending to the End of Values in a <TT
8240
CLASS="literal"
8241
>Construction Environment</TT
8242
></A
8243
></H3
8244
><P
8245
>&#13;
8246
     You can append a value to
8247
     an existing construction variable
8248
     using the <CODE
8249
CLASS="function"
8250
>Append</CODE
8251
> method:
8252
8253
     </P
8254
><PRE
8255
CLASS="programlisting"
8256
>&#13;        env = Environment(CCFLAGS = '-DMY_VALUE')
8257
        env.Append(CCFLAGS = ' -DLAST')
8258
        env.Program('foo.c')
8259
     </PRE
8260
><P
8261
>&#13;
8262
     <SPAN
8263
CLASS="application"
8264
>SCons</SPAN
8265
> then supplies both the <TT
8266
CLASS="literal"
8267
>-DMY_VALUE</TT
8268
> and
8269
     <TT
8270
CLASS="literal"
8271
>-DLAST</TT
8272
> flags when compiling the object file:
8273
8274
     </P
8275
><PRE
8276
CLASS="screen"
8277
>&#13;        % <KBD
8278
CLASS="userinput"
8279
>scons -Q</KBD
8280
>
8281
        cc -o foo.o -c -DMY_VALUE -DLAST foo.c
8282
        cc -o foo foo.o
8283
     </PRE
8284
><P
8285
>&#13;
8286
     If the construction variable doesn't already exist,
8287
     the <CODE
8288
CLASS="function"
8289
>Append</CODE
8290
> method will create it:
8291
8292
     </P
8293
><PRE
8294
CLASS="programlisting"
8295
>&#13;        env = Environment()
8296
        env.Append(NEW_VARIABLE = 'added')
8297
        print "NEW_VARIABLE =", env['NEW_VARIABLE']
8298
     </PRE
8299
><P
8300
>&#13;
8301
     Which yields:
8302
8303
     </P
8304
><PRE
8305
CLASS="screen"
8306
>&#13;        % <KBD
8307
CLASS="userinput"
8308
>scons -Q</KBD
8309
>
8310
        NEW_VARIABLE = added
8311
        scons: `.' is up to date.
8312
     </PRE
8313
></DIV
8314
><DIV
8315
CLASS="section"
8316
><HR><H3
8317
CLASS="section"
8318
><A
8319
NAME="AEN1392"
8320
>7.5.3. Appending to the Beginning of Values in a <TT
8321
CLASS="literal"
8322
>Construction Environment</TT
8323
></A
8324
></H3
8325
><P
8326
>&#13;
8327
     You can append a value to the beginning of
8328
     an existing construction variable
8329
     using the <CODE
8330
CLASS="function"
8331
>Prepend</CODE
8332
> method:
8333
8334
     </P
8335
><PRE
8336
CLASS="programlisting"
8337
>&#13;        env = Environment(CCFLAGS = '-DMY_VALUE')
8338
        env.Prepend(CCFLAGS = '-DFIRST ')
8339
        env.Program('foo.c')
8340
     </PRE
8341
><P
8342
>&#13;
8343
     <SPAN
8344
CLASS="application"
8345
>SCons</SPAN
8346
> then supplies both the <TT
8347
CLASS="literal"
8348
>-DFIRST</TT
8349
> and
8350
     <TT
8351
CLASS="literal"
8352
>-DMY_VALUE</TT
8353
> flags when compiling the object file:
8354
8355
     </P
8356
><PRE
8357
CLASS="screen"
8358
>&#13;        % <KBD
8359
CLASS="userinput"
8360
>scons -Q</KBD
8361
>
8362
        cc -o foo.o -c -DFIRST -DMY_VALUE foo.c
8363
        cc -o foo foo.o
8364
     </PRE
8365
><P
8366
>&#13;
8367
     If the construction variable doesn't already exist,
8368
     the <CODE
8369
CLASS="function"
8370
>Prepend</CODE
8371
> method will create it:
8372
8373
     </P
8374
><PRE
8375
CLASS="programlisting"
8376
>&#13;        env = Environment()
8377
        env.Prepend(NEW_VARIABLE = 'added')
8378
        print "NEW_VARIABLE =", env['NEW_VARIABLE']
8379
     </PRE
8380
><P
8381
>&#13;
8382
     Which yields:
8383
8384
     </P
8385
><PRE
8386
CLASS="screen"
8387
>&#13;        % <KBD
8388
CLASS="userinput"
8389
>scons -Q</KBD
8390
>
8391
        NEW_VARIABLE = added
8392
        scons: `.' is up to date.
8393
     </PRE
8394
></DIV
8395
></DIV
8396
></DIV
8397
><DIV
8398
CLASS="chapter"
8399
><HR><H1
8400
><A
8401
NAME="chap-ENV"
8402
></A
8403
>Chapter 8. Controlling the External Environment Used to Execute Build Commands</H1
8404
><P
8405
>&#13;
8406
    When <SPAN
8407
CLASS="application"
8408
>SCons</SPAN
8409
> builds a target file,
8410
    it does not execute the commands with
8411
    the same external environment
8412
    that you used to execute <SPAN
8413
CLASS="application"
8414
>SCons</SPAN
8415
>.
8416
    Instead, it uses the dictionary
8417
    stored in the <A
8418
HREF="#cv-ENV"
8419
><CODE
8420
CLASS="envar"
8421
>$ENV</CODE
8422
></A
8423
> construction variable
8424
    as the external environment
8425
    for executing commands.
8426
8427
  </P
8428
><P
8429
>&#13;
8430
    The most important ramification of this behavior
8431
    is that the <CODE
8432
CLASS="varname"
8433
>PATH</CODE
8434
> environment variable,
8435
    which controls where the operating system
8436
    will look for commands and utilities,
8437
    is not the same as in the external environment
8438
    from which you called <SPAN
8439
CLASS="application"
8440
>SCons</SPAN
8441
>.
8442
    This means that <SPAN
8443
CLASS="application"
8444
>SCons</SPAN
8445
> will not, by default,
8446
    necessarily find all of the tools
8447
    that you can execute from the command line.
8448
8449
  </P
8450
><P
8451
>&#13;
8452
    The default value of the <CODE
8453
CLASS="varname"
8454
>PATH</CODE
8455
> environment variable
8456
    on a POSIX system
8457
    is <TT
8458
CLASS="literal"
8459
>/usr/local/bin:/bin:/usr/bin</TT
8460
>.
8461
    The default value of the <CODE
8462
CLASS="varname"
8463
>PATH</CODE
8464
> environment variable
8465
    on a Windows system comes from the Windows registry
8466
    value for the command interpreter.
8467
    If you want to execute any commands--compilers, linkers, etc.--that
8468
    are not in these default locations,
8469
    you need to set the <CODE
8470
CLASS="varname"
8471
>PATH</CODE
8472
> value
8473
    in the <CODE
8474
CLASS="envar"
8475
>$ENV</CODE
8476
> dictionary
8477
    in your construction environment.
8478
8479
  </P
8480
><P
8481
>&#13;
8482
    The simplest way to do this is to initialize explicitly
8483
    the value when you create the construction environment;
8484
    this is one way to do that:
8485
8486
  </P
8487
><PRE
8488
CLASS="programlisting"
8489
>&#13;    path = ['/usr/local/bin', '/bin', '/usr/bin']
8490
    env = Environment(ENV = {'PATH' : path})
8491
  </PRE
8492
><P
8493
>&#13;
8494
  Assign a dictionary to the <CODE
8495
CLASS="envar"
8496
>$ENV</CODE
8497
>
8498
  construction variable in this way
8499
  completely resets the external environment
8500
  so that the only variable that will be
8501
  set when external commands are executed
8502
  will be the <CODE
8503
CLASS="varname"
8504
>PATH</CODE
8505
> value.
8506
  If you want to use the rest of
8507
  the values in <CODE
8508
CLASS="envar"
8509
>$ENV</CODE
8510
> and only
8511
  set the value of <CODE
8512
CLASS="varname"
8513
>PATH</CODE
8514
>,
8515
  the most straightforward way is probably:
8516
8517
  </P
8518
><PRE
8519
CLASS="programlisting"
8520
>&#13;    env['ENV']['PATH'] = ['/usr/local/bin', '/bin', '/usr/bin']
8521
  </PRE
8522
><P
8523
>&#13;
8524
  Note that <SPAN
8525
CLASS="application"
8526
>SCons</SPAN
8527
> does allow you to define
8528
  the directories in the <CODE
8529
CLASS="varname"
8530
>PATH</CODE
8531
> in a string,
8532
  separated by the pathname-separator character
8533
  for your system (':' on POSIX systems, ';' on Windows):
8534
8535
  </P
8536
><PRE
8537
CLASS="programlisting"
8538
>&#13;    env['ENV']['PATH'] = '/usr/local/bin:/bin:/usr/bin'
8539
  </PRE
8540
><P
8541
>&#13;
8542
  But doing so makes your <TT
8543
CLASS="filename"
8544
>SConscript</TT
8545
> file less portable,
8546
  (although in this case that may not be a huge concern
8547
  since the directories you list are likley system-specific, anyway).
8548
8549
  </P
8550
><DIV
8551
CLASS="section"
8552
><HR><H2
8553
CLASS="section"
8554
><A
8555
NAME="AEN1441"
8556
>8.1. Propagating <CODE
8557
CLASS="varname"
8558
>PATH</CODE
8559
> From the External Environment</A
8560
></H2
8561
><P
8562
>&#13;
8563
    You may want to propagate the external <CODE
8564
CLASS="varname"
8565
>PATH</CODE
8566
>
8567
    to the execution environment for commands.
8568
    You do this by initializing the <CODE
8569
CLASS="varname"
8570
>PATH</CODE
8571
>
8572
    variable with the <CODE
8573
CLASS="varname"
8574
>PATH</CODE
8575
> value from
8576
    the <TT
8577
CLASS="literal"
8578
>os.environ</TT
8579
>
8580
    dictionary,
8581
    which is Python's way of letting you
8582
    get at the external environment:
8583
8584
    </P
8585
><PRE
8586
CLASS="programlisting"
8587
>&#13;      import os
8588
      env = Environment(ENV = {'PATH' : os.environ['PATH']})
8589
    </PRE
8590
><P
8591
>&#13;
8592
    Alternatively, you may find it easier
8593
    to just propagate the entire external
8594
    environment to the execution environment
8595
    for commands.
8596
    This is simpler to code than explicity
8597
    selecting the <CODE
8598
CLASS="varname"
8599
>PATH</CODE
8600
> value:
8601
8602
    </P
8603
><PRE
8604
CLASS="programlisting"
8605
>&#13;      import os
8606
      env = Environment(ENV = os.environ)
8607
    </PRE
8608
><P
8609
>&#13;
8610
    Either of these will guarantee that
8611
    <SPAN
8612
CLASS="application"
8613
>SCons</SPAN
8614
> will be able to execute
8615
    any command that you can execute from the command line.
8616
    The drawback is that the build can behave
8617
    differently if it's run by people with
8618
    different <CODE
8619
CLASS="varname"
8620
>PATH</CODE
8621
> values in their environment--for example,
8622
    if both the <TT
8623
CLASS="literal"
8624
>/bin</TT
8625
> and
8626
    <TT
8627
CLASS="literal"
8628
>/usr/local/bin</TT
8629
> directories
8630
    have different <SPAN
8631
CLASS="application"
8632
>cc</SPAN
8633
> commands,
8634
    then which one will be used to compile programs
8635
    will depend on which directory is listed
8636
    first in the user's <CODE
8637
CLASS="varname"
8638
>PATH</CODE
8639
> variable.
8640
8641
    </P
8642
></DIV
8643
></DIV
8644
><DIV
8645
CLASS="chapter"
8646
><HR><H1
8647
><A
8648
NAME="chap-command-line"
8649
></A
8650
>Chapter 9. Controlling a Build From the Command Line</H1
8651
><P
8652
>&#13;
8653
  <SPAN
8654
CLASS="application"
8655
>SCons</SPAN
8656
> provides a number of ways that
8657
  allow the writer of the <TT
8658
CLASS="filename"
8659
>SConscript</TT
8660
> files
8661
  to give users a great deal of control over how to run the builds.
8662
8663
  </P
8664
><DIV
8665
CLASS="section"
8666
><HR><H2
8667
CLASS="section"
8668
><A
8669
NAME="AEN1465"
8670
>9.1. Not Having to Specify Command-Line Options Each Time:  the <CODE
8671
CLASS="varname"
8672
>SCONSFLAGS</CODE
8673
> Environment Variable</A
8674
></H2
8675
><P
8676
>&#13;
8677
    Users may find themselves supplying
8678
    the same command-line options every time
8679
    they run <SPAN
8680
CLASS="application"
8681
>SCons</SPAN
8682
>.
8683
    For example, a user might find that it saves time
8684
    to specify a value of <TT
8685
CLASS="literal"
8686
>-j 2</TT
8687
>
8688
    to run the builds in parallel.
8689
    To avoid having to type <TT
8690
CLASS="literal"
8691
>-j 2</TT
8692
> by hand
8693
    every time,
8694
    you can set the external environment variable
8695
    <CODE
8696
CLASS="varname"
8697
>SCONSFLAGS</CODE
8698
> to a string containing
8699
    command-line options that you want <SPAN
8700
CLASS="application"
8701
>SCons</SPAN
8702
> to use.
8703
8704
    </P
8705
><P
8706
>&#13;
8707
    If, for example,
8708
    you're using a POSIX shell that's
8709
    compatible with the Bourne shell,
8710
    and you always want <SPAN
8711
CLASS="application"
8712
>SCons</SPAN
8713
> to use the
8714
    <TT
8715
CLASS="literal"
8716
>-Q</TT
8717
> option,
8718
    you can set the <CODE
8719
CLASS="varname"
8720
>SCONSFLAGS</CODE
8721
>
8722
    environment as follows:
8723
8724
    </P
8725
><PRE
8726
CLASS="screen"
8727
>&#13;      % <KBD
8728
CLASS="userinput"
8729
>scons</KBD
8730
>
8731
      scons: Reading SConscript files ...
8732
      scons: done reading SConscript files.
8733
      scons: Building targets ...
8734
          ... [build output] ...
8735
      scons: done building targets.
8736
      % <KBD
8737
CLASS="userinput"
8738
>export SCONSFLAGS="-Q"</KBD
8739
>
8740
      % <KBD
8741
CLASS="userinput"
8742
>scons</KBD
8743
>
8744
          ... [build output] ...
8745
    </PRE
8746
><P
8747
>&#13;
8748
    Users of <SPAN
8749
CLASS="application"
8750
>csh</SPAN
8751
>-style shells on POSIX systems
8752
    can set the <CODE
8753
CLASS="varname"
8754
>SCONSFLAGS</CODE
8755
> environment as follows:
8756
8757
    </P
8758
><PRE
8759
CLASS="screen"
8760
>&#13;      $ <KBD
8761
CLASS="userinput"
8762
>setenv SCONSFLAGS "-Q"</KBD
8763
>
8764
    </PRE
8765
><P
8766
>&#13;
8767
    Windows users may typically want to set the
8768
    <CODE
8769
CLASS="varname"
8770
>SCONSFLAGS</CODE
8771
> in the appropriate tab of the
8772
    <TT
8773
CLASS="literal"
8774
>System Properties</TT
8775
> window.
8776
8777
    </P
8778
></DIV
8779
><DIV
8780
CLASS="section"
8781
><HR><H2
8782
CLASS="section"
8783
><A
8784
NAME="AEN1490"
8785
>9.2. Getting at Command-Line Targets</A
8786
></H2
8787
><P
8788
>&#13;
8789
    <SPAN
8790
CLASS="application"
8791
>SCons</SPAN
8792
> supports a <CODE
8793
CLASS="varname"
8794
>COMMAND_LINE_TARGETS</CODE
8795
> variable
8796
    that lets you get at the list of targets that the
8797
    user specified on the command line.
8798
    You can use the targets to manipulate the
8799
    build in any way you wish.
8800
    As a simple example,
8801
    suppose that you want to print a reminder
8802
    to the user whenever a specific program is built.
8803
    You can do this by checking for the
8804
    target in the <CODE
8805
CLASS="varname"
8806
>COMMAND_LINE_TARGETS</CODE
8807
> list:
8808
8809
    </P
8810
><PRE
8811
CLASS="programlisting"
8812
>&#13;      if 'bar' in COMMAND_LINE_TARGETS:
8813
          print "Don't forget to copy `bar' to the archive!"
8814
      Default(Program('foo.c'))
8815
      Program('bar.c')
8816
    </PRE
8817
><P
8818
>&#13;
8819
    Then, running <SPAN
8820
CLASS="application"
8821
>SCons</SPAN
8822
> with the default target
8823
    works as it always does,
8824
    but explicity specifying the <SPAN
8825
CLASS="application"
8826
>bar</SPAN
8827
> target
8828
    on the command line generates the warning message:
8829
8830
    </P
8831
><PRE
8832
CLASS="screen"
8833
>&#13;      % <KBD
8834
CLASS="userinput"
8835
>scons -Q</KBD
8836
>
8837
      cc -o foo.o -c foo.c
8838
      cc -o foo foo.o
8839
      % <KBD
8840
CLASS="userinput"
8841
>scons -Q bar</KBD
8842
>
8843
      Don't forget to copy `bar' to the archive!
8844
      cc -o bar.o -c bar.c
8845
      cc -o bar bar.o
8846
    </PRE
8847
><P
8848
>&#13;
8849
    Another practical use for the <CODE
8850
CLASS="varname"
8851
>COMMAND_LINE_TARGETS</CODE
8852
> variable
8853
    might be to speed up a build
8854
    by only reading certain subsidiary <TT
8855
CLASS="filename"
8856
>SConscript</TT
8857
>
8858
    files if a specific target is requested.
8859
8860
    </P
8861
></DIV
8862
><DIV
8863
CLASS="section"
8864
><HR><H2
8865
CLASS="section"
8866
><A
8867
NAME="AEN1506"
8868
>9.3. Controlling the Default Targets</A
8869
></H2
8870
><P
8871
>&#13;
8872
    One of the most basic things you can control
8873
    is which targets <SPAN
8874
CLASS="application"
8875
>SCons</SPAN
8876
> will build by default--that is,
8877
    when there are no targets specified on the command line.
8878
    As mentioned previously,
8879
    <SPAN
8880
CLASS="application"
8881
>SCons</SPAN
8882
> will normally build every target
8883
    in or below the current directory
8884
    by default--that is, when you don't
8885
    explicitly specify one or more targets
8886
    on the command line.
8887
    Sometimes, however, you may want
8888
    to specify explicitly that only
8889
    certain programs, or programs in certain directories,
8890
    should be built by default.
8891
    You do this with the <CODE
8892
CLASS="function"
8893
>Default</CODE
8894
> function:
8895
8896
    </P
8897
><PRE
8898
CLASS="programlisting"
8899
>&#13;       env = Environment()
8900
       hello = env.Program('hello.c')
8901
       env.Program('goodbye.c')
8902
       Default(hello)
8903
    </PRE
8904
><P
8905
>&#13;
8906
    This <TT
8907
CLASS="filename"
8908
>SConstruct</TT
8909
> file knows how to build two programs,
8910
    <SPAN
8911
CLASS="application"
8912
>hello</SPAN
8913
> and <SPAN
8914
CLASS="application"
8915
>goodbye</SPAN
8916
>,
8917
    but only builds the
8918
    <SPAN
8919
CLASS="application"
8920
>hello</SPAN
8921
> program by default:
8922
8923
    </P
8924
><PRE
8925
CLASS="screen"
8926
>&#13;       % <KBD
8927
CLASS="userinput"
8928
>scons -Q</KBD
8929
>
8930
       cc -o hello.o -c hello.c
8931
       cc -o hello hello.o
8932
       % <KBD
8933
CLASS="userinput"
8934
>scons -Q</KBD
8935
>
8936
       scons: `hello' is up to date.
8937
       % <KBD
8938
CLASS="userinput"
8939
>scons -Q goodbye</KBD
8940
>
8941
       cc -o goodbye.o -c goodbye.c
8942
       cc -o goodbye goodbye.o
8943
    </PRE
8944
><P
8945
>&#13;
8946
    Note that, even when you use the <CODE
8947
CLASS="function"
8948
>Default</CODE
8949
>
8950
    function in your <TT
8951
CLASS="filename"
8952
>SConstruct</TT
8953
> file,
8954
    you can still explicitly specify the current directory
8955
    (<TT
8956
CLASS="literal"
8957
>.</TT
8958
>) on the command line
8959
    to tell <SPAN
8960
CLASS="application"
8961
>SCons</SPAN
8962
> to build
8963
    everything in (or below) the current directory:
8964
8965
    </P
8966
><PRE
8967
CLASS="screen"
8968
>&#13;       % <KBD
8969
CLASS="userinput"
8970
>scons -Q .</KBD
8971
>
8972
       cc -o goodbye.o -c goodbye.c
8973
       cc -o goodbye goodbye.o
8974
       cc -o hello.o -c hello.c
8975
       cc -o hello hello.o
8976
    </PRE
8977
><P
8978
>&#13;
8979
    You can also call the <CODE
8980
CLASS="function"
8981
>Default</CODE
8982
>
8983
    function more than once,
8984
    in which case each call
8985
    adds to the list of targets to be built by default:
8986
8987
    </P
8988
><PRE
8989
CLASS="programlisting"
8990
>&#13;       env = Environment()
8991
       prog1 = env.Program('prog1.c')
8992
       Default(prog1)
8993
       prog2 = env.Program('prog2.c')
8994
       prog3 = env.Program('prog3.c')
8995
       Default(prog3)
8996
    </PRE
8997
><P
8998
>&#13;
8999
    Or you can specify more than one target
9000
    in a single call to the <CODE
9001
CLASS="function"
9002
>Default</CODE
9003
> function:
9004
9005
    </P
9006
><PRE
9007
CLASS="programlisting"
9008
>&#13;       env = Environment()
9009
       prog1 = env.Program('prog1.c')
9010
       prog2 = env.Program('prog2.c')
9011
       prog3 = env.Program('prog3.c')
9012
       Default(prog1, prog3)
9013
    </PRE
9014
><P
9015
>&#13;
9016
    Either of these last two examples
9017
    will build only the
9018
    <SPAN
9019
CLASS="application"
9020
>prog1</SPAN
9021
>
9022
    and
9023
    <SPAN
9024
CLASS="application"
9025
>prog3</SPAN
9026
>
9027
    programs by default:
9028
9029
    </P
9030
><PRE
9031
CLASS="screen"
9032
>&#13;       % <KBD
9033
CLASS="userinput"
9034
>scons -Q</KBD
9035
>
9036
       cc -o prog1.o -c prog1.c
9037
       cc -o prog1 prog1.o
9038
       cc -o prog3.o -c prog3.c
9039
       cc -o prog3 prog3.o
9040
       % <KBD
9041
CLASS="userinput"
9042
>scons -Q .</KBD
9043
>
9044
       cc -o prog2.o -c prog2.c
9045
       cc -o prog2 prog2.o
9046
    </PRE
9047
><P
9048
>&#13;
9049
    You can list a directory as
9050
    an argument to <CODE
9051
CLASS="function"
9052
>Default</CODE
9053
>:
9054
9055
    </P
9056
><PRE
9057
CLASS="programlisting"
9058
>&#13;       env = Environment()
9059
       env.Program(['prog1/main.c', 'prog1/foo.c'])
9060
       env.Program(['prog2/main.c', 'prog2/bar.c'])
9061
       Default('prog1')
9062
    </PRE
9063
><P
9064
>&#13;
9065
    In which case only the target(s) in that
9066
    directory will be built by default:
9067
9068
    </P
9069
><PRE
9070
CLASS="screen"
9071
>&#13;       % <KBD
9072
CLASS="userinput"
9073
>scons -Q</KBD
9074
>
9075
       cc -o prog1/foo.o -c prog1/foo.c
9076
       cc -o prog1/main.o -c prog1/main.c
9077
       cc -o prog1/main prog1/main.o prog1/foo.o
9078
       % <KBD
9079
CLASS="userinput"
9080
>scons -Q</KBD
9081
>
9082
       scons: `prog1' is up to date.
9083
       % <KBD
9084
CLASS="userinput"
9085
>scons -Q .</KBD
9086
>
9087
       cc -o prog2/bar.o -c prog2/bar.c
9088
       cc -o prog2/main.o -c prog2/main.c
9089
       cc -o prog2/main prog2/main.o prog2/bar.o
9090
    </PRE
9091
><P
9092
>&#13;
9093
    Lastly, if for some reason you don't want
9094
    any targets built by default,
9095
    you can use the Python <TT
9096
CLASS="literal"
9097
>None</TT
9098
>
9099
    variable:
9100
9101
    </P
9102
><PRE
9103
CLASS="programlisting"
9104
>&#13;       env = Environment()
9105
       prog1 = env.Program('prog1.c')
9106
       prog2 = env.Program('prog2.c')
9107
       Default(None)
9108
    </PRE
9109
><P
9110
>&#13;
9111
    Which would produce build output like:
9112
9113
    </P
9114
><PRE
9115
CLASS="screen"
9116
>&#13;       % <KBD
9117
CLASS="userinput"
9118
>scons -Q</KBD
9119
>
9120
       scons: *** No targets specified and no Default() targets found.  Stop.
9121
       % <KBD
9122
CLASS="userinput"
9123
>scons -Q .</KBD
9124
>
9125
       cc -o prog1.o -c prog1.c
9126
       cc -o prog1 prog1.o
9127
       cc -o prog2.o -c prog2.c
9128
       cc -o prog2 prog2.o
9129
    </PRE
9130
><DIV
9131
CLASS="section"
9132
><HR><H3
9133
CLASS="section"
9134
><A
9135
NAME="AEN1556"
9136
>9.3.1. Getting at the List of Default Targets</A
9137
></H3
9138
><P
9139
>&#13;
9140
      <SPAN
9141
CLASS="application"
9142
>SCons</SPAN
9143
> supports a <CODE
9144
CLASS="varname"
9145
>DEFAULT_TARGETS</CODE
9146
> variable
9147
      that lets you get at the current list of default targets.
9148
      The <CODE
9149
CLASS="varname"
9150
>DEFAULT_TARGETS</CODE
9151
> variable has
9152
      two important differences from the <CODE
9153
CLASS="varname"
9154
>COMMAND_LINE_TARGETS</CODE
9155
> variable.
9156
      First, the <CODE
9157
CLASS="varname"
9158
>DEFAULT_TARGETS</CODE
9159
> variable is a list of
9160
      internal <SPAN
9161
CLASS="application"
9162
>SCons</SPAN
9163
> nodes,
9164
      so you need to convert the list elements to strings
9165
      if you want to print them or look for a specific target name.
9166
      Fortunately, you can do this easily
9167
      by using the Python <CODE
9168
CLASS="function"
9169
>map</CODE
9170
> function
9171
      to run the list through <CODE
9172
CLASS="function"
9173
>str</CODE
9174
>:
9175
9176
      </P
9177
><PRE
9178
CLASS="programlisting"
9179
>&#13;         prog1 = Program('prog1.c')
9180
         Default(prog1)
9181
         print "DEFAULT_TARGETS is", map(str, DEFAULT_TARGETS)
9182
      </PRE
9183
><P
9184
>&#13;
9185
      (Keep in mind that all of the manipulation of the
9186
      <CODE
9187
CLASS="varname"
9188
>DEFAULT_TARGETS</CODE
9189
> list takes place during the
9190
      first phase when <SPAN
9191
CLASS="application"
9192
>SCons</SPAN
9193
> is reading up the <TT
9194
CLASS="filename"
9195
>SConscript</TT
9196
> files,
9197
      which is obvious if 
9198
      we leave off the <TT
9199
CLASS="literal"
9200
>-Q</TT
9201
> flag when we run <SPAN
9202
CLASS="application"
9203
>SCons</SPAN
9204
>:)
9205
9206
      </P
9207
><PRE
9208
CLASS="screen"
9209
>&#13;         % <KBD
9210
CLASS="userinput"
9211
>scons</KBD
9212
>
9213
         scons: Reading SConscript files ...
9214
         DEFAULT_TARGETS is ['prog1']
9215
         scons: done reading SConscript files.
9216
         scons: Building targets ...
9217
         cc -o prog1.o -c prog1.c
9218
         cc -o prog1 prog1.o
9219
         scons: done building targets.
9220
      </PRE
9221
><P
9222
>&#13;
9223
      Second,
9224
      the contents of the <CODE
9225
CLASS="varname"
9226
>DEFAULT_TARGETS</CODE
9227
> list change
9228
      in response to calls to the <CODE
9229
CLASS="function"
9230
>Default</CODE
9231
>: function,
9232
      as you can see from the following <TT
9233
CLASS="filename"
9234
>SConstruct</TT
9235
> file:
9236
9237
      </P
9238
><PRE
9239
CLASS="programlisting"
9240
>&#13;         prog1 = Program('prog1.c')
9241
         Default(prog1)
9242
         print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
9243
         prog2 = Program('prog2.c')
9244
         Default(prog2)
9245
         print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
9246
      </PRE
9247
><P
9248
>&#13;
9249
      Which yields the output:
9250
9251
      </P
9252
><PRE
9253
CLASS="screen"
9254
>&#13;         % <KBD
9255
CLASS="userinput"
9256
>scons</KBD
9257
>
9258
         scons: Reading SConscript files ...
9259
         DEFAULT_TARGETS is now ['prog1']
9260
         DEFAULT_TARGETS is now ['prog1', 'prog2']
9261
         scons: done reading SConscript files.
9262
         scons: Building targets ...
9263
         cc -o prog1.o -c prog1.c
9264
         cc -o prog1 prog1.o
9265
         cc -o prog2.o -c prog2.c
9266
         cc -o prog2 prog2.o
9267
         scons: done building targets.
9268
      </PRE
9269
><P
9270
>&#13;
9271
      In practice, this simply means that you
9272
      need to pay attention to the order in
9273
      which you call the <CODE
9274
CLASS="function"
9275
>Default</CODE
9276
> function
9277
      and refer to the <CODE
9278
CLASS="varname"
9279
>DEFAULT_TARGETS</CODE
9280
> list,
9281
      to make sure that you don't examine the
9282
      list before you've added the default targets
9283
      you expect to find in it.
9284
9285
      </P
9286
></DIV
9287
></DIV
9288
><DIV
9289
CLASS="section"
9290
><HR><H2
9291
CLASS="section"
9292
><A
9293
NAME="AEN1587"
9294
>9.4. Getting at the List of Build Targets, Regardless of Origin</A
9295
></H2
9296
><P
9297
>&#13;
9298
    We've already been introduced to the
9299
    <CODE
9300
CLASS="varname"
9301
>COMMAND_LINE_TARGETS</CODE
9302
> variable,
9303
    which contains a list of targets specified on the command line,
9304
    and the <CODE
9305
CLASS="varname"
9306
>DEFAULT_TARGETS</CODE
9307
> variable,
9308
    which contains a list of targets specified
9309
    via calls to the <CODE
9310
CLASS="function"
9311
>Default</CODE
9312
> method or function.
9313
    Sometimes, however,
9314
    you want a list of whatever targets
9315
    <SPAN
9316
CLASS="application"
9317
>SCons</SPAN
9318
> will try to build,
9319
    regardless of whether the targets came from the
9320
    command line or a <CODE
9321
CLASS="function"
9322
>Default</CODE
9323
> call.
9324
    You could code this up by hand, as follows:
9325
9326
    </P
9327
><PRE
9328
CLASS="programlisting"
9329
>&#13;      if COMMAND_LINE_TARGETS:
9330
          targets = COMMAND_LINE_TARGETS
9331
      else:
9332
          targets = DEFAULT_TARGETS
9333
    </PRE
9334
><P
9335
>&#13;
9336
    <SPAN
9337
CLASS="application"
9338
>SCons</SPAN
9339
>, however, provides a convenient
9340
    <CODE
9341
CLASS="varname"
9342
>BUILD_TARGETS</CODE
9343
> variable
9344
    that eliminates the need for this by-hand manipulation.
9345
    Essentially, the <CODE
9346
CLASS="varname"
9347
>BUILD_TARGETS</CODE
9348
> variable
9349
    contains a list of the command-line targets,
9350
    if any were specified,
9351
    and if no command-line targets were specified,
9352
    it contains a list of the targets specified
9353
    via the <CODE
9354
CLASS="function"
9355
>Default</CODE
9356
> method or function.
9357
9358
    </P
9359
><P
9360
>&#13;
9361
    Because <CODE
9362
CLASS="varname"
9363
>BUILD_TARGETS</CODE
9364
> may contain a list of <SPAN
9365
CLASS="application"
9366
>SCons</SPAN
9367
> nodes,
9368
    you must convert the list elements to strings
9369
    if you want to print them or look for a specific target name,
9370
    just like the <CODE
9371
CLASS="varname"
9372
>DEFAULT_TARGETS</CODE
9373
> list:
9374
9375
    </P
9376
><PRE
9377
CLASS="programlisting"
9378
>&#13;      prog1 = Program('prog1.c')
9379
      Program('prog2.c')
9380
      Default(prog1)
9381
      print "BUILD_TARGETS is", map(str, BUILD_TARGETS)
9382
    </PRE
9383
><P
9384
>&#13;
9385
    Notice how the value of <CODE
9386
CLASS="varname"
9387
>BUILD_TARGETS</CODE
9388
>
9389
    changes depending on whether a target is
9390
    specified on the command line:
9391
9392
    </P
9393
><PRE
9394
CLASS="screen"
9395
>&#13;      % <KBD
9396
CLASS="userinput"
9397
>scons -Q</KBD
9398
>
9399
      BUILD_TARGETS is ['prog1']
9400
      cc -o prog1.o -c prog1.c
9401
      cc -o prog1 prog1.o
9402
      % <KBD
9403
CLASS="userinput"
9404
>scons -Q prog2</KBD
9405
>
9406
      BUILD_TARGETS is ['prog2']
9407
      cc -o prog2.o -c prog2.c
9408
      cc -o prog2 prog2.o
9409
      % <KBD
9410
CLASS="userinput"
9411
>scons -Q -c .</KBD
9412
>
9413
      BUILD_TARGETS is ['.']
9414
      Removed prog1.o
9415
      Removed prog1
9416
      Removed prog2.o
9417
      Removed prog2
9418
    </PRE
9419
></DIV
9420
><DIV
9421
CLASS="section"
9422
><HR><H2
9423
CLASS="section"
9424
><A
9425
NAME="AEN1612"
9426
>9.5. Command-Line <CODE
9427
CLASS="varname"
9428
>variable</CODE
9429
>=<CODE
9430
CLASS="varname"
9431
>value</CODE
9432
> Build Options</A
9433
></H2
9434
><P
9435
>&#13;
9436
    You may want to control various aspects
9437
    of your build by allowing the user
9438
    to specify <CODE
9439
CLASS="varname"
9440
>variable</CODE
9441
>=<CODE
9442
CLASS="varname"
9443
>value</CODE
9444
>
9445
    values on the command line.
9446
    For example, suppose you
9447
    want users to be able to
9448
    build a debug version of a program
9449
    by running <SPAN
9450
CLASS="application"
9451
>SCons</SPAN
9452
> as follows:
9453
9454
    </P
9455
><PRE
9456
CLASS="screen"
9457
>&#13;      % <KBD
9458
CLASS="userinput"
9459
>scons -Q debug=1</KBD
9460
>
9461
    </PRE
9462
><P
9463
>&#13;
9464
    <SPAN
9465
CLASS="application"
9466
>SCons</SPAN
9467
> provides an <CODE
9468
CLASS="varname"
9469
>ARGUMENTS</CODE
9470
> dictionary
9471
    that stores all of the
9472
    <CODE
9473
CLASS="varname"
9474
>variable</CODE
9475
>=<CODE
9476
CLASS="varname"
9477
>value</CODE
9478
>
9479
    assignments from the command line.
9480
    This allows you to modify
9481
    aspects of your build in response
9482
    to specifications on the command line.
9483
    (Note that unless you want to require
9484
    that users <SPAN
9485
CLASS="emphasis"
9486
><I
9487
CLASS="emphasis"
9488
>always</I
9489
></SPAN
9490
>
9491
    specify an option,
9492
    you probably want to use
9493
    the Python
9494
    <TT
9495
CLASS="literal"
9496
>ARGUMENTS.get()</TT
9497
> function,
9498
    which allows you to specify a default value
9499
    to be used if there is no specification
9500
    on the command line.)
9501
9502
    </P
9503
><P
9504
>&#13;
9505
    The following code sets the <A
9506
HREF="#cv-CCFLAGS"
9507
><CODE
9508
CLASS="envar"
9509
>$CCFLAGS</CODE
9510
></A
9511
> construction
9512
    variable in response to the <CODE
9513
CLASS="varname"
9514
>debug</CODE
9515
>
9516
    flag being set in the <CODE
9517
CLASS="varname"
9518
>ARGUMENTS</CODE
9519
> dictionary:
9520
9521
    </P
9522
><PRE
9523
CLASS="programlisting"
9524
>&#13;       env = Environment()
9525
       debug = ARGUMENTS.get('debug', 0)
9526
       if int(debug):
9527
           env.Append(CCFLAGS = '-g')
9528
       env.Program('prog.c')
9529
    </PRE
9530
><P
9531
>&#13;
9532
    This results in the <CODE
9533
CLASS="varname"
9534
>-g</CODE
9535
>
9536
    compiler option being used when
9537
    <TT
9538
CLASS="literal"
9539
>debug=1</TT
9540
>
9541
    is used on the command line:
9542
9543
    </P
9544
><PRE
9545
CLASS="screen"
9546
>&#13;       % <KBD
9547
CLASS="userinput"
9548
>scons -Q debug=0</KBD
9549
>
9550
       cc -o prog.o -c prog.c
9551
       cc -o prog prog.o
9552
       % <KBD
9553
CLASS="userinput"
9554
>scons -Q debug=0</KBD
9555
>
9556
       scons: `.' is up to date.
9557
       % <KBD
9558
CLASS="userinput"
9559
>scons -Q debug=1</KBD
9560
>
9561
       cc -o prog.o -c -g prog.c
9562
       cc -o prog prog.o
9563
       % <KBD
9564
CLASS="userinput"
9565
>scons -Q debug=1</KBD
9566
>
9567
       scons: `.' is up to date.
9568
    </PRE
9569
><P
9570
>&#13;
9571
    Notice that <SPAN
9572
CLASS="application"
9573
>SCons</SPAN
9574
> keeps track of
9575
    the last values used to build the object files,
9576
    and as a result correctly rebuilds
9577
    the object and executable files
9578
    only when the value of the <TT
9579
CLASS="literal"
9580
>debug</TT
9581
>
9582
    argument has changed.
9583
9584
    </P
9585
></DIV
9586
><DIV
9587
CLASS="section"
9588
><HR><H2
9589
CLASS="section"
9590
><A
9591
NAME="AEN1646"
9592
>9.6. Controlling Command-Line Build Options</A
9593
></H2
9594
><P
9595
>&#13;
9596
    Being able to use a command-line build option like
9597
    <TT
9598
CLASS="literal"
9599
>debug=1</TT
9600
> is handy,
9601
    but it can be a chore to write specific Python code
9602
    to recognize each such option
9603
    and apply the values to a construction variable.
9604
    To help with this,
9605
    <SPAN
9606
CLASS="application"
9607
>SCons</SPAN
9608
> supports a class to
9609
    define such build options easily,
9610
    and a mechanism to apply the
9611
    build options to a construction environment.
9612
    This allows you to control how the build options affect
9613
    construction environments.
9614
9615
    </P
9616
><P
9617
>&#13;
9618
    For example, suppose that you want users to set
9619
    a <CODE
9620
CLASS="varname"
9621
>RELEASE</CODE
9622
> construction variable on the
9623
    command line whenever the time comes to build
9624
    a program for release,
9625
    and that the value of this variable
9626
    should be added to the command line
9627
    with the appropriate <TT
9628
CLASS="literal"
9629
>-D</TT
9630
> option
9631
    (or other command line option)
9632
    to pass the value to the C compiler.
9633
    Here's how you might do that by setting
9634
    the appropriate value in a dictionary for the
9635
    <A
9636
HREF="#cv-CPPDEFINES"
9637
><CODE
9638
CLASS="envar"
9639
>$CPPDEFINES</CODE
9640
></A
9641
> construction variable:
9642
9643
    </P
9644
><PRE
9645
CLASS="programlisting"
9646
>&#13;         opts = Options()
9647
         opts.Add('RELEASE', 'Set to 1 to build for release', 0)
9648
         env = Environment(options = opts,
9649
                           CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
9650
         env.Program(['foo.c', 'bar.c'])
9651
    </PRE
9652
><P
9653
>&#13;
9654
    This <TT
9655
CLASS="filename"
9656
>SConstruct</TT
9657
> file first creates an
9658
    <CODE
9659
CLASS="function"
9660
>Options</CODE
9661
> object
9662
    (the <TT
9663
CLASS="literal"
9664
>opts = Options()</TT
9665
> call),
9666
    and then uses the object's <CODE
9667
CLASS="function"
9668
>Add</CODE
9669
>
9670
    method to indicate that the <CODE
9671
CLASS="varname"
9672
>RELEASE</CODE
9673
>
9674
    option can be set on the command line,
9675
    and that it's default value will be <TT
9676
CLASS="literal"
9677
>0</TT
9678
>
9679
    (the third argument to the <CODE
9680
CLASS="function"
9681
>Add</CODE
9682
> method).
9683
    The second argument is a line of help text;
9684
    we'll learn how to use it in the next section.
9685
9686
    </P
9687
><P
9688
>&#13;
9689
    We then pass the created <CODE
9690
CLASS="function"
9691
>Options</CODE
9692
>
9693
    object as an <CODE
9694
CLASS="varname"
9695
>options</CODE
9696
> keyword argument
9697
    to the <CODE
9698
CLASS="function"
9699
>Environment</CODE
9700
> call
9701
    used to create the construction environment.
9702
    This then allows a user to set the
9703
    <CODE
9704
CLASS="varname"
9705
>RELEASE</CODE
9706
> build option on the command line
9707
    and have the variable show up in
9708
    the command line used to build each object from
9709
    a C source file:
9710
9711
    </P
9712
><PRE
9713
CLASS="screen"
9714
>&#13;      % <KBD
9715
CLASS="userinput"
9716
>scons -Q RELEASE=1</KBD
9717
>
9718
      cc -o bar.o -c -DRELEASE_BUILD=1 bar.c
9719
      cc -o foo.o -c -DRELEASE_BUILD=1 foo.c
9720
      cc -o foo foo.o bar.o
9721
    </PRE
9722
></DIV
9723
><DIV
9724
CLASS="section"
9725
><HR><H2
9726
CLASS="section"
9727
><A
9728
NAME="AEN1672"
9729
>9.7. Providing Help for Command-Line Build Options</A
9730
></H2
9731
><P
9732
>&#13;
9733
    To make command-line build options most useful,
9734
    you ideally want to provide
9735
    some help text that will describe
9736
    the available options
9737
    when the user runs <TT
9738
CLASS="literal"
9739
>scons -h</TT
9740
>.
9741
    You could write this text by hand,
9742
    but <SPAN
9743
CLASS="application"
9744
>SCons</SPAN
9745
> provides an easier way.
9746
    <CODE
9747
CLASS="function"
9748
>Options</CODE
9749
> objects support a
9750
    <CODE
9751
CLASS="function"
9752
>GenerateHelpText</CODE
9753
> method
9754
    that will, as its name indicates,
9755
    generate text that describes
9756
    the various options that
9757
    have been added to it.
9758
    You then pass the output from this method to
9759
    the <CODE
9760
CLASS="function"
9761
>Help</CODE
9762
> function:
9763
9764
    </P
9765
><PRE
9766
CLASS="programlisting"
9767
>&#13;         opts = Options('custom.py')
9768
         opts.Add('RELEASE', 'Set to 1 to build for release', 0)
9769
         env = Environment(options = opts)
9770
         Help(opts.GenerateHelpText(env))
9771
    </PRE
9772
><P
9773
>&#13;
9774
    <SPAN
9775
CLASS="application"
9776
>SCons</SPAN
9777
> will now display some useful text
9778
    when the <TT
9779
CLASS="literal"
9780
>-h</TT
9781
> option is used:
9782
9783
    </P
9784
><PRE
9785
CLASS="screen"
9786
>&#13;      % <KBD
9787
CLASS="userinput"
9788
>scons -Q -h</KBD
9789
>
9790
      
9791
      RELEASE: Set to 1 to build for release
9792
          default: 0
9793
          actual: 0
9794
      
9795
      Use scons -H for help about command-line options.
9796
    </PRE
9797
><P
9798
>&#13;
9799
    Notice that the help output shows the default value,
9800
    and the current actual value of the build option.
9801
9802
    </P
9803
></DIV
9804
><DIV
9805
CLASS="section"
9806
><HR><H2
9807
CLASS="section"
9808
><A
9809
NAME="AEN1687"
9810
>9.8. Reading Build Options From a File</A
9811
></H2
9812
><P
9813
>&#13;
9814
    Being able to use a command-line build option like
9815
    <TT
9816
CLASS="literal"
9817
>debug=1</TT
9818
> is handy,
9819
    but it can be a chore to write specific Python code
9820
    to recognize each such option
9821
    and apply the values to a construction variable.
9822
    To help with this,
9823
    <SPAN
9824
CLASS="application"
9825
>SCons</SPAN
9826
> supports a class to
9827
    define such build options easily
9828
    and to read build option values from a file.
9829
    This allows you to control how the build options affect
9830
    construction environments.
9831
    The way you do this is by specifying
9832
    a file name when you call <CODE
9833
CLASS="function"
9834
>Options</CODE
9835
>,
9836
    like <TT
9837
CLASS="filename"
9838
>custom.py</TT
9839
> in the following example:
9840
9841
    </P
9842
><PRE
9843
CLASS="programlisting"
9844
>&#13;         opts = Options('custom.py')
9845
         opts.Add('RELEASE', 'Set to 1 to build for release', 0)
9846
         env = Environment(options = opts,
9847
                           CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
9848
         env.Program(['foo.c', 'bar.c'])
9849
         Help(opts.GenerateHelpText(env))
9850
    </PRE
9851
><P
9852
>&#13;
9853
    This then allows us to control the <CODE
9854
CLASS="varname"
9855
>RELEASE</CODE
9856
>
9857
    variable by setting it in the <TT
9858
CLASS="filename"
9859
>custom.py</TT
9860
> file:
9861
9862
    </P
9863
><PRE
9864
CLASS="programlisting"
9865
>&#13;      RELEASE = 1
9866
      </PRE
9867
><P
9868
>&#13;
9869
    Note that this file is actually executed
9870
    like a Python script.
9871
    Now when we run <SPAN
9872
CLASS="application"
9873
>SCons</SPAN
9874
>:
9875
9876
    </P
9877
><PRE
9878
CLASS="screen"
9879
>&#13;      % <KBD
9880
CLASS="userinput"
9881
>scons -Q</KBD
9882
>
9883
      cc -o bar.o -c -DRELEASE_BUILD=1 bar.c
9884
      cc -o foo.o -c -DRELEASE_BUILD=1 foo.c
9885
      cc -o foo foo.o bar.o
9886
    </PRE
9887
><P
9888
>&#13;
9889
    And if we change the contents of <TT
9890
CLASS="filename"
9891
>custom.py</TT
9892
> to:
9893
9894
    </P
9895
><PRE
9896
CLASS="programlisting"
9897
>&#13;      RELEASE = 0
9898
    </PRE
9899
><P
9900
>&#13;
9901
    The object files are rebuilt appropriately
9902
    with the new option:
9903
9904
    </P
9905
><PRE
9906
CLASS="screen"
9907
>&#13;      % <KBD
9908
CLASS="userinput"
9909
>scons -Q</KBD
9910
>
9911
      cc -o bar.o -c -DRELEASE_BUILD=0 bar.c
9912
      cc -o foo.o -c -DRELEASE_BUILD=0 foo.c
9913
      cc -o foo foo.o bar.o
9914
    </PRE
9915
></DIV
9916
><DIV
9917
CLASS="section"
9918
><HR><H2
9919
CLASS="section"
9920
><A
9921
NAME="AEN1709"
9922
>9.9. Canned Build Options</A
9923
></H2
9924
><P
9925
>&#13;
9926
    <SPAN
9927
CLASS="application"
9928
>SCons</SPAN
9929
> provides a number of functions
9930
    that provide ready-made behaviors
9931
    for various types of command-line build options.
9932
9933
    </P
9934
><DIV
9935
CLASS="section"
9936
><HR><H3
9937
CLASS="section"
9938
><A
9939
NAME="AEN1713"
9940
>9.9.1. True/False Values:  the <CODE
9941
CLASS="function"
9942
>BoolOption</CODE
9943
> Build Option</A
9944
></H3
9945
><P
9946
>&#13;
9947
      It's often handy to be able to specify an
9948
      option that controls a simple Boolean variable
9949
      with a <TT
9950
CLASS="literal"
9951
>true</TT
9952
> or <TT
9953
CLASS="literal"
9954
>false</TT
9955
> value.
9956
      It would be even more handy to accomodate
9957
      users who have different preferences for how to represent
9958
      <TT
9959
CLASS="literal"
9960
>true</TT
9961
> or <TT
9962
CLASS="literal"
9963
>false</TT
9964
> values.
9965
      The <CODE
9966
CLASS="function"
9967
>BoolOption</CODE
9968
> function
9969
      makes it easy to accomodate a variety of
9970
      common values that represent
9971
      <TT
9972
CLASS="literal"
9973
>true</TT
9974
> or <TT
9975
CLASS="literal"
9976
>false</TT
9977
>.
9978
9979
      </P
9980
><P
9981
>&#13;
9982
      The <CODE
9983
CLASS="function"
9984
>BoolOption</CODE
9985
> function takes three arguments:
9986
      the name of the build option,
9987
      the default value of the build option,
9988
      and the help string for the option.
9989
      It then returns appropriate information for
9990
      passing to the <CODE
9991
CLASS="function"
9992
>Add</CODE
9993
> method of an <CODE
9994
CLASS="function"
9995
>Options</CODE
9996
> object, like so:
9997
9998
      </P
9999
><PRE
10000
CLASS="programlisting"
10001
>&#13;           opts = Options('custom.py')
10002
           opts.Add(BoolOption('RELEASE', 'Set to build for release', 0))
10003
           env = Environment(options = opts,
10004
                             CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
10005
           env.Program('foo.c')
10006
      </PRE
10007
><P
10008
>&#13;
10009
      With this build option,
10010
      the <CODE
10011
CLASS="varname"
10012
>RELEASE</CODE
10013
> variable can now be enabled by
10014
      setting it to the value <TT
10015
CLASS="literal"
10016
>yes</TT
10017
>
10018
      or <TT
10019
CLASS="literal"
10020
>t</TT
10021
>:
10022
10023
      </P
10024
><PRE
10025
CLASS="screen"
10026
>&#13;        % <KBD
10027
CLASS="userinput"
10028
>scons -Q RELEASE=yes foo.o</KBD
10029
>
10030
        cc -o foo.o -c -DRELEASE_BUILD=True foo.c
10031
      </PRE
10032
><PRE
10033
CLASS="screen"
10034
>&#13;        % <KBD
10035
CLASS="userinput"
10036
>scons -Q RELEASE=t foo.o</KBD
10037
>
10038
        cc -o foo.o -c -DRELEASE_BUILD=True foo.c
10039
      </PRE
10040
><P
10041
>&#13;
10042
      Other values that equate to <TT
10043
CLASS="literal"
10044
>true</TT
10045
> include
10046
      <TT
10047
CLASS="literal"
10048
>y</TT
10049
>,
10050
      <TT
10051
CLASS="literal"
10052
>1</TT
10053
>,
10054
      <TT
10055
CLASS="literal"
10056
>on</TT
10057
>
10058
      and
10059
      <TT
10060
CLASS="literal"
10061
>all</TT
10062
>.
10063
10064
      </P
10065
><P
10066
>&#13;
10067
      Conversely, <CODE
10068
CLASS="varname"
10069
>RELEASE</CODE
10070
> may now be given a <TT
10071
CLASS="literal"
10072
>false</TT
10073
>
10074
      value by setting it to
10075
      <TT
10076
CLASS="literal"
10077
>no</TT
10078
>
10079
      or
10080
      <TT
10081
CLASS="literal"
10082
>f</TT
10083
>:
10084
10085
      </P
10086
><PRE
10087
CLASS="screen"
10088
>&#13;        % <KBD
10089
CLASS="userinput"
10090
>scons -Q RELEASE=no foo.o</KBD
10091
>
10092
        cc -o foo.o -c -DRELEASE_BUILD=False foo.c
10093
      </PRE
10094
><PRE
10095
CLASS="screen"
10096
>&#13;        % <KBD
10097
CLASS="userinput"
10098
>scons -Q RELEASE=f foo.o</KBD
10099
>
10100
        cc -o foo.o -c -DRELEASE_BUILD=False foo.c
10101
      </PRE
10102
><P
10103
>&#13;
10104
      Other values that equate to <TT
10105
CLASS="literal"
10106
>false</TT
10107
> include
10108
      <TT
10109
CLASS="literal"
10110
>n</TT
10111
>,
10112
      <TT
10113
CLASS="literal"
10114
>0</TT
10115
>,
10116
      <TT
10117
CLASS="literal"
10118
>off</TT
10119
>
10120
      and
10121
      <TT
10122
CLASS="literal"
10123
>none</TT
10124
>.
10125
10126
      </P
10127
><P
10128
>&#13;
10129
      Lastly, if a user tries to specify
10130
      any other value,
10131
      <SPAN
10132
CLASS="application"
10133
>SCons</SPAN
10134
> supplies an appropriate error message:
10135
10136
      </P
10137
><PRE
10138
CLASS="screen"
10139
>&#13;        % <KBD
10140
CLASS="userinput"
10141
>scons -Q RELEASE=bad_value foo.o</KBD
10142
>
10143
        
10144
        scons: *** Error converting option: RELEASE
10145
        Invalid value for boolean option: bad_value
10146
        File "/home/my/project/SConstruct", line 4, in &#60;module&#62;
10147
      </PRE
10148
></DIV
10149
><DIV
10150
CLASS="section"
10151
><HR><H3
10152
CLASS="section"
10153
><A
10154
NAME="AEN1762"
10155
>9.9.2. Single Value From a List:  the <CODE
10156
CLASS="function"
10157
>EnumOption</CODE
10158
> Build Option</A
10159
></H3
10160
><P
10161
>&#13;
10162
      Suppose that we want a user to be able to
10163
      set a <CODE
10164
CLASS="varname"
10165
>COLOR</CODE
10166
> option
10167
      that selects a background color to be
10168
      displayed by an application,
10169
      but that we want to restrict the
10170
      choices to a specific set of allowed colors.
10171
      This can be set up quite easily
10172
      using the <CODE
10173
CLASS="function"
10174
>EnumOption</CODE
10175
>,
10176
      which takes a list of <CODE
10177
CLASS="varname"
10178
>allowed_values</CODE
10179
>      in addition to the variable name,
10180
      default value,
10181
      and help text arguments:
10182
10183
      </P
10184
><PRE
10185
CLASS="programlisting"
10186
>&#13;           opts = Options('custom.py')
10187
           opts.Add(EnumOption('COLOR', 'Set background color', 'red',
10188
                               allowed_values=('red', 'green', 'blue')))
10189
           env = Environment(options = opts,
10190
                             CPPDEFINES={'COLOR' : '"${COLOR}"'})
10191
           env.Program('foo.c')
10192
      </PRE
10193
><P
10194
>&#13;
10195
      The user can now explicity set the <CODE
10196
CLASS="varname"
10197
>COLOR</CODE
10198
> build option
10199
      to any of the specified allowed values:
10200
10201
      </P
10202
><PRE
10203
CLASS="screen"
10204
>&#13;        % <KBD
10205
CLASS="userinput"
10206
>scons -Q COLOR=red foo.o</KBD
10207
>
10208
        cc -o foo.o -c -DCOLOR="red" foo.c
10209
        % <KBD
10210
CLASS="userinput"
10211
>scons -Q COLOR=blue foo.o</KBD
10212
>
10213
        cc -o foo.o -c -DCOLOR="blue" foo.c
10214
        % <KBD
10215
CLASS="userinput"
10216
>scons -Q COLOR=green foo.o</KBD
10217
>
10218
        cc -o foo.o -c -DCOLOR="green" foo.c
10219
      </PRE
10220
><P
10221
>&#13;
10222
      But, almost more importantly,
10223
      an attempt to set <CODE
10224
CLASS="varname"
10225
>COLOR</CODE
10226
>
10227
      to a value that's not in the list
10228
      generates an error message:
10229
10230
      </P
10231
><PRE
10232
CLASS="screen"
10233
>&#13;        % <KBD
10234
CLASS="userinput"
10235
>scons -Q COLOR=magenta foo.o</KBD
10236
>
10237
        
10238
        scons: *** Invalid value for option COLOR: magenta
10239
        File "/home/my/project/SConstruct", line 5, in &#60;module&#62;
10240
      </PRE
10241
><P
10242
>&#13;
10243
      The <CODE
10244
CLASS="function"
10245
>EnumOption</CODE
10246
> function also supports a way
10247
      to map alternate names to allowed values.
10248
      Suppose, for example,
10249
      that we want to allow the user
10250
      to use the word <TT
10251
CLASS="literal"
10252
>navy</TT
10253
> as a synonym for
10254
      <TT
10255
CLASS="literal"
10256
>blue</TT
10257
>.
10258
      We do this by adding a <CODE
10259
CLASS="varname"
10260
>map</CODE
10261
> dictionary
10262
      that will map its key values
10263
      to the desired legal value:
10264
10265
      </P
10266
><PRE
10267
CLASS="programlisting"
10268
>&#13;           opts = Options('custom.py')
10269
           opts.Add(EnumOption('COLOR', 'Set background color', 'red',
10270
                               allowed_values=('red', 'green', 'blue'),
10271
                               map={'navy':'blue'}))
10272
           env = Environment(options = opts,
10273
                             CPPDEFINES={'COLOR' : '"${COLOR}"'})
10274
           env.Program('foo.c')
10275
      </PRE
10276
><P
10277
>&#13;
10278
      As desired, the user can then use
10279
      <TT
10280
CLASS="literal"
10281
>navy</TT
10282
> on the command line,
10283
      and <SPAN
10284
CLASS="application"
10285
>SCons</SPAN
10286
> will translate it into <TT
10287
CLASS="literal"
10288
>blue</TT
10289
>
10290
      when it comes time to use the <CODE
10291
CLASS="varname"
10292
>COLOR</CODE
10293
>
10294
      option to build a target:
10295
10296
      </P
10297
><PRE
10298
CLASS="screen"
10299
>&#13;        % <KBD
10300
CLASS="userinput"
10301
>scons -Q COLOR=navy foo.o</KBD
10302
>
10303
        cc -o foo.o -c -DCOLOR="blue" foo.c
10304
      </PRE
10305
><P
10306
>&#13;
10307
      By default, when using the <CODE
10308
CLASS="function"
10309
>EnumOption</CODE
10310
> function,
10311
      arguments that differ
10312
      from the legal values
10313
      only in case
10314
      are treated as illegal values:
10315
10316
      </P
10317
><PRE
10318
CLASS="screen"
10319
>&#13;        % <KBD
10320
CLASS="userinput"
10321
>scons -Q COLOR=Red foo.o</KBD
10322
>
10323
        
10324
        scons: *** Invalid value for option COLOR: Red
10325
        File "/home/my/project/SConstruct", line 5, in &#60;module&#62;
10326
        % <KBD
10327
CLASS="userinput"
10328
>scons -Q COLOR=BLUE foo.o</KBD
10329
>
10330
        
10331
        scons: *** Invalid value for option COLOR: BLUE
10332
        File "/home/my/project/SConstruct", line 5, in &#60;module&#62;
10333
        % <KBD
10334
CLASS="userinput"
10335
>scons -Q COLOR=nAvY foo.o</KBD
10336
>
10337
        
10338
        scons: *** Invalid value for option COLOR: nAvY
10339
        File "/home/my/project/SConstruct", line 5, in &#60;module&#62;
10340
      </PRE
10341
><P
10342
>&#13;
10343
      The <CODE
10344
CLASS="function"
10345
>EnumOption</CODE
10346
> function can take an additional
10347
      <CODE
10348
CLASS="varname"
10349
>ignorecase</CODE
10350
> keyword argument that,
10351
      when set to <TT
10352
CLASS="literal"
10353
>1</TT
10354
>,
10355
      tells <SPAN
10356
CLASS="application"
10357
>SCons</SPAN
10358
> to allow case differences
10359
      when the values are specified:
10360
10361
      </P
10362
><PRE
10363
CLASS="programlisting"
10364
>&#13;           opts = Options('custom.py')
10365
           opts.Add(EnumOption('COLOR', 'Set background color', 'red',
10366
                               allowed_values=('red', 'green', 'blue'),
10367
                               map={'navy':'blue'},
10368
                               ignorecase=1))
10369
           env = Environment(options = opts,
10370
                             CPPDEFINES={'COLOR' : '"${COLOR}"'})
10371
           env.Program('foo.c')
10372
      </PRE
10373
><P
10374
>&#13;
10375
      Which yields the output:
10376
10377
      </P
10378
><PRE
10379
CLASS="screen"
10380
>&#13;        % <KBD
10381
CLASS="userinput"
10382
>scons -Q COLOR=Red foo.o</KBD
10383
>
10384
        cc -o foo.o -c -DCOLOR="Red" foo.c
10385
        % <KBD
10386
CLASS="userinput"
10387
>scons -Q COLOR=BLUE foo.o</KBD
10388
>
10389
        cc -o foo.o -c -DCOLOR="BLUE" foo.c
10390
        % <KBD
10391
CLASS="userinput"
10392
>scons -Q COLOR=nAvY foo.o</KBD
10393
>
10394
        cc -o foo.o -c -DCOLOR="blue" foo.c
10395
        % <KBD
10396
CLASS="userinput"
10397
>scons -Q COLOR=green foo.o</KBD
10398
>
10399
        cc -o foo.o -c -DCOLOR="green" foo.c
10400
      </PRE
10401
><P
10402
>&#13;
10403
      Notice that an <CODE
10404
CLASS="varname"
10405
>ignorecase</CODE
10406
> value of <TT
10407
CLASS="literal"
10408
>1</TT
10409
>
10410
      preserves the case-spelling that the user supplied.
10411
      If you want <SPAN
10412
CLASS="application"
10413
>SCons</SPAN
10414
> to translate the names
10415
      into lower-case,
10416
      regardless of the case used by the user,
10417
      specify an <CODE
10418
CLASS="varname"
10419
>ignorecase</CODE
10420
> value of <TT
10421
CLASS="literal"
10422
>2</TT
10423
>:
10424
10425
      </P
10426
><PRE
10427
CLASS="programlisting"
10428
>&#13;           opts = Options('custom.py')
10429
           opts.Add(EnumOption('COLOR', 'Set background color', 'red',
10430
                               allowed_values=('red', 'green', 'blue'),
10431
                               map={'navy':'blue'},
10432
                               ignorecase=2))
10433
           env = Environment(options = opts,
10434
                             CPPDEFINES={'COLOR' : '"${COLOR}"'})
10435
           env.Program('foo.c')
10436
      </PRE
10437
><P
10438
>&#13;
10439
      Now <SPAN
10440
CLASS="application"
10441
>SCons</SPAN
10442
> will use values of
10443
      <TT
10444
CLASS="literal"
10445
>red</TT
10446
>,
10447
      <TT
10448
CLASS="literal"
10449
>green</TT
10450
> or
10451
      <TT
10452
CLASS="literal"
10453
>blue</TT
10454
>
10455
      regardless of how the user spells
10456
      those values on the command line:
10457
10458
      </P
10459
><PRE
10460
CLASS="screen"
10461
>&#13;        % <KBD
10462
CLASS="userinput"
10463
>scons -Q COLOR=Red foo.o</KBD
10464
>
10465
        cc -o foo.o -c -DCOLOR="red" foo.c
10466
        % <KBD
10467
CLASS="userinput"
10468
>scons -Q COLOR=nAvY foo.o</KBD
10469
>
10470
        cc -o foo.o -c -DCOLOR="blue" foo.c
10471
        % <KBD
10472
CLASS="userinput"
10473
>scons -Q COLOR=GREEN foo.o</KBD
10474
>
10475
        cc -o foo.o -c -DCOLOR="green" foo.c
10476
      </PRE
10477
></DIV
10478
><DIV
10479
CLASS="section"
10480
><HR><H3
10481
CLASS="section"
10482
><A
10483
NAME="AEN1827"
10484
>9.9.3. Multiple Values From a List:  the <CODE
10485
CLASS="function"
10486
>ListOption</CODE
10487
> Build Option</A
10488
></H3
10489
><P
10490
>&#13;
10491
      Another way in which you might want to allow users
10492
      to control build option is to
10493
      specify a list of one or more legal values.
10494
      <SPAN
10495
CLASS="application"
10496
>SCons</SPAN
10497
> supports this through the <CODE
10498
CLASS="function"
10499
>ListOption</CODE
10500
> function.
10501
      If, for example, we want a user to be able to set a
10502
      <CODE
10503
CLASS="varname"
10504
>COLORS</CODE
10505
> option to one or more of the legal list of values:
10506
10507
      </P
10508
><PRE
10509
CLASS="programlisting"
10510
>&#13;           opts = Options('custom.py')
10511
           opts.Add(ListOption('COLORS', 'List of colors', 0,
10512
                               ['red', 'green', 'blue']))
10513
           env = Environment(options = opts,
10514
                             CPPDEFINES={'COLORS' : '"${COLORS}"'})
10515
           env.Program('foo.c')
10516
      </PRE
10517
><P
10518
>&#13;
10519
      A user can now specify a comma-separated list
10520
      of legal values,
10521
      which will get translated into a space-separated
10522
      list for passing to the any build commands:
10523
10524
      </P
10525
><PRE
10526
CLASS="screen"
10527
>&#13;        % <KBD
10528
CLASS="userinput"
10529
>scons -Q COLORS=red,blue foo.o</KBD
10530
>
10531
        cc -o foo.o -c -DCOLORS="red blue" foo.c
10532
        % <KBD
10533
CLASS="userinput"
10534
>scons -Q COLORS=blue,green,red foo.o</KBD
10535
>
10536
        cc -o foo.o -c -DCOLORS="blue green red" foo.c
10537
      </PRE
10538
><P
10539
>&#13;
10540
      In addition, the <CODE
10541
CLASS="function"
10542
>ListOption</CODE
10543
> function
10544
      allows the user to specify explicit keywords of
10545
      <TT
10546
CLASS="literal"
10547
>all</TT
10548
> or <TT
10549
CLASS="literal"
10550
>none</TT
10551
>
10552
      to select all of the legal values,
10553
      or none of them, respectively:
10554
10555
      </P
10556
><PRE
10557
CLASS="screen"
10558
>&#13;        % <KBD
10559
CLASS="userinput"
10560
>scons -Q COLORS=all foo.o</KBD
10561
>
10562
        cc -o foo.o -c -DCOLORS="red green blue" foo.c
10563
        % <KBD
10564
CLASS="userinput"
10565
>scons -Q COLORS=none foo.o</KBD
10566
>
10567
        cc -o foo.o -c -DCOLORS="" foo.c
10568
      </PRE
10569
><P
10570
>&#13;
10571
      And, of course, an illegal value
10572
      still generates an error message:
10573
10574
      </P
10575
><PRE
10576
CLASS="screen"
10577
>&#13;        % <KBD
10578
CLASS="userinput"
10579
>scons -Q COLORS=magenta foo.o</KBD
10580
>
10581
        
10582
        scons: *** Error converting option: COLORS
10583
        Invalid value(s) for option: magenta
10584
        File "/home/my/project/SConstruct", line 5, in &#60;module&#62;
10585
      </PRE
10586
></DIV
10587
><DIV
10588
CLASS="section"
10589
><HR><H3
10590
CLASS="section"
10591
><A
10592
NAME="AEN1849"
10593
>9.9.4. Path Names:  the <CODE
10594
CLASS="function"
10595
>PathOption</CODE
10596
> Build Option</A
10597
></H3
10598
><P
10599
>&#13;
10600
      <SPAN
10601
CLASS="application"
10602
>SCons</SPAN
10603
> supports a <CODE
10604
CLASS="function"
10605
>PathOption</CODE
10606
> function
10607
      to make it easy to create a build option
10608
      to control an expected path name.
10609
      If, for example, you need to
10610
      define a variable in the preprocessor
10611
      that controls the location of a
10612
      configuration file:
10613
10614
      </P
10615
><PRE
10616
CLASS="programlisting"
10617
>&#13;           opts = Options('custom.py')
10618
           opts.Add(PathOption('CONFIG',
10619
                               'Path to configuration file',
10620
                               '/etc/my_config'))
10621
           env = Environment(options = opts,
10622
                             CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'})
10623
           env.Program('foo.c')
10624
      </PRE
10625
><P
10626
>&#13;
10627
      This then allows the user to
10628
      override the <CODE
10629
CLASS="varname"
10630
>CONFIG</CODE
10631
> build option
10632
      on the command line as necessary:
10633
10634
      </P
10635
><PRE
10636
CLASS="screen"
10637
>&#13;        % <KBD
10638
CLASS="userinput"
10639
>scons -Q foo.o</KBD
10640
>
10641
        cc -o foo.o -c -DCONFIG_FILE="/etc/my_config" foo.c
10642
        % <KBD
10643
CLASS="userinput"
10644
>scons -Q CONFIG=/usr/local/etc/other_config foo.o</KBD
10645
>
10646
        scons: `foo.o' is up to date.
10647
      </PRE
10648
><P
10649
>&#13;
10650
      By default, <CODE
10651
CLASS="function"
10652
>PathOption</CODE
10653
> checks to make sure
10654
      that the specified path exists and generates an error if it
10655
      doesn't:
10656
10657
      </P
10658
><PRE
10659
CLASS="screen"
10660
>&#13;        % <KBD
10661
CLASS="userinput"
10662
>scons -Q CONFIG=/does/not/exist foo.o</KBD
10663
>
10664
        
10665
        scons: *** Path for option CONFIG does not exist: /does/not/exist
10666
        File "/home/my/project/SConstruct", line 6, in &#60;module&#62;
10667
      </PRE
10668
><P
10669
>&#13;
10670
      <CODE
10671
CLASS="function"
10672
>PathOption</CODE
10673
> provides a number of methods
10674
      that you can use to change this behavior.
10675
      If you want to ensure that any specified paths are,
10676
      in fact, files and not directories,
10677
      use the <CODE
10678
CLASS="function"
10679
>PathOption.PathIsFile</CODE
10680
> method:
10681
10682
      </P
10683
><PRE
10684
CLASS="programlisting"
10685
>&#13;           opts = Options('custom.py')
10686
           opts.Add(PathOption('CONFIG',
10687
                               'Path to configuration file',
10688
                               '/etc/my_config',
10689
                               PathOption.PathIsFile))
10690
           env = Environment(options = opts,
10691
                             CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'})
10692
           env.Program('foo.c')
10693
      </PRE
10694
><P
10695
>&#13;
10696
      Conversely, to ensure that any specified paths are
10697
      directories and not files,
10698
      use the <CODE
10699
CLASS="function"
10700
>PathOption.PathIsDir</CODE
10701
> method:
10702
10703
      </P
10704
><PRE
10705
CLASS="programlisting"
10706
>&#13;           opts = Options('custom.py')
10707
           opts.Add(PathOption('DBDIR',
10708
                               'Path to database directory',
10709
                               '/var/my_dbdir',
10710
                               PathOption.PathIsDir))
10711
           env = Environment(options = opts,
10712
                             CPPDEFINES={'DBDIR' : '"$DBDIR"'})
10713
           env.Program('foo.c')
10714
      </PRE
10715
><P
10716
>&#13;
10717
      If you want to make sure that any specified paths
10718
      are directories,
10719
      and you would like the directory created
10720
      if it doesn't already exist,
10721
      use the <CODE
10722
CLASS="function"
10723
>PathOption.PathIsDirCreate</CODE
10724
> method:
10725
10726
      </P
10727
><PRE
10728
CLASS="programlisting"
10729
>&#13;           opts = Options('custom.py')
10730
           opts.Add(PathOption('DBDIR',
10731
                               'Path to database directory',
10732
                               '/var/my_dbdir',
10733
                               PathOption.PathIsDirCreate))
10734
           env = Environment(options = opts,
10735
                             CPPDEFINES={'DBDIR' : '"$DBDIR"'})
10736
           env.Program('foo.c')
10737
      </PRE
10738
><P
10739
>&#13;
10740
      Lastly, if you don't care whether the path exists,
10741
      is a file, or a directory,
10742
      use the <CODE
10743
CLASS="function"
10744
>PathOption.PathAccept</CODE
10745
> method
10746
      to accept any path that the user supplies:
10747
10748
      </P
10749
><PRE
10750
CLASS="programlisting"
10751
>&#13;           opts = Options('custom.py')
10752
           opts.Add(PathOption('OUTPUT',
10753
                               'Path to output file or directory',
10754
                               None,
10755
                               PathOption.PathAccept))
10756
           env = Environment(options = opts,
10757
                             CPPDEFINES={'OUTPUT' : '"$OUTPUT"'})
10758
           env.Program('foo.c')
10759
      </PRE
10760
></DIV
10761
><DIV
10762
CLASS="section"
10763
><HR><H3
10764
CLASS="section"
10765
><A
10766
NAME="AEN1878"
10767
>9.9.5. Enabled/Disabled Path Names: the <CODE
10768
CLASS="function"
10769
>PackageOption</CODE
10770
> Build Option</A
10771
></H3
10772
><P
10773
>&#13;
10774
      Sometimes you want to give users
10775
      even more control over a path name variable,
10776
      allowing them to explicitly enable or
10777
      disable the path name
10778
      by using <TT
10779
CLASS="literal"
10780
>yes</TT
10781
> or <TT
10782
CLASS="literal"
10783
>no</TT
10784
> keywords,
10785
      in addition to allow them
10786
      to supply an explicit path name.
10787
      <SPAN
10788
CLASS="application"
10789
>SCons</SPAN
10790
> supports the <CODE
10791
CLASS="function"
10792
>PackageOption</CODE
10793
>
10794
      function to support this:
10795
10796
      </P
10797
><PRE
10798
CLASS="programlisting"
10799
>&#13;           opts = Options('custom.py')
10800
           opts.Add(PackageOption('PACKAGE',
10801
                                  'Location package',
10802
                                  '/opt/location'))
10803
           env = Environment(options = opts,
10804
                             CPPDEFINES={'PACKAGE' : '"$PACKAGE"'})
10805
           env.Program('foo.c')
10806
      </PRE
10807
><P
10808
>&#13;
10809
      When the <TT
10810
CLASS="filename"
10811
>SConscript</TT
10812
> file uses the <CODE
10813
CLASS="function"
10814
>PackageOption</CODE
10815
> funciton,
10816
      user can now still use the default
10817
      or supply an overriding path name,
10818
      but can now explicitly set the
10819
      specified variable to a value
10820
      that indicates the package should be enabled
10821
      (in which case the default should be used)
10822
      or disabled:
10823
10824
      </P
10825
><PRE
10826
CLASS="screen"
10827
>&#13;        % <KBD
10828
CLASS="userinput"
10829
>scons -Q foo.o</KBD
10830
>
10831
        cc -o foo.o -c -DPACKAGE="/opt/location" foo.c
10832
        % <KBD
10833
CLASS="userinput"
10834
>scons -Q PACKAGE=/usr/local/location foo.o</KBD
10835
>
10836
        cc -o foo.o -c -DPACKAGE="/usr/local/location" foo.c
10837
        % <KBD
10838
CLASS="userinput"
10839
>scons -Q PACKAGE=yes foo.o</KBD
10840
>
10841
        cc -o foo.o -c -DPACKAGE="True" foo.c
10842
        % <KBD
10843
CLASS="userinput"
10844
>scons -Q PACKAGE=no foo.o</KBD
10845
>
10846
        cc -o foo.o -c -DPACKAGE="False" foo.c
10847
      </PRE
10848
></DIV
10849
></DIV
10850
><DIV
10851
CLASS="section"
10852
><HR><H2
10853
CLASS="section"
10854
><A
10855
NAME="AEN1895"
10856
>9.10. Adding Multiple Command-Line Build Options at Once</A
10857
></H2
10858
><P
10859
>&#13;
10860
    Lastly, <SPAN
10861
CLASS="application"
10862
>SCons</SPAN
10863
> provides a way to add
10864
    multiple build options to an <CODE
10865
CLASS="function"
10866
>Options</CODE
10867
> object at once.
10868
    Instead of having to call the <CODE
10869
CLASS="function"
10870
>Add</CODE
10871
> method
10872
    multiple times,
10873
    you can call the <CODE
10874
CLASS="function"
10875
>AddOptions</CODE
10876
>
10877
    method with a list of build options
10878
    to be added to the object.
10879
    Each build option is specified
10880
    as either a tuple of arguments,
10881
    just like you'd pass to the <CODE
10882
CLASS="function"
10883
>Add</CODE
10884
> method itself,
10885
    or as a call to one of the canned
10886
    functions for pre-packaged command-line build options.
10887
    in any order:
10888
10889
    </P
10890
><PRE
10891
CLASS="programlisting"
10892
>&#13;        opts = Options()
10893
        opts.AddOptions(
10894
            ('RELEASE', 'Set to 1 to build for release', 0),
10895
            ('CONFIG', 'Configuration file', '/etc/my_config'),
10896
            BoolOption('warnings', 'compilation with -Wall and similiar', 1),
10897
            EnumOption('debug', 'debug output and symbols', 'no',
10898
                       allowed_values=('yes', 'no', 'full'),
10899
                       map={}, ignorecase=0),  # case sensitive
10900
            ListOption('shared',
10901
                       'libraries to build as shared libraries',
10902
                       'all',
10903
                       names = list_of_libs),
10904
            PackageOption('x11',
10905
                          'use X11 installed here (yes = search some places)',
10906
                          'yes'),
10907
            PathOption('qtdir', 'where the root of Qt is installed', qtdir),
10908
        )
10909
    </PRE
10910
><P
10911
>&#13;    </P
10912
></DIV
10913
></DIV
10914
><DIV
10915
CLASS="chapter"
10916
><HR><H1
10917
><A
10918
NAME="chap-help"
10919
></A
10920
>Chapter 10. Providing Build Help:  the <CODE
10921
CLASS="function"
10922
>Help</CODE
10923
> Function</H1
10924
><P
10925
>&#13;
10926
   It's often very useful to be able to give
10927
   users some help that describes the
10928
   specific targets, build options, etc.,
10929
   that can be used for your build.
10930
   <SPAN
10931
CLASS="application"
10932
>SCons</SPAN
10933
> provides the <CODE
10934
CLASS="function"
10935
>Help</CODE
10936
> function
10937
   to allow you to specify this help text:
10938
10939
   </P
10940
><PRE
10941
CLASS="programlisting"
10942
>&#13;      Help("""
10943
      Type: 'scons program' to build the production program,
10944
            'scons debug' to build the debug version.
10945
      """)
10946
   </PRE
10947
><P
10948
>&#13;
10949
   (Note the above use of the Python triple-quote syntax,
10950
   which comes in very handy for
10951
   specifying multi-line strings like help text.)
10952
10953
   </P
10954
><P
10955
>&#13;
10956
   When the <TT
10957
CLASS="filename"
10958
>SConstruct</TT
10959
> or <TT
10960
CLASS="filename"
10961
>SConscript</TT
10962
> files
10963
   contain such a call to the <CODE
10964
CLASS="function"
10965
>Help</CODE
10966
> function,
10967
   the specified help text will be displayed in response to
10968
   the <SPAN
10969
CLASS="application"
10970
>SCons</SPAN
10971
> <TT
10972
CLASS="literal"
10973
>-h</TT
10974
> option:
10975
10976
   </P
10977
><PRE
10978
CLASS="screen"
10979
>&#13;      % <KBD
10980
CLASS="userinput"
10981
>scons -h</KBD
10982
>
10983
      scons: Reading SConscript files ...
10984
      scons: done reading SConscript files.
10985
      
10986
      Type: 'scons program' to build the production program,
10987
            'scons debug' to build the debug version.
10988
      
10989
      Use scons -H for help about command-line options.
10990
   </PRE
10991
><P
10992
>&#13;
10993
   The <TT
10994
CLASS="filename"
10995
>SConscript</TT
10996
> files may contain
10997
   multiple calls to the <CODE
10998
CLASS="function"
10999
>Help</CODE
11000
> function,
11001
   in which case the specified text(s)
11002
   will be concatenated when displayed.
11003
   This allows you to split up the
11004
   help text across multiple <TT
11005
CLASS="filename"
11006
>SConscript</TT
11007
> files.
11008
   In this situation, the order in
11009
   which the <TT
11010
CLASS="filename"
11011
>SConscript</TT
11012
> files are called
11013
   will determine the order in which the <CODE
11014
CLASS="function"
11015
>Help</CODE
11016
> functions are called,
11017
   which will determine the order in which
11018
   the various bits of text will get concatenated.
11019
11020
   </P
11021
><P
11022
>&#13;
11023
   Another use would be to make the help text conditional
11024
   on some variable.
11025
   For example, suppose you only want to display
11026
   a line about building a Windows-only
11027
   version of a program when actually
11028
   run on Windows.
11029
   The following <TT
11030
CLASS="filename"
11031
>SConstruct</TT
11032
> file:
11033
11034
   </P
11035
><PRE
11036
CLASS="programlisting"
11037
>&#13;      env = Environment()
11038
11039
      Help("\nType: 'scons program' to build the production program.\n")
11040
11041
      if env['PLATFORM'] == 'win32':
11042
          Help("\nType: 'scons windebug' to build the Windows debug version.\n")
11043
   </PRE
11044
><P
11045
>&#13;
11046
   Will display the complete help text on Windows:
11047
11048
   </P
11049
><PRE
11050
CLASS="screen"
11051
>&#13;      C:\&#62;<KBD
11052
CLASS="userinput"
11053
>scons -h</KBD
11054
>
11055
      scons: Reading SConscript files ...
11056
      scons: done reading SConscript files.
11057
      
11058
      Type: 'scons program' to build the production program.
11059
      
11060
      Type: 'scons windebug' to build the Windows debug version.
11061
      
11062
      Use scons -H for help about command-line options.
11063
   </PRE
11064
><P
11065
>&#13;
11066
   But only show the relevant option on a Linux or UNIX system:
11067
11068
   </P
11069
><PRE
11070
CLASS="screen"
11071
>&#13;      % <KBD
11072
CLASS="userinput"
11073
>scons -h</KBD
11074
>
11075
      scons: Reading SConscript files ...
11076
      scons: done reading SConscript files.
11077
      
11078
      Type: 'scons program' to build the production program.
11079
      
11080
      Use scons -H for help about command-line options.
11081
   </PRE
11082
><P
11083
>&#13;
11084
   If there is no <CODE
11085
CLASS="function"
11086
>Help</CODE
11087
> text in the <TT
11088
CLASS="filename"
11089
>SConstruct</TT
11090
> or
11091
   <TT
11092
CLASS="filename"
11093
>SConscript</TT
11094
> files,
11095
   <SPAN
11096
CLASS="application"
11097
>SCons</SPAN
11098
> will revert to displaying its
11099
   standard list that describes the <SPAN
11100
CLASS="application"
11101
>SCons</SPAN
11102
> command-line
11103
   options.
11104
   This list is also always displayed whenever
11105
   the <TT
11106
CLASS="literal"
11107
>-H</TT
11108
> option is used.
11109
11110
   </P
11111
></DIV
11112
><DIV
11113
CLASS="chapter"
11114
><HR><H1
11115
><A
11116
NAME="chap-install"
11117
></A
11118
>Chapter 11. Installing Files in Other Directories:  the <CODE
11119
CLASS="function"
11120
>Install</CODE
11121
> Builder</H1
11122
><P
11123
>&#13;
11124
  Once a program is built,
11125
  it is often appropriate to install it in another
11126
  directory for public use.
11127
  You use the <CODE
11128
CLASS="function"
11129
>Install</CODE
11130
> method 
11131
  to arrange for a program, or any other file,
11132
  to be copied into a destination directory:
11133
11134
  </P
11135
><PRE
11136
CLASS="programlisting"
11137
>&#13;     env = Environment()
11138
     hello = env.Program('hello.c')
11139
     env.Install('/usr/bin', hello)
11140
  </PRE
11141
><P
11142
>&#13;
11143
  Note, however, that installing a file is
11144
  still considered a type of file "build."
11145
  This is important when you remember that
11146
  the default behavior of <SPAN
11147
CLASS="application"
11148
>SCons</SPAN
11149
> is
11150
  to build files in or below the current directory.
11151
  If, as in the example above,
11152
  you are installing files in a directory
11153
  outside of the top-level <TT
11154
CLASS="filename"
11155
>SConstruct</TT
11156
> file's directory tree,
11157
  you must specify that directory
11158
  (or a higher directory, such as <TT
11159
CLASS="literal"
11160
>/</TT
11161
>)
11162
  for it to install anything there:
11163
11164
  </P
11165
><PRE
11166
CLASS="screen"
11167
>&#13;     % <KBD
11168
CLASS="userinput"
11169
>scons -Q</KBD
11170
>
11171
     cc -o hello.o -c hello.c
11172
     cc -o hello hello.o
11173
     % <KBD
11174
CLASS="userinput"
11175
>scons -Q /usr/bin</KBD
11176
>
11177
     Install file: "hello" as "/usr/bin/hello"
11178
  </PRE
11179
><P
11180
>&#13;
11181
  It can, however, be cumbersome to remember
11182
  (and type) the specific destination directory
11183
  in which the program (or any other file)
11184
  should be installed.
11185
  This is an area where the <CODE
11186
CLASS="function"
11187
>Alias</CODE
11188
>
11189
  function comes in handy,
11190
  allowing you, for example,
11191
  to create a pseudo-target named <TT
11192
CLASS="literal"
11193
>install</TT
11194
>
11195
  that can expand to the specified destination directory:
11196
11197
  </P
11198
><PRE
11199
CLASS="programlisting"
11200
>&#13;     env = Environment()
11201
     hello = env.Program('hello.c')
11202
     env.Install('/usr/bin', hello)
11203
     env.Alias('install', '/usr/bin')
11204
  </PRE
11205
><P
11206
>&#13;
11207
  This then yields the more natural
11208
  ability to install the program
11209
  in its destination as follows:
11210
11211
  </P
11212
><PRE
11213
CLASS="screen"
11214
>&#13;     % <KBD
11215
CLASS="userinput"
11216
>scons -Q</KBD
11217
>
11218
     cc -o hello.o -c hello.c
11219
     cc -o hello hello.o
11220
     % <KBD
11221
CLASS="userinput"
11222
>scons -Q install</KBD
11223
>
11224
     Install file: "hello" as "/usr/bin/hello"
11225
  </PRE
11226
><DIV
11227
CLASS="section"
11228
><HR><H2
11229
CLASS="section"
11230
><A
11231
NAME="AEN1964"
11232
>11.1. Installing Multiple Files in a Directory</A
11233
></H2
11234
><P
11235
>&#13;
11236
    You can install multiple files into a directory
11237
    simply by calling the <CODE
11238
CLASS="function"
11239
>Install</CODE
11240
> function multiple times:
11241
11242
    </P
11243
><PRE
11244
CLASS="programlisting"
11245
>&#13;       env = Environment()
11246
       hello = env.Program('hello.c')
11247
       goodbye = env.Program('goodbye.c')
11248
       env.Install('/usr/bin', hello)
11249
       env.Install('/usr/bin', goodbye)
11250
       env.Alias('install', '/usr/bin')
11251
    </PRE
11252
><P
11253
>&#13;
11254
    Or, more succinctly, listing the multiple input
11255
    files in a list
11256
    (just like you can do with any other builder):
11257
11258
    </P
11259
><PRE
11260
CLASS="programlisting"
11261
>&#13;       env = Environment()
11262
       hello = env.Program('hello.c')
11263
       goodbye = env.Program('goodbye.c')
11264
       env.Install('/usr/bin', [hello, goodbye])
11265
       env.Alias('install', '/usr/bin')
11266
    </PRE
11267
><P
11268
>&#13;
11269
    Either of these two examples yields:
11270
11271
    </P
11272
><PRE
11273
CLASS="screen"
11274
>&#13;       % <KBD
11275
CLASS="userinput"
11276
>scons -Q install</KBD
11277
>
11278
       cc -o goodbye.o -c goodbye.c
11279
       cc -o goodbye goodbye.o
11280
       Install file: "goodbye" as "/usr/bin/goodbye"
11281
       cc -o hello.o -c hello.c
11282
       cc -o hello hello.o
11283
       Install file: "hello" as "/usr/bin/hello"
11284
    </PRE
11285
></DIV
11286
><DIV
11287
CLASS="section"
11288
><HR><H2
11289
CLASS="section"
11290
><A
11291
NAME="AEN1974"
11292
>11.2. Installing a File Under a Different Name</A
11293
></H2
11294
><P
11295
>&#13;
11296
    The <CODE
11297
CLASS="function"
11298
>Install</CODE
11299
> method preserves the name
11300
    of the file when it is copied into the
11301
    destination directory.
11302
    If you need to change the name of the file
11303
    when you copy it, use the <CODE
11304
CLASS="function"
11305
>InstallAs</CODE
11306
> function:
11307
11308
    </P
11309
><PRE
11310
CLASS="programlisting"
11311
>&#13;       env = Environment()
11312
       hello = env.Program('hello.c')
11313
       env.InstallAs('/usr/bin/hello-new', hello)
11314
       env.Alias('install', '/usr/bin')
11315
    </PRE
11316
><P
11317
>&#13;
11318
    This installs the <TT
11319
CLASS="literal"
11320
>hello</TT
11321
>
11322
    program with the name <TT
11323
CLASS="literal"
11324
>hello-new</TT
11325
>
11326
    as follows:
11327
11328
    </P
11329
><PRE
11330
CLASS="screen"
11331
>&#13;       % <KBD
11332
CLASS="userinput"
11333
>scons -Q install</KBD
11334
>
11335
       cc -o hello.o -c hello.c
11336
       cc -o hello hello.o
11337
       Install file: "hello" as "/usr/bin/hello-new"
11338
    </PRE
11339
></DIV
11340
><DIV
11341
CLASS="section"
11342
><HR><H2
11343
CLASS="section"
11344
><A
11345
NAME="AEN1985"
11346
>11.3. Installing Multiple Files Under Different Names</A
11347
></H2
11348
><P
11349
>&#13;
11350
    Lastly, if you have multiple files that all
11351
    need to be installed with different file names,
11352
    you can either call the <CODE
11353
CLASS="function"
11354
>InstallAs</CODE
11355
> function
11356
    multiple times, or as a shorthand,
11357
    you can supply same-length lists
11358
    for both the target and source arguments:
11359
11360
    </P
11361
><PRE
11362
CLASS="programlisting"
11363
>&#13;       env = Environment()
11364
       hello = env.Program('hello.c')
11365
       goodbye = env.Program('goodbye.c')
11366
       env.InstallAs(['/usr/bin/hello-new',
11367
                      '/usr/bin/goodbye-new'],
11368
                     [hello, goodbye])
11369
       env.Alias('install', '/usr/bin')
11370
    </PRE
11371
><P
11372
>&#13;
11373
    In this case, the <CODE
11374
CLASS="function"
11375
>InstallAs</CODE
11376
> function
11377
    loops through both lists simultaneously,
11378
    and copies each source file into its corresponding
11379
    target file name:
11380
11381
    </P
11382
><PRE
11383
CLASS="screen"
11384
>&#13;       % <KBD
11385
CLASS="userinput"
11386
>scons -Q install</KBD
11387
>
11388
       cc -o goodbye.o -c goodbye.c
11389
       cc -o goodbye goodbye.o
11390
       Install file: "goodbye" as "/usr/bin/goodbye-new"
11391
       cc -o hello.o -c hello.c
11392
       cc -o hello hello.o
11393
       Install file: "hello" as "/usr/bin/hello-new"
11394
    </PRE
11395
></DIV
11396
></DIV
11397
><DIV
11398
CLASS="chapter"
11399
><HR><H1
11400
><A
11401
NAME="chap-factories"
11402
></A
11403
>Chapter 12. Platform-Independent File System Manipulation</H1
11404
><P
11405
>&#13;
11406
  <SPAN
11407
CLASS="application"
11408
>SCons</SPAN
11409
> provides a number of platform-independent functions,
11410
  called <TT
11411
CLASS="literal"
11412
>factories</TT
11413
>,
11414
  that perform common file system manipulations
11415
  like copying, moving or deleting files and directories,
11416
  or making directories.
11417
  These functions are <TT
11418
CLASS="literal"
11419
>factories</TT
11420
>
11421
  because they don't perform the action
11422
  at the time they're called,
11423
  they each return an <CODE
11424
CLASS="classname"
11425
>Action</CODE
11426
> object
11427
  that can be executed at the appropriate time.
11428
11429
  </P
11430
><DIV
11431
CLASS="section"
11432
><HR><H2
11433
CLASS="section"
11434
><A
11435
NAME="AEN2001"
11436
>12.1. Copying Files or Directories:  The <CODE
11437
CLASS="function"
11438
>Copy</CODE
11439
> Factory</A
11440
></H2
11441
><P
11442
>&#13;
11443
    Suppose you want to arrange to make a copy of a file,
11444
    and the <CODE
11445
CLASS="function"
11446
>Install</CODE
11447
> builder isn't appropriate
11448
    because it may make a hard link on POSIX systems.
11449
    One way would be to use the <CODE
11450
CLASS="function"
11451
>Copy</CODE
11452
> action factory
11453
    in conjunction with the <CODE
11454
CLASS="function"
11455
>Command</CODE
11456
> builder:
11457
11458
    </P
11459
><PRE
11460
CLASS="programlisting"
11461
>&#13;        Command("file.out", "file.in", Copy("$TARGET", "$SOURCE"))
11462
    </PRE
11463
><P
11464
>&#13;
11465
    Notice that the action returned by the <CODE
11466
CLASS="function"
11467
>Copy</CODE
11468
> factory
11469
    will expand the <A
11470
HREF="#cv-TARGET"
11471
><CODE
11472
CLASS="envar"
11473
>$TARGET</CODE
11474
></A
11475
> and <A
11476
HREF="#cv-SOURCE"
11477
><CODE
11478
CLASS="envar"
11479
>$SOURCE</CODE
11480
></A
11481
> strings
11482
    at the time <TT
11483
CLASS="filename"
11484
>file.out</TT
11485
> is built,
11486
    and that the order of the arguments
11487
    is the same as that of a builder itself--that is,
11488
    target first, followed by source:
11489
11490
    </P
11491
><PRE
11492
CLASS="screen"
11493
>&#13;       % <KBD
11494
CLASS="userinput"
11495
>scons -Q</KBD
11496
>
11497
       Copy("file.out", "file.in")
11498
    </PRE
11499
><P
11500
>&#13;
11501
    You can, of course, name a file explicitly
11502
    instead of using <CODE
11503
CLASS="envar"
11504
>$TARGET</CODE
11505
> or <CODE
11506
CLASS="envar"
11507
>$SOURCE</CODE
11508
>:
11509
11510
    </P
11511
><PRE
11512
CLASS="programlisting"
11513
>&#13;      Command("file.out", [], Copy("$TARGET", "file.in"))
11514
    </PRE
11515
><P
11516
>&#13;
11517
    Which executes as:
11518
11519
    </P
11520
><PRE
11521
CLASS="screen"
11522
>&#13;      % <KBD
11523
CLASS="userinput"
11524
>scons -Q</KBD
11525
>
11526
      Copy("file.out", "file.in")
11527
    </PRE
11528
><P
11529
>&#13;
11530
    The usefulness of the <CODE
11531
CLASS="function"
11532
>Copy</CODE
11533
> factory
11534
    becomes more apparent when
11535
    you use it in a list of actions
11536
    passed to the <CODE
11537
CLASS="function"
11538
>Command</CODE
11539
> builder.
11540
    For example, suppose you needed to run a
11541
    file through a utility that only modifies files in-place,
11542
    and can't "pipe" input to output.
11543
    One solution is to copy the source file
11544
    to a temporary file name,
11545
    run the utility,
11546
    and then copy the modified temporary file to the target,
11547
    which the <CODE
11548
CLASS="function"
11549
>Copy</CODE
11550
> factory makes extremely easy:
11551
11552
    </P
11553
><PRE
11554
CLASS="programlisting"
11555
>&#13;      Command("file.out", "file.in",
11556
              [
11557
                Copy("tempfile", "$SOURCE"),
11558
                "modify tempfile",
11559
                Copy("$TARGET", "tempfile"),
11560
              ])
11561
    </PRE
11562
><P
11563
>&#13;
11564
    The output then looks like:
11565
11566
    </P
11567
><PRE
11568
CLASS="screen"
11569
>&#13;      % <KBD
11570
CLASS="userinput"
11571
>scons -Q</KBD
11572
>
11573
      Copy("tempfile", "file.in")
11574
      modify tempfile
11575
      Copy("file.out", "tempfile")
11576
    </PRE
11577
></DIV
11578
><DIV
11579
CLASS="section"
11580
><HR><H2
11581
CLASS="section"
11582
><A
11583
NAME="AEN2033"
11584
>12.2. Deleting Files or Directories:  The <CODE
11585
CLASS="function"
11586
>Delete</CODE
11587
> Factory</A
11588
></H2
11589
><P
11590
>&#13;
11591
    If you need to delete a file,
11592
    then the <CODE
11593
CLASS="function"
11594
>Delete</CODE
11595
> factory
11596
    can be used in much the same way as
11597
    the <CODE
11598
CLASS="function"
11599
>Copy</CODE
11600
> factory.
11601
    For example, if we want to make sure that
11602
    the temporary file
11603
    in our last example doesn't exist before
11604
    we copy to it,
11605
    we could add <CODE
11606
CLASS="function"
11607
>Delete</CODE
11608
> to the beginning
11609
    of the command list:
11610
11611
    </P
11612
><PRE
11613
CLASS="programlisting"
11614
>&#13;      Command("file.out", "file.in",
11615
              [
11616
                Delete("tempfile"),
11617
                Copy("tempfile", "$SOURCE"),
11618
                "modify tempfile",
11619
                Copy("$TARGET", "tempfile"),
11620
              ])
11621
    </PRE
11622
><P
11623
>&#13;
11624
    When then executes as follows:
11625
11626
    </P
11627
><PRE
11628
CLASS="screen"
11629
>&#13;      % <KBD
11630
CLASS="userinput"
11631
>scons -Q</KBD
11632
>
11633
      Delete("tempfile")
11634
      Copy("tempfile", "file.in")
11635
      modify tempfile
11636
      Copy("file.out", "tempfile")
11637
    </PRE
11638
><P
11639
>&#13;
11640
    Of course, like all of these <CODE
11641
CLASS="classname"
11642
>Action</CODE
11643
> factories,
11644
    the <CODE
11645
CLASS="function"
11646
>Delete</CODE
11647
> factory also expands
11648
    <A
11649
HREF="#cv-TARGET"
11650
><CODE
11651
CLASS="envar"
11652
>$TARGET</CODE
11653
></A
11654
> and <A
11655
HREF="#cv-SOURCE"
11656
><CODE
11657
CLASS="envar"
11658
>$SOURCE</CODE
11659
></A
11660
> variables appropriately.
11661
    For example:
11662
11663
    </P
11664
><PRE
11665
CLASS="programlisting"
11666
>&#13;      Command("file.out", "file.in",
11667
              [
11668
                Delete("$TARGET"),
11669
                Copy("$TARGET", "$SOURCE")
11670
              ])
11671
    </PRE
11672
><P
11673
>&#13;
11674
    Executes as:
11675
11676
    </P
11677
><PRE
11678
CLASS="screen"
11679
>&#13;      % <KBD
11680
CLASS="userinput"
11681
>scons -Q</KBD
11682
>
11683
      Delete("file.out")
11684
      Copy("file.out", "file.in")
11685
    </PRE
11686
><P
11687
>&#13;
11688
    (Note, however, that you typically don't need to
11689
    call the <CODE
11690
CLASS="function"
11691
>Delete</CODE
11692
> factory explicitly in this way;
11693
    by default, <SPAN
11694
CLASS="application"
11695
>SCons</SPAN
11696
> deletes its target(s)
11697
    for you before executing any action.
11698
11699
    </P
11700
></DIV
11701
><DIV
11702
CLASS="section"
11703
><HR><H2
11704
CLASS="section"
11705
><A
11706
NAME="AEN2058"
11707
>12.3. Moving (Renaming) Files or Directories:  The <CODE
11708
CLASS="function"
11709
>Move</CODE
11710
> Factory</A
11711
></H2
11712
><P
11713
>&#13;
11714
    The <CODE
11715
CLASS="function"
11716
>Move</CODE
11717
> factory
11718
    allows you to rename a file or directory.
11719
    For example, if we don't want to copy the temporary file,
11720
    we could use:
11721
11722
    </P
11723
><PRE
11724
CLASS="programlisting"
11725
>&#13;      Command("file.out", "file.in",
11726
              [
11727
                Copy("tempfile", "$SOURCE"),
11728
                "modify tempfile",
11729
                Move("$TARGET", "tempfile"),
11730
              ])
11731
    </PRE
11732
><P
11733
>&#13;
11734
    Which would execute as:
11735
11736
    </P
11737
><PRE
11738
CLASS="screen"
11739
>&#13;      % <KBD
11740
CLASS="userinput"
11741
>scons -Q</KBD
11742
>
11743
      Copy("tempfile", "file.in")
11744
      modify tempfile
11745
      Move("file.out", "tempfile")
11746
    </PRE
11747
></DIV
11748
><DIV
11749
CLASS="section"
11750
><HR><H2
11751
CLASS="section"
11752
><A
11753
NAME="AEN2067"
11754
>12.4. Updating the Modification Time of a File:  The <CODE
11755
CLASS="function"
11756
>Touch</CODE
11757
> Factory</A
11758
></H2
11759
><P
11760
>&#13;
11761
    If you just need to update the
11762
    recorded modification time for a file,
11763
    use the <CODE
11764
CLASS="function"
11765
>Touch</CODE
11766
> factory:
11767
11768
    </P
11769
><PRE
11770
CLASS="programlisting"
11771
>&#13;      Command("file.out", "file.in",
11772
              [
11773
                Copy("$TARGET", "$SOURCE"),
11774
                Touch("$TARGET"),
11775
              ])
11776
    </PRE
11777
><P
11778
>&#13;
11779
    Which executes as:
11780
11781
    </P
11782
><PRE
11783
CLASS="screen"
11784
>&#13;      % <KBD
11785
CLASS="userinput"
11786
>scons -Q</KBD
11787
>
11788
      Copy("file.out", "file.in")
11789
      Touch("file.out")
11790
    </PRE
11791
></DIV
11792
><DIV
11793
CLASS="section"
11794
><HR><H2
11795
CLASS="section"
11796
><A
11797
NAME="AEN2076"
11798
>12.5. Creating a Directory:  The <CODE
11799
CLASS="function"
11800
>Mkdir</CODE
11801
> Factory</A
11802
></H2
11803
><P
11804
>&#13;
11805
    If you need to create a directory,
11806
    use the <CODE
11807
CLASS="function"
11808
>Mkdir</CODE
11809
> factory.
11810
    For example, if we need to process
11811
    a file in a temporary directory
11812
    in which the processing tool
11813
    will create other files that we don't care about, 
11814
    you could use:
11815
11816
    </P
11817
><PRE
11818
CLASS="programlisting"
11819
>&#13;      Command("file.out", "file.in",
11820
              [
11821
                Delete("tempdir"),
11822
                Mkdir("tempdir"),
11823
                Copy("tempdir/${SOURCE.file}", "$SOURCE"),
11824
                "process tempdir",
11825
                Move("$TARGET", "tempdir/output_file"),
11826
                Delete("tempdir"),
11827
              ])
11828
    </PRE
11829
><P
11830
>&#13;
11831
    Which executes as:
11832
11833
    </P
11834
><PRE
11835
CLASS="screen"
11836
>&#13;      % <KBD
11837
CLASS="userinput"
11838
>scons -Q</KBD
11839
>
11840
      Delete("tempdir")
11841
      Mkdir("tempdir")
11842
      Copy("tempdir/file.in", "file.in")
11843
      process tempdir
11844
      Move("file.out", "tempdir/output_file")
11845
      scons: *** [file.out] No such file or directory
11846
    </PRE
11847
></DIV
11848
><DIV
11849
CLASS="section"
11850
><HR><H2
11851
CLASS="section"
11852
><A
11853
NAME="AEN2085"
11854
>12.6. Changing File or Directory Permissions:  The <CODE
11855
CLASS="function"
11856
>Chmod</CODE
11857
> Factory</A
11858
></H2
11859
><P
11860
>&#13;
11861
    To change permissions on a file or directory,
11862
    use the <CODE
11863
CLASS="function"
11864
>Chmod</CODE
11865
> factory.
11866
    The permission argument uses POSIX-style
11867
    permission bits and should typically
11868
    be expressed as an octal,
11869
    not decimal, number:
11870
11871
    </P
11872
><PRE
11873
CLASS="programlisting"
11874
>&#13;      Command("file.out", "file.in",
11875
              [
11876
                Copy("$TARGET", "$SOURCE"),
11877
                Chmod("$TARGET", 0755),
11878
              ])
11879
    </PRE
11880
><P
11881
>&#13;
11882
    Which executes:
11883
11884
    </P
11885
><PRE
11886
CLASS="screen"
11887
>&#13;      % <KBD
11888
CLASS="userinput"
11889
>scons -Q</KBD
11890
>
11891
      Copy("file.out", "file.in")
11892
      Chmod("file.out", 0755)
11893
    </PRE
11894
></DIV
11895
><DIV
11896
CLASS="section"
11897
><HR><H2
11898
CLASS="section"
11899
><A
11900
NAME="AEN2094"
11901
>12.7. Executing an action immediately:  the <CODE
11902
CLASS="function"
11903
>Execute</CODE
11904
> Function</A
11905
></H2
11906
><P
11907
>&#13;
11908
    We've been showing you how to use <CODE
11909
CLASS="classname"
11910
>Action</CODE
11911
> factories
11912
    in the <CODE
11913
CLASS="function"
11914
>Command</CODE
11915
> function.
11916
    You can also execute an <CODE
11917
CLASS="classname"
11918
>Action</CODE
11919
> returned by a factory
11920
    (or actually, any <CODE
11921
CLASS="classname"
11922
>Action</CODE
11923
>)
11924
    at the time the <TT
11925
CLASS="filename"
11926
>SConscript</TT
11927
> file is read
11928
    by wrapping it up in the <CODE
11929
CLASS="function"
11930
>Execute</CODE
11931
> function.
11932
    For example, if we need to make sure that
11933
    a directory exists before we build any targets,
11934
11935
11936
    </P
11937
><PRE
11938
CLASS="programlisting"
11939
>&#13;      Execute(Mkdir('/tmp/my_temp_directory'))
11940
    </PRE
11941
><P
11942
>&#13;
11943
    Notice that this will
11944
    create the directory while
11945
    the <TT
11946
CLASS="filename"
11947
>SConscript</TT
11948
> file is being read:
11949
11950
    </P
11951
><PRE
11952
CLASS="screen"
11953
>&#13;      % <KBD
11954
CLASS="userinput"
11955
>scons</KBD
11956
>
11957
      scons: Reading SConscript files ...
11958
      Mkdir("/tmp/my_temp_directory")
11959
      scons: done reading SConscript files.
11960
      scons: Building targets ...
11961
      scons: `.' is up to date.
11962
      scons: done building targets.
11963
    </PRE
11964
><P
11965
>&#13;
11966
    If you're familiar with Python,
11967
    you may wonder why you would want to use this
11968
    instead of just calling the native Python
11969
    <CODE
11970
CLASS="function"
11971
>os.mkdir()</CODE
11972
> function.
11973
    The advantage here is that the <CODE
11974
CLASS="function"
11975
>Mkdir</CODE
11976
>
11977
    action will behave appropriately if the user
11978
    specifies the <SPAN
11979
CLASS="application"
11980
>SCons</SPAN
11981
> <CODE
11982
CLASS="option"
11983
>-n</CODE
11984
> or
11985
    <CODE
11986
CLASS="option"
11987
>-q</CODE
11988
> options--that is,
11989
    it will print the action but not actually
11990
    make the directory when <CODE
11991
CLASS="option"
11992
>-n</CODE
11993
> is specified,
11994
    or make the directory but not print the action
11995
    when <CODE
11996
CLASS="option"
11997
>-q</CODE
11998
> is specified.
11999
12000
    </P
12001
></DIV
12002
></DIV
12003
><DIV
12004
CLASS="chapter"
12005
><HR><H1
12006
><A
12007
NAME="chap-file-removal"
12008
></A
12009
>Chapter 13. Preventing Removal of Targets</H1
12010
><P
12011
>&#13;
12012
  There are two occasions when <SPAN
12013
CLASS="application"
12014
>SCons</SPAN
12015
> will,
12016
  by default, remove target files.
12017
  The first is when <SPAN
12018
CLASS="application"
12019
>SCons</SPAN
12020
> determines that
12021
  an target file needs to be rebuilt
12022
  and removes the existing version of the target
12023
  before executing
12024
  The second is when <SPAN
12025
CLASS="application"
12026
>SCons</SPAN
12027
> is invoked with the
12028
  <TT
12029
CLASS="literal"
12030
>-c</TT
12031
> option to "clean"
12032
  a tree of its built targets.
12033
12034
  These behaviours can be suppressed with the
12035
  <CODE
12036
CLASS="function"
12037
>Precious</CODE
12038
> and <CODE
12039
CLASS="function"
12040
>NoClean</CODE
12041
> functions, respectively.
12042
12043
  </P
12044
><DIV
12045
CLASS="section"
12046
><HR><H2
12047
CLASS="section"
12048
><A
12049
NAME="AEN2126"
12050
>13.1. Preventing target removal during build: the <CODE
12051
CLASS="function"
12052
>Precious</CODE
12053
> Function</A
12054
></H2
12055
><P
12056
>&#13;
12057
    By default, <SPAN
12058
CLASS="application"
12059
>SCons</SPAN
12060
> removes targets before building them.
12061
    Sometimes, however, this is not what you want.
12062
    For example, you may want to update a library incrementally,
12063
    not by having it deleted and then rebuilt from all
12064
    of the constituent object files.
12065
    In such cases, you can use the
12066
    <CODE
12067
CLASS="function"
12068
>Precious</CODE
12069
> method to prevent
12070
    <SPAN
12071
CLASS="application"
12072
>SCons</SPAN
12073
> from removing the target before it is built:
12074
12075
    </P
12076
><PRE
12077
CLASS="programlisting"
12078
>&#13;        env = Environment(RANLIBCOM='')
12079
        lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
12080
        env.Precious(lib)
12081
    </PRE
12082
><P
12083
>&#13;
12084
    Although the output doesn't look any different,
12085
    <SPAN
12086
CLASS="application"
12087
>SCons</SPAN
12088
> does not, in fact,
12089
    delete the target library before rebuilding it:
12090
12091
    </P
12092
><PRE
12093
CLASS="screen"
12094
>&#13;        % <KBD
12095
CLASS="userinput"
12096
>scons -Q</KBD
12097
>
12098
        cc -o f1.o -c f1.c
12099
        cc -o f2.o -c f2.c
12100
        cc -o f3.o -c f3.c
12101
        ar rc libfoo.a f1.o f2.o f3.o
12102
    </PRE
12103
><P
12104
>&#13;
12105
    <SPAN
12106
CLASS="application"
12107
>SCons</SPAN
12108
> will, however, still delete files marked as <CODE
12109
CLASS="function"
12110
>Precious</CODE
12111
>
12112
    when the <TT
12113
CLASS="literal"
12114
>-c</TT
12115
> option is used.
12116
12117
    </P
12118
></DIV
12119
><DIV
12120
CLASS="section"
12121
><HR><H2
12122
CLASS="section"
12123
><A
12124
NAME="AEN2142"
12125
>13.2. Preventing target removal during clean: the <CODE
12126
CLASS="function"
12127
>NoClean</CODE
12128
> Function</A
12129
></H2
12130
><P
12131
>&#13;
12132
    By default, <SPAN
12133
CLASS="application"
12134
>SCons</SPAN
12135
> removes all built targets when invoked
12136
    with the <TT
12137
CLASS="literal"
12138
>-c</TT
12139
> option to clean a source tree
12140
    of built targets.
12141
    Sometimes, however, this is not what you want.
12142
    For example, you may want to remove only intermediate generated files
12143
    (such as object files),
12144
    but leave the final targets
12145
    (the libraries)
12146
    untouched.
12147
12148
    In such cases, you can use the <CODE
12149
CLASS="function"
12150
>NoClean</CODE
12151
> method to prevent <SPAN
12152
CLASS="application"
12153
>SCons</SPAN
12154
>
12155
    from removing a target during a clean:
12156
12157
    </P
12158
><PRE
12159
CLASS="programlisting"
12160
>&#13;        env = Environment(RANLIBCOM='')
12161
        lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
12162
        env.NoClean(lib)
12163
    </PRE
12164
><P
12165
>&#13;
12166
    Notice that the <TT
12167
CLASS="filename"
12168
>libfoo.a</TT
12169
>
12170
    is not listed as a removed file:
12171
12172
    </P
12173
><PRE
12174
CLASS="screen"
12175
>&#13;        % <KBD
12176
CLASS="userinput"
12177
>scons -Q</KBD
12178
>
12179
        cc -o f1.o -c f1.c
12180
        cc -o f2.o -c f2.c
12181
        cc -o f3.o -c f3.c
12182
        ar rc libfoo.a f1.o f2.o f3.o
12183
        % <KBD
12184
CLASS="userinput"
12185
>scons -c</KBD
12186
>
12187
        scons: Reading SConscript files ...
12188
        scons: done reading SConscript files.
12189
        scons: Cleaning targets ...
12190
        Removed f1.o
12191
        Removed f2.o
12192
        Removed f3.o
12193
        scons: done cleaning targets.
12194
    </PRE
12195
></DIV
12196
><DIV
12197
CLASS="section"
12198
><HR><H2
12199
CLASS="section"
12200
><A
12201
NAME="AEN2156"
12202
>13.3. Removing additional files during clean: the <CODE
12203
CLASS="function"
12204
>Clean</CODE
12205
> Function</A
12206
></H2
12207
><P
12208
>&#13;
12209
    There may be additional files that you want removed
12210
    when the <TT
12211
CLASS="literal"
12212
>-c</TT
12213
> option is used,
12214
    but which <SPAN
12215
CLASS="application"
12216
>SCons</SPAN
12217
> doesn't know about
12218
    because they're not normal target files.
12219
    For example, perhaps a command you invoke
12220
    creates a log file as
12221
    part of building the target file you want.
12222
    You would like the log file cleaned,
12223
    but you don't want to have to teach
12224
    SCons that the command
12225
    "builds" two files.
12226
12227
    </P
12228
><P
12229
>&#13;
12230
    You can use the <CODE
12231
CLASS="function"
12232
>Clean</CODE
12233
> function to arrange for additional files
12234
    to be removed when the <TT
12235
CLASS="literal"
12236
>-c</TT
12237
> option is used.
12238
    Notice, however, that the <CODE
12239
CLASS="function"
12240
>Clean</CODE
12241
> function takes two arguments,
12242
    and the <SPAN
12243
CLASS="emphasis"
12244
><I
12245
CLASS="emphasis"
12246
>second</I
12247
></SPAN
12248
> argument
12249
    is the name of the additional file you want cleaned
12250
    (<TT
12251
CLASS="filename"
12252
>foo.log</TT
12253
> in this example):
12254
12255
    </P
12256
><PRE
12257
CLASS="programlisting"
12258
>&#13;        t = Command('foo.out', 'foo.in', 'build -o $TARGET $SOURCE')
12259
        Clean(t, 'foo.log')
12260
    </PRE
12261
><P
12262
>&#13;
12263
    The first argument is the target with which you want
12264
    the cleaning of this additional file associated.
12265
    In the above example,
12266
    we've used the return value from the
12267
    <CODE
12268
CLASS="function"
12269
>Command</CODE
12270
> function,
12271
    which represents the
12272
    <TT
12273
CLASS="filename"
12274
>foo.out</TT
12275
>
12276
    target.
12277
    Now whenever the
12278
    <TT
12279
CLASS="filename"
12280
>foo.out</TT
12281
> target is cleaned
12282
    by the <TT
12283
CLASS="literal"
12284
>-c</TT
12285
> option,
12286
    the <TT
12287
CLASS="filename"
12288
>foo.log</TT
12289
> file
12290
    will be removed as well:
12291
12292
    </P
12293
><PRE
12294
CLASS="screen"
12295
>&#13;        % <KBD
12296
CLASS="userinput"
12297
>scons -Q</KBD
12298
>
12299
        build -o foo.out foo.in
12300
        % <KBD
12301
CLASS="userinput"
12302
>scons -Q -c</KBD
12303
>
12304
        Removed foo.out
12305
        Removed foo.log
12306
    </PRE
12307
></DIV
12308
></DIV
12309
><DIV
12310
CLASS="chapter"
12311
><HR><H1
12312
><A
12313
NAME="chap-hierarchical"
12314
></A
12315
>Chapter 14. Hierarchical Builds</H1
12316
><P
12317
>&#13;
12318
  The source code for large software projects
12319
  rarely stays in a single directory,
12320
  but is nearly always divided into a
12321
  hierarchy of directories.
12322
  Organizing a large software build using <SPAN
12323
CLASS="application"
12324
>SCons</SPAN
12325
>
12326
  involves creating a hierarchy of build scripts
12327
  using the <TT
12328
CLASS="filename"
12329
>SConscript</TT
12330
> function.
12331
12332
  </P
12333
><DIV
12334
CLASS="section"
12335
><HR><H2
12336
CLASS="section"
12337
><A
12338
NAME="AEN2183"
12339
>14.1. <TT
12340
CLASS="filename"
12341
>SConscript</TT
12342
> Files</A
12343
></H2
12344
><P
12345
>&#13;
12346
    As we've already seen,
12347
    the build script at the top of the tree is called <TT
12348
CLASS="filename"
12349
>SConstruct</TT
12350
>.
12351
    The top-level <TT
12352
CLASS="filename"
12353
>SConstruct</TT
12354
> file can
12355
    use the <TT
12356
CLASS="filename"
12357
>SConscript</TT
12358
> function to
12359
    include other subsidiary scripts in the build.
12360
    These subsidiary scripts can, in turn,
12361
    use the <TT
12362
CLASS="filename"
12363
>SConscript</TT
12364
> function
12365
    to include still other scripts in the build.
12366
    By convention, these subsidiary scripts are usually
12367
    named <TT
12368
CLASS="filename"
12369
>SConscript</TT
12370
>.
12371
    For example, a top-level <TT
12372
CLASS="filename"
12373
>SConstruct</TT
12374
> file might
12375
    arrange for four subsidiary scripts to be included
12376
    in the build as follows:
12377
12378
    </P
12379
><PRE
12380
CLASS="programlisting"
12381
>&#13;      SConscript(['drivers/display/SConscript',
12382
                  'drivers/mouse/SConscript',
12383
                  'parser/SConscript',
12384
                  'utilities/SConscript'])
12385
    </PRE
12386
><P
12387
>&#13;
12388
    In this case, the <TT
12389
CLASS="filename"
12390
>SConstruct</TT
12391
> file
12392
    lists all of the <TT
12393
CLASS="filename"
12394
>SConscript</TT
12395
> files in the build explicitly.
12396
    (Note, however, that not every directory in the tree
12397
    necessarily has an <TT
12398
CLASS="filename"
12399
>SConscript</TT
12400
> file.)
12401
    Alternatively, the <TT
12402
CLASS="literal"
12403
>drivers</TT
12404
>
12405
    subdirectory might contain an intermediate
12406
    <TT
12407
CLASS="filename"
12408
>SConscript</TT
12409
> file,
12410
    in which case the <TT
12411
CLASS="filename"
12412
>SConscript</TT
12413
> call in
12414
    the top-level <TT
12415
CLASS="filename"
12416
>SConstruct</TT
12417
> file
12418
    would look like:
12419
12420
    </P
12421
><PRE
12422
CLASS="programlisting"
12423
>&#13;      SConscript(['drivers/SConscript',
12424
                  'parser/SConscript',
12425
                  'utilities/SConscript'])
12426
    </PRE
12427
><P
12428
>&#13;
12429
    And the subsidiary <TT
12430
CLASS="filename"
12431
>SConscript</TT
12432
> file in the
12433
    <TT
12434
CLASS="literal"
12435
>drivers</TT
12436
> subdirectory
12437
    would look like:
12438
12439
    </P
12440
><PRE
12441
CLASS="programlisting"
12442
>&#13;      SConscript(['display/SConscript',
12443
                  'mouse/SConscript'])
12444
    </PRE
12445
><P
12446
>&#13;
12447
    Whether you list all of the <TT
12448
CLASS="filename"
12449
>SConscript</TT
12450
> files in the
12451
    top-level <TT
12452
CLASS="filename"
12453
>SConstruct</TT
12454
> file,
12455
    or place a subsidiary <TT
12456
CLASS="filename"
12457
>SConscript</TT
12458
> file in
12459
    intervening directories,
12460
    or use some mix of the two schemes,
12461
    is up to you and the needs of your software.
12462
12463
    </P
12464
></DIV
12465
><DIV
12466
CLASS="section"
12467
><HR><H2
12468
CLASS="section"
12469
><A
12470
NAME="AEN2211"
12471
>14.2. Path Names Are Relative to the <TT
12472
CLASS="filename"
12473
>SConscript</TT
12474
> Directory</A
12475
></H2
12476
><P
12477
>&#13;
12478
    Subsidiary <TT
12479
CLASS="filename"
12480
>SConscript</TT
12481
> files make it easy to create a build
12482
    hierarchy because all of the file and directory names
12483
    in a subsidiary <TT
12484
CLASS="filename"
12485
>SConscript</TT
12486
> files are interpreted
12487
    relative to the directory in which the <TT
12488
CLASS="filename"
12489
>SConscript</TT
12490
> file lives.
12491
    Typically, this allows the <TT
12492
CLASS="filename"
12493
>SConscript</TT
12494
> file containing the
12495
    instructions to build a target file
12496
    to live in the same directory as the source files
12497
    from which the target will be built,
12498
    making it easy to update how the software is built
12499
    whenever files are added or deleted
12500
    (or other changes are made).
12501
12502
    </P
12503
><P
12504
>&#13;
12505
    For example, suppose we want to build two programs
12506
    <TT
12507
CLASS="filename"
12508
>prog1</TT
12509
> and <TT
12510
CLASS="filename"
12511
>prog2</TT
12512
> in two separate directories
12513
    with the same names as the programs.
12514
    One typical way to do this would be
12515
    with a top-level <TT
12516
CLASS="filename"
12517
>SConstruct</TT
12518
> file like this:
12519
12520
    </P
12521
><PRE
12522
CLASS="programlisting"
12523
>&#13;      SConscript(['prog1/SConscript',
12524
                  'prog2/SConscript'])
12525
    </PRE
12526
><P
12527
>&#13;
12528
    And subsidiary <TT
12529
CLASS="filename"
12530
>SConscript</TT
12531
> files that look like this:
12532
12533
    </P
12534
><PRE
12535
CLASS="programlisting"
12536
>&#13;      env = Environment()
12537
      env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c'])
12538
      </PRE
12539
><P
12540
>&#13;
12541
    And this:
12542
12543
    </P
12544
><PRE
12545
CLASS="programlisting"
12546
>&#13;      env = Environment()
12547
      env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c'])
12548
      </PRE
12549
><P
12550
>&#13;
12551
    Then, when we run <SPAN
12552
CLASS="application"
12553
>SCons</SPAN
12554
> in the top-level directory,
12555
    our build looks like:
12556
12557
    </P
12558
><PRE
12559
CLASS="screen"
12560
>&#13;       % <KBD
12561
CLASS="userinput"
12562
>scons -Q</KBD
12563
>
12564
       cc -o prog1/foo1.o -c prog1/foo1.c
12565
       cc -o prog1/foo2.o -c prog1/foo2.c
12566
       cc -o prog1/main.o -c prog1/main.c
12567
       cc -o prog1/prog1 prog1/main.o prog1/foo1.o prog1/foo2.o
12568
       cc -o prog2/bar1.o -c prog2/bar1.c
12569
       cc -o prog2/bar2.o -c prog2/bar2.c
12570
       cc -o prog2/main.o -c prog2/main.c
12571
       cc -o prog2/prog2 prog2/main.o prog2/bar1.o prog2/bar2.o
12572
    </PRE
12573
><P
12574
>&#13;
12575
    Notice the following:
12576
12577
    First, you can have files with the same names
12578
    in multiple directories, like main.c in the above example.
12579
12580
    Second, unlike standard recursive use of <SPAN
12581
CLASS="application"
12582
>Make</SPAN
12583
>,
12584
    <SPAN
12585
CLASS="application"
12586
>SCons</SPAN
12587
> stays in the top-level directory
12588
    (where the <TT
12589
CLASS="filename"
12590
>SConstruct</TT
12591
> file lives)
12592
    and issues commands that use the path names
12593
    from the top-level directory to the
12594
    target and source files within the hierarchy.
12595
12596
    </P
12597
></DIV
12598
><DIV
12599
CLASS="section"
12600
><HR><H2
12601
CLASS="section"
12602
><A
12603
NAME="AEN2237"
12604
>14.3. Top-Level Path Names in Subsidiary <TT
12605
CLASS="filename"
12606
>SConscript</TT
12607
> Files</A
12608
></H2
12609
><P
12610
>&#13;
12611
    If you need to use a file from another directory,
12612
    it's sometimes more convenient to specify
12613
    the path to a file in another directory
12614
    from the top-level <TT
12615
CLASS="filename"
12616
>SConstruct</TT
12617
> directory,
12618
    even when you're using that file in
12619
    a subsidiary <TT
12620
CLASS="filename"
12621
>SConscript</TT
12622
> file in a subdirectory.
12623
    You can tell <SPAN
12624
CLASS="application"
12625
>SCons</SPAN
12626
> to interpret a path name
12627
    as relative to the top-level <TT
12628
CLASS="filename"
12629
>SConstruct</TT
12630
> directory,
12631
    not the local directory of the <TT
12632
CLASS="filename"
12633
>SConscript</TT
12634
> file,
12635
    by appending a <TT
12636
CLASS="literal"
12637
>#</TT
12638
> (hash mark)
12639
    to the beginning of the path name:
12640
12641
    </P
12642
><PRE
12643
CLASS="programlisting"
12644
>&#13;       env = Environment()
12645
       env.Program('prog', ['main.c', '#lib/foo1.c', 'foo2.c'])
12646
    </PRE
12647
><P
12648
>&#13;
12649
    In this example,
12650
    the <TT
12651
CLASS="literal"
12652
>lib</TT
12653
> directory is
12654
    directly underneath the top-level <TT
12655
CLASS="filename"
12656
>SConstruct</TT
12657
> directory.
12658
    If the above <TT
12659
CLASS="filename"
12660
>SConscript</TT
12661
> file is in a subdirectory
12662
    named <TT
12663
CLASS="literal"
12664
>src/prog</TT
12665
>,
12666
    the output would look like:
12667
12668
    </P
12669
><PRE
12670
CLASS="screen"
12671
>&#13;       % <KBD
12672
CLASS="userinput"
12673
>scons -Q</KBD
12674
>
12675
       cc -o lib/foo1.o -c lib/foo1.c
12676
       cc -o src/prog/foo2.o -c src/prog/foo2.c
12677
       cc -o src/prog/main.o -c src/prog/main.c
12678
       cc -o src/prog/prog src/prog/main.o lib/foo1.o src/prog/foo2.o
12679
    </PRE
12680
><P
12681
>&#13;
12682
    (Notice that the <TT
12683
CLASS="literal"
12684
>lib/foo1.o</TT
12685
> object file
12686
    is built in the same directory as its source file.
12687
    See <A
12688
HREF="#chap-separate"
12689
>Chapter 15</A
12690
>, below,
12691
    for information about
12692
    how to build the object file in a different subdirectory.)
12693
12694
    </P
12695
></DIV
12696
><DIV
12697
CLASS="section"
12698
><HR><H2
12699
CLASS="section"
12700
><A
12701
NAME="AEN2258"
12702
>14.4. Absolute Path Names</A
12703
></H2
12704
><P
12705
>&#13;
12706
    Of course, you can always specify
12707
    an absolute path name for a file--for example:
12708
12709
    </P
12710
><PRE
12711
CLASS="programlisting"
12712
>&#13;       env = Environment()
12713
       env.Program('prog', ['main.c', '/usr/joe/lib/foo1.c', 'foo2.c'])
12714
    </PRE
12715
><P
12716
>&#13;
12717
    Which, when executed, would yield:
12718
12719
    </P
12720
><PRE
12721
CLASS="screen"
12722
>&#13;       % <KBD
12723
CLASS="userinput"
12724
>scons -Q</KBD
12725
>
12726
       cc -o src/prog/foo2.o -c src/prog/foo2.c
12727
       cc -o src/prog/main.o -c src/prog/main.c
12728
       cc -o /usr/joe/lib/foo1.o -c /usr/joe/lib/foo1.c
12729
       cc -o src/prog/prog src/prog/main.o /usr/joe/lib/foo1.o src/prog/foo2.o
12730
    </PRE
12731
><P
12732
>&#13;
12733
    (As was the case with top-relative path names,
12734
    notice that the <TT
12735
CLASS="literal"
12736
>/usr/joe/lib/foo1.o</TT
12737
> object file
12738
    is built in the same directory as its source file.
12739
    See <A
12740
HREF="#chap-separate"
12741
>Chapter 15</A
12742
>, below,
12743
    for information about
12744
    how to build the object file in a different subdirectory.)
12745
12746
    </P
12747
></DIV
12748
><DIV
12749
CLASS="section"
12750
><HR><H2
12751
CLASS="section"
12752
><A
12753
NAME="AEN2268"
12754
>14.5. Sharing Environments (and Other Variables) Between <TT
12755
CLASS="filename"
12756
>SConscript</TT
12757
> Files</A
12758
></H2
12759
><P
12760
>&#13;
12761
    In the previous example,
12762
    each of the subsidiary <TT
12763
CLASS="filename"
12764
>SConscript</TT
12765
> files
12766
    created its own construction environment
12767
    by calling <CODE
12768
CLASS="function"
12769
>Environment</CODE
12770
> separately.
12771
    This obviously works fine,
12772
    but if each program must be built
12773
    with the same construction variables,
12774
    it's cumbersome and error-prone to initialize
12775
    separate construction environments
12776
    in the same way over and over in each subsidiary
12777
    <TT
12778
CLASS="filename"
12779
>SConscript</TT
12780
> file.
12781
12782
    </P
12783
><P
12784
>&#13;
12785
    <SPAN
12786
CLASS="application"
12787
>SCons</SPAN
12788
> supports the ability to <SPAN
12789
CLASS="emphasis"
12790
><I
12791
CLASS="emphasis"
12792
>export</I
12793
></SPAN
12794
> variables
12795
    from a parent <TT
12796
CLASS="filename"
12797
>SConscript</TT
12798
> file
12799
    to its subsidiary <TT
12800
CLASS="filename"
12801
>SConscript</TT
12802
> files,
12803
    which allows you to share common initialized
12804
    values throughout your build hierarchy.
12805
12806
    </P
12807
><DIV
12808
CLASS="section"
12809
><HR><H3
12810
CLASS="section"
12811
><A
12812
NAME="AEN2280"
12813
>14.5.1. Exporting Variables</A
12814
></H3
12815
><P
12816
>&#13;
12817
      There are two ways to export a variable,
12818
      such as a construction environment,
12819
      from an <TT
12820
CLASS="filename"
12821
>SConscript</TT
12822
> file,
12823
      so that it may be used by other <TT
12824
CLASS="filename"
12825
>SConscript</TT
12826
> files.
12827
      First, you can call the <CODE
12828
CLASS="function"
12829
>Export</CODE
12830
>
12831
      function with a list of variables,
12832
      or a string of white-space separated variable names.
12833
      Each call to <CODE
12834
CLASS="function"
12835
>Export</CODE
12836
> adds one
12837
      or more variables to a global list
12838
      of variables that are available for import
12839
      by other <TT
12840
CLASS="filename"
12841
>SConscript</TT
12842
> files.
12843
12844
      </P
12845
><PRE
12846
CLASS="programlisting"
12847
>&#13;        env = Environment()
12848
        Export('env')
12849
      </PRE
12850
><P
12851
>&#13;
12852
      You may export more than one variable name at a time:
12853
12854
      </P
12855
><PRE
12856
CLASS="programlisting"
12857
>&#13;        env = Environment()
12858
        debug = ARGUMENTS['debug']
12859
        Export('env', 'debug')
12860
      </PRE
12861
><P
12862
>&#13;
12863
      Because white space is not legal in Python variable names,
12864
      the <CODE
12865
CLASS="function"
12866
>Export</CODE
12867
> function will even automatically split
12868
      a string into separate names for you:
12869
12870
      </P
12871
><PRE
12872
CLASS="programlisting"
12873
>&#13;        Export('env debug')
12874
      </PRE
12875
><P
12876
>&#13;
12877
      Second, you can specify a list of
12878
      variables to export as a second argument
12879
      to the <TT
12880
CLASS="filename"
12881
>SConscript</TT
12882
> function call:
12883
12884
      </P
12885
><PRE
12886
CLASS="programlisting"
12887
>&#13;        SConscript('src/SConscript', 'env')
12888
      </PRE
12889
><P
12890
>&#13;
12891
      Or as the <CODE
12892
CLASS="varname"
12893
>exports</CODE
12894
> keyword argument:
12895
12896
      </P
12897
><PRE
12898
CLASS="programlisting"
12899
>&#13;        SConscript('src/SConscript', exports='env')
12900
      </PRE
12901
><P
12902
>&#13;
12903
      These calls export the specified variables
12904
      to only the listed <TT
12905
CLASS="filename"
12906
>SConscript</TT
12907
> files.
12908
      You may, however, specify more than one
12909
      <TT
12910
CLASS="filename"
12911
>SConscript</TT
12912
> file in a list:
12913
12914
      </P
12915
><PRE
12916
CLASS="programlisting"
12917
>&#13;        SConscript(['src1/SConscript',
12918
                    'src2/SConscript'], exports='env')
12919
      </PRE
12920
><P
12921
>&#13;
12922
      This is functionally equivalent to
12923
      calling the <TT
12924
CLASS="filename"
12925
>SConscript</TT
12926
> function
12927
      multiple times with the same <CODE
12928
CLASS="varname"
12929
>exports</CODE
12930
> argument,
12931
      one per <TT
12932
CLASS="filename"
12933
>SConscript</TT
12934
> file.
12935
12936
      </P
12937
></DIV
12938
><DIV
12939
CLASS="section"
12940
><HR><H3
12941
CLASS="section"
12942
><A
12943
NAME="AEN2308"
12944
>14.5.2. Importing Variables</A
12945
></H3
12946
><P
12947
>&#13;
12948
      Once a variable has been exported from a calling
12949
      <TT
12950
CLASS="filename"
12951
>SConscript</TT
12952
> file,
12953
      it may be used in other <TT
12954
CLASS="filename"
12955
>SConscript</TT
12956
> files
12957
      by calling the <CODE
12958
CLASS="function"
12959
>Import</CODE
12960
> function:
12961
12962
      </P
12963
><PRE
12964
CLASS="programlisting"
12965
>&#13;        Import('env')
12966
        env.Program('prog', ['prog.c'])
12967
      </PRE
12968
><P
12969
>&#13;
12970
      The <CODE
12971
CLASS="function"
12972
>Import</CODE
12973
> call makes the <TT
12974
CLASS="literal"
12975
>env</TT
12976
> construction
12977
      environment available to the <TT
12978
CLASS="filename"
12979
>SConscript</TT
12980
> file,
12981
      after which the variable can be used to build
12982
      programs, libraries, etc.
12983
12984
      </P
12985
><P
12986
>&#13;
12987
      Like the <CODE
12988
CLASS="function"
12989
>Export</CODE
12990
> function,
12991
      the <CODE
12992
CLASS="function"
12993
>Import</CODE
12994
> function can be used
12995
      with multiple variable names:
12996
12997
      </P
12998
><PRE
12999
CLASS="programlisting"
13000
>&#13;        Import('env', 'debug')
13001
        env = env.Clone(DEBUG = debug)
13002
        env.Program('prog', ['prog.c'])
13003
      </PRE
13004
><P
13005
>&#13;
13006
      And the <CODE
13007
CLASS="function"
13008
>Import</CODE
13009
> function will similarly
13010
      split a string along white-space
13011
      into separate variable names:
13012
13013
      </P
13014
><PRE
13015
CLASS="programlisting"
13016
>&#13;        Import('env debug')
13017
        env = env.Clone(DEBUG = debug)
13018
        env.Program('prog', ['prog.c'])
13019
      </PRE
13020
><P
13021
>&#13;
13022
      Lastly, as a special case,
13023
      you may import all of the variables that
13024
      have been exported by supplying an asterisk
13025
      to the <CODE
13026
CLASS="function"
13027
>Import</CODE
13028
> function:
13029
13030
      </P
13031
><PRE
13032
CLASS="programlisting"
13033
>&#13;        Import('*')
13034
        env = env.Clone(DEBUG = debug)
13035
        env.Program('prog', ['prog.c'])
13036
      </PRE
13037
><P
13038
>&#13;
13039
      If you're dealing with a lot of <TT
13040
CLASS="filename"
13041
>SConscript</TT
13042
> files,
13043
      this can be a lot simpler than keeping
13044
      arbitrary lists of imported variables in each file.
13045
13046
      </P
13047
></DIV
13048
><DIV
13049
CLASS="section"
13050
><HR><H3
13051
CLASS="section"
13052
><A
13053
NAME="AEN2331"
13054
>14.5.3. Returning Values From an <TT
13055
CLASS="filename"
13056
>SConscript</TT
13057
> File</A
13058
></H3
13059
><P
13060
>&#13;
13061
      Sometimes, you would like to be able to
13062
      use information from a subsidiary
13063
      <TT
13064
CLASS="filename"
13065
>SConscript</TT
13066
> file in some way.
13067
      For example,
13068
      suppose that you want to create one
13069
      library from source files
13070
      scattered throughout a number
13071
      of subsidiary <TT
13072
CLASS="filename"
13073
>SConscript</TT
13074
> files.
13075
      You can do this by using the <CODE
13076
CLASS="function"
13077
>Return</CODE
13078
>
13079
      function to return values
13080
      from the subsidiary <TT
13081
CLASS="filename"
13082
>SConscript</TT
13083
> files
13084
      to the calling file.
13085
13086
      </P
13087
><P
13088
>&#13;
13089
      If, for example, we have two subdirectories
13090
      <SPAN
13091
CLASS="application"
13092
>foo</SPAN
13093
> and <SPAN
13094
CLASS="application"
13095
>bar</SPAN
13096
>
13097
      that should each contribute a source
13098
      file to a Library,
13099
      what we'd like to be able to do is
13100
      collect the object files
13101
      from the subsidiary <TT
13102
CLASS="filename"
13103
>SConscript</TT
13104
> calls
13105
      like this:
13106
13107
      </P
13108
><PRE
13109
CLASS="programlisting"
13110
>&#13;          env = Environment()
13111
          Export('env')
13112
          objs = []
13113
          for subdir in ['foo', 'bar']:
13114
              o = SConscript('%s/SConscript' % subdir)
13115
              objs.append(o)
13116
          env.Library('prog', objs)
13117
      </PRE
13118
><P
13119
>&#13;
13120
      We can do this by using the <CODE
13121
CLASS="function"
13122
>Return</CODE
13123
>
13124
      function in the
13125
      <TT
13126
CLASS="literal"
13127
>foo/SConscript</TT
13128
> file like this:
13129
13130
      </P
13131
><PRE
13132
CLASS="programlisting"
13133
>&#13;          Import('env')
13134
          obj = env.Object('foo.c')
13135
          Return('obj')
13136
        </PRE
13137
><P
13138
>&#13;
13139
      (The corresponding
13140
      <TT
13141
CLASS="literal"
13142
>bar/SConscript</TT
13143
>
13144
      file should be pretty obvious.)
13145
      Then when we run <SPAN
13146
CLASS="application"
13147
>SCons</SPAN
13148
>,
13149
      the object files from the subsidiary subdirectories
13150
      are all correctly archived in the desired library:
13151
13152
      </P
13153
><PRE
13154
CLASS="screen"
13155
>&#13;        % <KBD
13156
CLASS="userinput"
13157
>scons -Q</KBD
13158
>
13159
        cc -o bar/bar.o -c bar/bar.c
13160
        cc -o foo/foo.o -c foo/foo.c
13161
        ar rc libprog.a foo/foo.o bar/bar.o
13162
        ranlib libprog.a
13163
      </PRE
13164
></DIV
13165
></DIV
13166
></DIV
13167
><DIV
13168
CLASS="chapter"
13169
><HR><H1
13170
><A
13171
NAME="chap-separate"
13172
></A
13173
>Chapter 15. Separating Source and Build Directories</H1
13174
><P
13175
>&#13;
13176
  It's often useful to keep any built files completely
13177
  separate from the source files.
13178
  In <SPAN
13179
CLASS="application"
13180
>SCons</SPAN
13181
>, this is usually done by creating one or more separate
13182
  <SPAN
13183
CLASS="emphasis"
13184
><I
13185
CLASS="emphasis"
13186
>variant directory trees</I
13187
></SPAN
13188
>
13189
  that are used to hold the built objects files, libraries,
13190
  and executable programs, etc.
13191
  for a specific flavor, or variant, of build.
13192
  <SPAN
13193
CLASS="application"
13194
>SCons</SPAN
13195
> provides two ways to do this,
13196
  one through the <TT
13197
CLASS="filename"
13198
>SConscript</TT
13199
> function that we've already seen,
13200
  and the second through a more flexible <CODE
13201
CLASS="function"
13202
>VariantDir</CODE
13203
> function.
13204
13205
  </P
13206
><P
13207
>&#13;
13208
  One historical note:  the <CODE
13209
CLASS="function"
13210
>VariantDir</CODE
13211
> function
13212
  used to be called <CODE
13213
CLASS="function"
13214
>BuildDir</CODE
13215
>.
13216
  That name is still supported
13217
  but has been deprecated
13218
  because the <SPAN
13219
CLASS="application"
13220
>SCons</SPAN
13221
> functionality
13222
  differs from the model of a "build directory"
13223
  implemented by other build systems like the GNU Autotools.
13224
13225
  </P
13226
><DIV
13227
CLASS="section"
13228
><HR><H2
13229
CLASS="section"
13230
><A
13231
NAME="AEN2365"
13232
>15.1. Specifying a Variant Directory Tree as Part of an <TT
13233
CLASS="filename"
13234
>SConscript</TT
13235
> Call</A
13236
></H2
13237
><P
13238
>&#13;
13239
    The most straightforward way to establish a variant directory tree
13240
    uses the fact that the usual way to
13241
    set up a build hierarchy is to have an
13242
    <TT
13243
CLASS="filename"
13244
>SConscript</TT
13245
> file in the source subdirectory.
13246
    If you then pass a <CODE
13247
CLASS="varname"
13248
>variant_dir</CODE
13249
> argument to the
13250
    <TT
13251
CLASS="filename"
13252
>SConscript</TT
13253
> function call:
13254
13255
    </P
13256
><PRE
13257
CLASS="programlisting"
13258
>&#13;      SConscript('src/SConscript', variant_dir='build')
13259
    </PRE
13260
><P
13261
>&#13;
13262
    <SPAN
13263
CLASS="application"
13264
>SCons</SPAN
13265
> will then build all of the files in
13266
    the <TT
13267
CLASS="filename"
13268
>build</TT
13269
> subdirectory:
13270
13271
    </P
13272
><PRE
13273
CLASS="screen"
13274
>&#13;      % <KBD
13275
CLASS="userinput"
13276
>ls src</KBD
13277
>
13278
      SConscript  hello.c
13279
      % <KBD
13280
CLASS="userinput"
13281
>scons -Q</KBD
13282
>
13283
      cc -o build/hello.o -c build/hello.c
13284
      cc -o build/hello build/hello.o
13285
      % <KBD
13286
CLASS="userinput"
13287
>ls build</KBD
13288
>
13289
      SConscript  hello  hello.c  hello.o
13290
    </PRE
13291
><P
13292
>&#13;
13293
    But wait a minute--what's going on here?
13294
    <SPAN
13295
CLASS="application"
13296
>SCons</SPAN
13297
> created the object file
13298
    <TT
13299
CLASS="filename"
13300
>build/hello.o</TT
13301
>
13302
    in the <TT
13303
CLASS="filename"
13304
>build</TT
13305
> subdirectory,
13306
    as expected.
13307
    But even though our <TT
13308
CLASS="filename"
13309
>hello.c</TT
13310
> file lives in the <TT
13311
CLASS="filename"
13312
>src</TT
13313
> subdirectory,
13314
    <SPAN
13315
CLASS="application"
13316
>SCons</SPAN
13317
> has actually compiled a
13318
    <TT
13319
CLASS="filename"
13320
>build/hello.c</TT
13321
> file
13322
    to create the object file.
13323
13324
    </P
13325
><P
13326
>&#13;
13327
    What's happened is that <SPAN
13328
CLASS="application"
13329
>SCons</SPAN
13330
> has <SPAN
13331
CLASS="emphasis"
13332
><I
13333
CLASS="emphasis"
13334
>duplicated</I
13335
></SPAN
13336
>
13337
    the <TT
13338
CLASS="filename"
13339
>hello.c</TT
13340
> file from the <TT
13341
CLASS="filename"
13342
>src</TT
13343
> subdirectory
13344
    to the <TT
13345
CLASS="filename"
13346
>build</TT
13347
> subdirectory,
13348
    and built the program from there.
13349
    The next section explains why <SPAN
13350
CLASS="application"
13351
>SCons</SPAN
13352
> does this.
13353
13354
    </P
13355
></DIV
13356
><DIV
13357
CLASS="section"
13358
><HR><H2
13359
CLASS="section"
13360
><A
13361
NAME="AEN2395"
13362
>15.2. Why <SPAN
13363
CLASS="application"
13364
>SCons</SPAN
13365
> Duplicates Source Files in a Variant Directory Tree</A
13366
></H2
13367
><P
13368
>&#13;
13369
    <SPAN
13370
CLASS="application"
13371
>SCons</SPAN
13372
> duplicates source files in variant directory trees
13373
    because it's the most straightforward way to guarantee a correct build
13374
    <SPAN
13375
CLASS="emphasis"
13376
><I
13377
CLASS="emphasis"
13378
>regardless of include-file directory paths,
13379
    relative references between files,
13380
    or tool support for putting files in different locations</I
13381
></SPAN
13382
>,
13383
    and the <SPAN
13384
CLASS="application"
13385
>SCons</SPAN
13386
> philosophy is to, by default,
13387
    guarantee a correct build in all cases.
13388
13389
    </P
13390
><P
13391
>&#13;
13392
    The most direct reason to duplicate source files
13393
    in variant directories
13394
    is simply that some tools (mostly older vesions)
13395
    are written to only build their output files
13396
    in the same directory as the source files.
13397
    In this case, the choices are either
13398
    to build the output file in the source directory
13399
    and move it to the variant directory,
13400
    or to duplicate the source files in the variant directory.
13401
13402
    </P
13403
><P
13404
>&#13;
13405
    Additionally,
13406
    relative references between files
13407
    can cause problems if we don't
13408
    just duplicate the hierarchy of source files
13409
    in the variant directory.
13410
    You can see this at work in
13411
    use of the C preprocessor <TT
13412
CLASS="literal"
13413
>#include</TT
13414
>
13415
    mechanism with double quotes, not angle brackets:
13416
13417
    </P
13418
><PRE
13419
CLASS="programlisting"
13420
>&#13;      #include "file.h"
13421
    </PRE
13422
><P
13423
>&#13;
13424
    The <SPAN
13425
CLASS="emphasis"
13426
><I
13427
CLASS="emphasis"
13428
>de facto</I
13429
></SPAN
13430
> standard behavior
13431
    for most C compilers in this case
13432
    is to first look in the same directory
13433
    as the source file that contains the <TT
13434
CLASS="literal"
13435
>#include</TT
13436
> line,
13437
    then to look in the directories in the preprocessor search path.
13438
    Add to this that the <SPAN
13439
CLASS="application"
13440
>SCons</SPAN
13441
> implementation of
13442
    support for code repositories
13443
    (described below)
13444
    means not all of the files
13445
    will be found in the same directory hierarchy,
13446
    and the simplest way to make sure
13447
    that the right include file is found
13448
    is to duplicate the source files into the variant directory,
13449
    which provides a correct build
13450
    regardless of the original location(s) of the source files.
13451
13452
    </P
13453
><P
13454
>&#13;
13455
    Although source-file duplication guarantees a correct build
13456
    even in these end-cases,
13457
    it <SPAN
13458
CLASS="emphasis"
13459
><I
13460
CLASS="emphasis"
13461
>can</I
13462
></SPAN
13463
> usually be safely disabled.
13464
    The next section describes
13465
    how you can disable the duplication of source files
13466
    in the variant directory.
13467
13468
    </P
13469
></DIV
13470
><DIV
13471
CLASS="section"
13472
><HR><H2
13473
CLASS="section"
13474
><A
13475
NAME="AEN2412"
13476
>15.3. Telling <SPAN
13477
CLASS="application"
13478
>SCons</SPAN
13479
> to Not Duplicate Source Files in the Variant Directory Tree</A
13480
></H2
13481
><P
13482
>&#13;
13483
    In most cases and with most tool sets,
13484
    <SPAN
13485
CLASS="application"
13486
>SCons</SPAN
13487
> can place its target files in a build subdirectory
13488
    <SPAN
13489
CLASS="emphasis"
13490
><I
13491
CLASS="emphasis"
13492
>without</I
13493
></SPAN
13494
>
13495
    duplicating the source files
13496
    and everything will work just fine.
13497
    You can disable the default <SPAN
13498
CLASS="application"
13499
>SCons</SPAN
13500
> behavior
13501
    by specifying <TT
13502
CLASS="literal"
13503
>duplicate=0</TT
13504
>
13505
    when you call the <TT
13506
CLASS="filename"
13507
>SConscript</TT
13508
> function:
13509
13510
    </P
13511
><PRE
13512
CLASS="programlisting"
13513
>&#13;      SConscript('src/SConscript', variant_dir='build', duplicate=0)
13514
    </PRE
13515
><P
13516
>&#13;
13517
    When this flag is specified,
13518
    <SPAN
13519
CLASS="application"
13520
>SCons</SPAN
13521
> uses the variant directory
13522
    like most people expect--that is,
13523
    the output files are placed in the variant directory
13524
    while the source files stay in the source directory:
13525
13526
    </P
13527
><PRE
13528
CLASS="screen"
13529
>&#13;      % <KBD
13530
CLASS="userinput"
13531
>ls src</KBD
13532
>
13533
      SConscript
13534
      hello.c
13535
      % <KBD
13536
CLASS="userinput"
13537
>scons -Q</KBD
13538
>
13539
      cc -c src/hello.c -o build/hello.o
13540
      cc -o build/hello build/hello.o
13541
      % <KBD
13542
CLASS="userinput"
13543
>ls build</KBD
13544
>
13545
      hello
13546
      hello.o
13547
    </PRE
13548
></DIV
13549
><DIV
13550
CLASS="section"
13551
><HR><H2
13552
CLASS="section"
13553
><A
13554
NAME="AEN2428"
13555
>15.4. The <CODE
13556
CLASS="function"
13557
>VariantDir</CODE
13558
> Function</A
13559
></H2
13560
><P
13561
>&#13;
13562
    Use the <CODE
13563
CLASS="function"
13564
>VariantDir</CODE
13565
> function to establish that target
13566
    files should be built in a separate directory
13567
    from the source files:
13568
13569
    </P
13570
><PRE
13571
CLASS="programlisting"
13572
>&#13;      VariantDir('build', 'src')
13573
      env = Environment()
13574
      env.Program('build/hello.c')
13575
    </PRE
13576
><P
13577
>&#13;
13578
    Note that when you're not using
13579
    an <TT
13580
CLASS="filename"
13581
>SConscript</TT
13582
> file in the <TT
13583
CLASS="filename"
13584
>src</TT
13585
> subdirectory,
13586
    you must actually specify that
13587
    the program must be built from
13588
    the <TT
13589
CLASS="filename"
13590
>build/hello.c</TT
13591
>
13592
    file that <SPAN
13593
CLASS="application"
13594
>SCons</SPAN
13595
> will duplicate in the
13596
    <TT
13597
CLASS="filename"
13598
>build</TT
13599
> subdirectory.
13600
13601
    </P
13602
><P
13603
>&#13;
13604
    When using the <CODE
13605
CLASS="function"
13606
>VariantDir</CODE
13607
> function directly,
13608
    <SPAN
13609
CLASS="application"
13610
>SCons</SPAN
13611
> still duplicates the source files
13612
    in the variant directory by default:
13613
13614
    </P
13615
><PRE
13616
CLASS="screen"
13617
>&#13;      % <KBD
13618
CLASS="userinput"
13619
>ls src</KBD
13620
>
13621
      hello.c
13622
      % <KBD
13623
CLASS="userinput"
13624
>scons -Q</KBD
13625
>
13626
      cc -o build/hello.o -c build/hello.c
13627
      cc -o build/hello build/hello.o
13628
      % <KBD
13629
CLASS="userinput"
13630
>ls build</KBD
13631
>
13632
      hello  hello.c  hello.o
13633
    </PRE
13634
><P
13635
>&#13;
13636
    You can specify the same <TT
13637
CLASS="literal"
13638
>duplicate=0</TT
13639
> argument
13640
    that you can specify for an <TT
13641
CLASS="filename"
13642
>SConscript</TT
13643
> call:
13644
13645
    </P
13646
><PRE
13647
CLASS="programlisting"
13648
>&#13;      VariantDir('build', 'src', duplicate=0)
13649
      env = Environment()
13650
      env.Program('build/hello.c')
13651
    </PRE
13652
><P
13653
>&#13;
13654
    In which case <SPAN
13655
CLASS="application"
13656
>SCons</SPAN
13657
>
13658
    will disable duplication of the source files:
13659
13660
    </P
13661
><PRE
13662
CLASS="screen"
13663
>&#13;      % <KBD
13664
CLASS="userinput"
13665
>ls src</KBD
13666
>
13667
      hello.c
13668
      % <KBD
13669
CLASS="userinput"
13670
>scons -Q</KBD
13671
>
13672
      cc -o build/hello.o -c src/hello.c
13673
      cc -o build/hello build/hello.o
13674
      % <KBD
13675
CLASS="userinput"
13676
>ls build</KBD
13677
>
13678
      hello  hello.o
13679
    </PRE
13680
></DIV
13681
><DIV
13682
CLASS="section"
13683
><HR><H2
13684
CLASS="section"
13685
><A
13686
NAME="AEN2457"
13687
>15.5. Using <CODE
13688
CLASS="function"
13689
>VariantDir</CODE
13690
> With an <TT
13691
CLASS="filename"
13692
>SConscript</TT
13693
> File</A
13694
></H2
13695
><P
13696
>&#13;
13697
    Even when using the <CODE
13698
CLASS="function"
13699
>VariantDir</CODE
13700
> function,
13701
    it's much more natural to use it with
13702
    a subsidiary <TT
13703
CLASS="filename"
13704
>SConscript</TT
13705
> file.
13706
    For example, if the
13707
    <TT
13708
CLASS="filename"
13709
>src/SConscript</TT
13710
>
13711
    looks like this:
13712
13713
    </P
13714
><PRE
13715
CLASS="programlisting"
13716
>&#13;      env = Environment()
13717
      env.Program('hello.c')
13718
    </PRE
13719
><P
13720
>&#13;
13721
    Then our <TT
13722
CLASS="filename"
13723
>SConstruct</TT
13724
> file could look like:
13725
13726
    </P
13727
><PRE
13728
CLASS="programlisting"
13729
>&#13;      VariantDir('build', 'src')
13730
      SConscript('build/SConscript')
13731
      </PRE
13732
><P
13733
>&#13;
13734
    Yielding the following output:
13735
13736
    </P
13737
><PRE
13738
CLASS="screen"
13739
>&#13;      % <KBD
13740
CLASS="userinput"
13741
>ls src</KBD
13742
>
13743
      SConscript  hello.c
13744
      % <KBD
13745
CLASS="userinput"
13746
>scons -Q</KBD
13747
>
13748
      cc -o build/hello.o -c build/hello.c
13749
      cc -o build/hello build/hello.o
13750
      % <KBD
13751
CLASS="userinput"
13752
>ls build</KBD
13753
>
13754
      SConscript  hello  hello.c  hello.o
13755
    </PRE
13756
><P
13757
>&#13;
13758
    Notice that this is completely equivalent
13759
    to the use of <TT
13760
CLASS="filename"
13761
>SConscript</TT
13762
> that we
13763
    learned about in the previous section.
13764
13765
    </P
13766
></DIV
13767
><DIV
13768
CLASS="section"
13769
><HR><H2
13770
CLASS="section"
13771
><A
13772
NAME="AEN2476"
13773
>15.6. Using Glob() with <CODE
13774
CLASS="function"
13775
>VariantDir</CODE
13776
></A
13777
></H2
13778
><P
13779
>&#13;
13780
    The Glob() file name pattern matching function
13781
    works just as usual when using <CODE
13782
CLASS="function"
13783
>VariantDir</CODE
13784
>.
13785
    For example, if the
13786
    <TT
13787
CLASS="filename"
13788
>src/SConscript</TT
13789
>
13790
    looks like this:
13791
13792
    </P
13793
><PRE
13794
CLASS="programlisting"
13795
>&#13;      env = Environment()
13796
      env.Program('hello', Glob('*.c'))
13797
    </PRE
13798
><P
13799
>&#13;
13800
    Then with the same <TT
13801
CLASS="filename"
13802
>SConstruct</TT
13803
> file as in the previous section,
13804
    and source files f1.c and f2.c in src, we would see the following
13805
    output:
13806
13807
    </P
13808
><PRE
13809
CLASS="screen"
13810
>&#13;      % <KBD
13811
CLASS="userinput"
13812
>ls src</KBD
13813
>
13814
      SConscript  f1.c  f2.c  f2.h
13815
      % <KBD
13816
CLASS="userinput"
13817
>scons -Q</KBD
13818
>
13819
      cc -o build/f1.o -c build/f1.c
13820
      cc -o build/f2.o -c build/f2.c
13821
      cc -o build/hello build/f1.o build/f2.o
13822
      % <KBD
13823
CLASS="userinput"
13824
>ls build</KBD
13825
>
13826
      SConscript  f1.c  f1.o  f2.c  f2.h  f2.o  hello
13827
    </PRE
13828
><P
13829
>&#13;
13830
    The Glob function returns Nodes in the build/ tree, as
13831
    you'd expect.
13832
13833
    </P
13834
></DIV
13835
></DIV
13836
><DIV
13837
CLASS="chapter"
13838
><HR><H1
13839
><A
13840
NAME="chap-variants"
13841
></A
13842
>Chapter 16. Variant Builds</H1
13843
><P
13844
>&#13;
13845
  The <CODE
13846
CLASS="varname"
13847
>variant_dir</CODE
13848
> keyword argument of
13849
  the <TT
13850
CLASS="filename"
13851
>SConscript</TT
13852
> function provides everything
13853
  we need to show how easy it is to create
13854
  variant builds using <SPAN
13855
CLASS="application"
13856
>SCons</SPAN
13857
>.
13858
  Suppose, for example, that we want to
13859
  build a program for both Windows and Linux platforms,
13860
  but that we want to build it in a shared directory
13861
  with separate side-by-side build directories
13862
  for the Windows and Linux versions of the program.
13863
13864
  </P
13865
><PRE
13866
CLASS="programlisting"
13867
>&#13;    platform = ARGUMENTS.get('OS', Platform())
13868
13869
    include = "#export/$PLATFORM/include"
13870
    lib = "#export/$PLATFORM/lib"
13871
    bin = "#export/$PLATFORM/bin"
13872
13873
    env = Environment(PLATFORM = platform,
13874
                      BINDIR = bin,
13875
                      INCDIR = include,
13876
                      LIBDIR = lib,
13877
                      CPPPATH = [include],
13878
                      LIBPATH = [lib],
13879
                      LIBS = 'world')
13880
13881
    Export('env')
13882
13883
    env.SConscript('src/SConscript', variant_dir='build/$PLATFORM')
13884
  </PRE
13885
><P
13886
>&#13;
13887
  This SConstruct file,
13888
  when run on a Linux system, yields:
13889
13890
  </P
13891
><PRE
13892
CLASS="screen"
13893
>&#13;    % <KBD
13894
CLASS="userinput"
13895
>scons -Q OS=linux</KBD
13896
>
13897
    Install file: "build/linux/world/world.h" as "export/linux/include/world.h"
13898
    cc -o build/linux/hello/hello.o -c -Iexport/linux/include build/linux/hello/hello.c
13899
    cc -o build/linux/world/world.o -c -Iexport/linux/include build/linux/world/world.c
13900
    ar rc build/linux/world/libworld.a build/linux/world/world.o
13901
    ranlib build/linux/world/libworld.a
13902
    Install file: "build/linux/world/libworld.a" as "export/linux/lib/libworld.a"
13903
    cc -o build/linux/hello/hello build/linux/hello/hello.o -Lexport/linux/lib -lworld
13904
    Install file: "build/linux/hello/hello" as "export/linux/bin/hello"
13905
  </PRE
13906
><P
13907
>&#13;
13908
  The same SConstruct file on Windows would build:
13909
13910
  </P
13911
><PRE
13912
CLASS="screen"
13913
>&#13;    C:\&#62;<KBD
13914
CLASS="userinput"
13915
>scons -Q OS=windows</KBD
13916
>
13917
    Install file: "build/windows/world/world.h" as "export/windows/include/world.h"
13918
    cl /nologo /Iexport\windows\include /c build\windows\hello\hello.c /Fobuild\windows\hello\hello.obj
13919
    cl /nologo /Iexport\windows\include /c build\windows\world\world.c /Fobuild\windows\world\world.obj
13920
    lib /nologo /OUT:build\windows\world\world.lib build\windows\world\world.obj
13921
    Install file: "build/windows/world/world.lib" as "export/windows/lib/world.lib"
13922
    link /nologo /OUT:build\windows\hello\hello.exe /LIBPATH:export\windows\lib world.lib build\windows\hello\hello.obj
13923
    Install file: "build/windows/hello/hello.exe" as "export/windows/bin/hello.exe"
13924
  </PRE
13925
></DIV
13926
><DIV
13927
CLASS="chapter"
13928
><HR><H1
13929
><A
13930
NAME="chap-builders-writing"
13931
></A
13932
>Chapter 17. Writing Your Own Builders</H1
13933
><P
13934
>&#13;
13935
  Although <SPAN
13936
CLASS="application"
13937
>SCons</SPAN
13938
> provides many useful methods
13939
  for building common software products:
13940
  programs, libraries, documents.
13941
  you frequently want to be
13942
  able to build some other type of file
13943
  not supported directly by <SPAN
13944
CLASS="application"
13945
>SCons</SPAN
13946
>
13947
  Fortunately, <SPAN
13948
CLASS="application"
13949
>SCons</SPAN
13950
> makes it very easy
13951
  to define your own <CODE
13952
CLASS="classname"
13953
>Builder</CODE
13954
> objects
13955
  for any custom file types you want to build.
13956
  (In fact, the <SPAN
13957
CLASS="application"
13958
>SCons</SPAN
13959
> interfaces for creating
13960
  <CODE
13961
CLASS="classname"
13962
>Builder</CODE
13963
> objects are flexible enough and easy enough to use
13964
  that all of the the <SPAN
13965
CLASS="application"
13966
>SCons</SPAN
13967
> built-in <CODE
13968
CLASS="classname"
13969
>Builder</CODE
13970
> objects
13971
  are created the mechanisms described in this section.)
13972
13973
  </P
13974
><DIV
13975
CLASS="section"
13976
><HR><H2
13977
CLASS="section"
13978
><A
13979
NAME="AEN2514"
13980
>17.1. Writing Builders That Execute External Commands</A
13981
></H2
13982
><P
13983
>&#13;
13984
    The simplest <CODE
13985
CLASS="classname"
13986
>Builder</CODE
13987
> to create is
13988
    one that executes an external command.
13989
    For example, if we want to build
13990
    an output file by running the contents
13991
    of the input file through a command named
13992
    <TT
13993
CLASS="literal"
13994
>foobuild</TT
13995
>,
13996
    creating that <CODE
13997
CLASS="classname"
13998
>Builder</CODE
13999
> might look like:
14000
14001
    </P
14002
><PRE
14003
CLASS="programlisting"
14004
>&#13;       bld = Builder(action = 'foobuild &#60; $SOURCE &#62; $TARGET')
14005
    </PRE
14006
><P
14007
>&#13;
14008
    All the above line does is create a free-standing
14009
    <CODE
14010
CLASS="classname"
14011
>Builder</CODE
14012
> object.
14013
    The next section will show us how to actually use it.
14014
14015
    </P
14016
></DIV
14017
><DIV
14018
CLASS="section"
14019
><HR><H2
14020
CLASS="section"
14021
><A
14022
NAME="AEN2523"
14023
>17.2. Attaching a Builder to a <TT
14024
CLASS="literal"
14025
>Construction Environment</TT
14026
></A
14027
></H2
14028
><P
14029
>&#13;
14030
    A <CODE
14031
CLASS="classname"
14032
>Builder</CODE
14033
> object isn't useful
14034
    until it's attached to a <TT
14035
CLASS="literal"
14036
>construction environment</TT
14037
>
14038
    so that we can call it to arrange
14039
    for files to be built.
14040
    This is done through the <A
14041
HREF="#cv-BUILDERS"
14042
><CODE
14043
CLASS="envar"
14044
>$BUILDERS</CODE
14045
></A
14046
>
14047
    <TT
14048
CLASS="literal"
14049
>construction variable</TT
14050
> in an environment.
14051
    The <CODE
14052
CLASS="envar"
14053
>$BUILDERS</CODE
14054
> variable is a Python dictionary
14055
    that maps the names by which you want to call
14056
    various <CODE
14057
CLASS="classname"
14058
>Builder</CODE
14059
> objects to the objects themselves.
14060
    For example, if we want to call the
14061
    <CODE
14062
CLASS="classname"
14063
>Builder</CODE
14064
> we just defined by the name
14065
    <CODE
14066
CLASS="function"
14067
>Foo</CODE
14068
>,
14069
    our <TT
14070
CLASS="filename"
14071
>SConstruct</TT
14072
> file might look like:
14073
14074
    </P
14075
><PRE
14076
CLASS="programlisting"
14077
>&#13;       bld = Builder(action = 'foobuild &#60; $SOURCE &#62; $TARGET')
14078
       env = Environment(BUILDERS = {'Foo' : bld})
14079
    </PRE
14080
><P
14081
>&#13;
14082
    With the <CODE
14083
CLASS="classname"
14084
>Builder</CODE
14085
> so attached to our <TT
14086
CLASS="literal"
14087
>construction environment</TT
14088
>
14089
    we can now actually call it like so:
14090
14091
    </P
14092
><PRE
14093
CLASS="programlisting"
14094
>&#13;       env.Foo('file.foo', 'file.input')
14095
    </PRE
14096
><P
14097
>&#13;
14098
    Then when we run <SPAN
14099
CLASS="application"
14100
>SCons</SPAN
14101
> it looks like:
14102
14103
    </P
14104
><PRE
14105
CLASS="screen"
14106
>&#13;      % <KBD
14107
CLASS="userinput"
14108
>scons -Q</KBD
14109
>
14110
      foobuild &#60; file.input &#62; file.foo
14111
    </PRE
14112
><P
14113
>&#13;
14114
    Note, however, that the default <CODE
14115
CLASS="envar"
14116
>$BUILDERS</CODE
14117
>
14118
    variable in a <TT
14119
CLASS="literal"
14120
>construction environment</TT
14121
>
14122
    comes with a default set of <CODE
14123
CLASS="classname"
14124
>Builder</CODE
14125
> objects
14126
    already defined:
14127
    <A
14128
HREF="#b-Program"
14129
><CODE
14130
CLASS="function"
14131
>Program</CODE
14132
></A
14133
>, <A
14134
HREF="#b-Library"
14135
><CODE
14136
CLASS="function"
14137
>Library</CODE
14138
></A
14139
>, etc.
14140
    And when we explicitly set the <CODE
14141
CLASS="envar"
14142
>$BUILDERS</CODE
14143
> variable
14144
    when we create the <TT
14145
CLASS="literal"
14146
>construction environment</TT
14147
>,
14148
    the default <CODE
14149
CLASS="classname"
14150
>Builder</CODE
14151
>s are no longer part of
14152
    the environment:
14153
14154
    </P
14155
><PRE
14156
CLASS="programlisting"
14157
>&#13;       bld = Builder(action = 'foobuild &#60; $SOURCE &#62; $TARGET')
14158
       env = Environment(BUILDERS = {'Foo' : bld})
14159
       env.Foo('file.foo', 'file.input')
14160
       env.Program('hello.c')
14161
    </PRE
14162
><PRE
14163
CLASS="screen"
14164
>&#13;      % <KBD
14165
CLASS="userinput"
14166
>scons -Q</KBD
14167
>
14168
      AttributeError: SConsEnvironment instance has no attribute 'Program':
14169
        File "/home/my/project/SConstruct", line 4:
14170
          env.Program('hello.c')
14171
    </PRE
14172
><P
14173
>&#13;
14174
    To be able to use both our own defined <CODE
14175
CLASS="classname"
14176
>Builder</CODE
14177
> objects
14178
    and the default <CODE
14179
CLASS="classname"
14180
>Builder</CODE
14181
> objects in the same <TT
14182
CLASS="literal"
14183
>construction environment</TT
14184
>,
14185
    you can either add to the <CODE
14186
CLASS="envar"
14187
>$BUILDERS</CODE
14188
> variable
14189
    using the <CODE
14190
CLASS="function"
14191
>Append</CODE
14192
> function:
14193
14194
    </P
14195
><PRE
14196
CLASS="programlisting"
14197
>&#13;       env = Environment()
14198
       bld = Builder(action = 'foobuild &#60; $SOURCE &#62; $TARGET')
14199
       env.Append(BUILDERS = {'Foo' : bld})
14200
       env.Foo('file.foo', 'file.input')
14201
       env.Program('hello.c')
14202
    </PRE
14203
><P
14204
>&#13;
14205
    Or you can explicitly set the appropriately-named
14206
    key in the <CODE
14207
CLASS="envar"
14208
>$BUILDERS</CODE
14209
> dictionary:
14210
14211
    </P
14212
><PRE
14213
CLASS="programlisting"
14214
>&#13;       env = Environment()
14215
       bld = Builder(action = 'foobuild &#60; $SOURCE &#62; $TARGET')
14216
       env['BUILDERS']['Foo'] = bld
14217
       env.Foo('file.foo', 'file.input')
14218
       env.Program('hello.c')
14219
    </PRE
14220
><P
14221
>&#13;
14222
    Either way, the same <TT
14223
CLASS="literal"
14224
>construction environment</TT
14225
>
14226
    can then use both the newly-defined
14227
    <CODE
14228
CLASS="function"
14229
>Foo</CODE
14230
> <CODE
14231
CLASS="classname"
14232
>Builder</CODE
14233
>
14234
    and the default <A
14235
HREF="#b-Program"
14236
><CODE
14237
CLASS="function"
14238
>Program</CODE
14239
></A
14240
> <CODE
14241
CLASS="classname"
14242
>Builder</CODE
14243
>:
14244
14245
    </P
14246
><PRE
14247
CLASS="screen"
14248
>&#13;      % <KBD
14249
CLASS="userinput"
14250
>scons -Q</KBD
14251
>
14252
      foobuild &#60; file.input &#62; file.foo
14253
      cc -o hello.o -c hello.c
14254
      cc -o hello hello.o
14255
    </PRE
14256
></DIV
14257
><DIV
14258
CLASS="section"
14259
><HR><H2
14260
CLASS="section"
14261
><A
14262
NAME="AEN2579"
14263
>17.3. Letting <SPAN
14264
CLASS="application"
14265
>SCons</SPAN
14266
> Handle The File Suffixes</A
14267
></H2
14268
><P
14269
>&#13;
14270
    By supplying additional information
14271
    when you create a <CODE
14272
CLASS="classname"
14273
>Builder</CODE
14274
>,
14275
    you can let <SPAN
14276
CLASS="application"
14277
>SCons</SPAN
14278
> add appropriate file
14279
    suffixes to the target and/or the source file.
14280
    For example, rather than having to specify
14281
    explicitly that you want the <TT
14282
CLASS="literal"
14283
>Foo</TT
14284
>
14285
    <CODE
14286
CLASS="classname"
14287
>Builder</CODE
14288
> to build the <TT
14289
CLASS="literal"
14290
>file.foo</TT
14291
>
14292
    target file from the <TT
14293
CLASS="literal"
14294
>file.input</TT
14295
> source file,
14296
    you can give the <TT
14297
CLASS="literal"
14298
>.foo</TT
14299
>
14300
    and <TT
14301
CLASS="literal"
14302
>.input</TT
14303
> suffixes to the <CODE
14304
CLASS="classname"
14305
>Builder</CODE
14306
>,
14307
    making for more compact and readable calls to
14308
    the <TT
14309
CLASS="literal"
14310
>Foo</TT
14311
> <CODE
14312
CLASS="classname"
14313
>Builder</CODE
14314
>:
14315
14316
    </P
14317
><PRE
14318
CLASS="programlisting"
14319
>&#13;       bld = Builder(action = 'foobuild &#60; $SOURCE &#62; $TARGET',
14320
                     suffix = '.foo',
14321
                     src_suffix = '.input')
14322
       env = Environment(BUILDERS = {'Foo' : bld})
14323
       env.Foo('file1')
14324
       env.Foo('file2')
14325
    </PRE
14326
><PRE
14327
CLASS="screen"
14328
>&#13;      % <KBD
14329
CLASS="userinput"
14330
>scons -Q</KBD
14331
>
14332
      foobuild &#60; file1.input &#62; file1.foo
14333
      foobuild &#60; file2.input &#62; file2.foo
14334
    </PRE
14335
><P
14336
>&#13;
14337
    You can also supply a <TT
14338
CLASS="literal"
14339
>prefix</TT
14340
> keyword argument
14341
    if it's appropriate to have <SPAN
14342
CLASS="application"
14343
>SCons</SPAN
14344
> append a prefix
14345
    to the beginning of target file names.
14346
14347
    </P
14348
></DIV
14349
><DIV
14350
CLASS="section"
14351
><HR><H2
14352
CLASS="section"
14353
><A
14354
NAME="AEN2600"
14355
>17.4. Builders That Execute Python Functions</A
14356
></H2
14357
><P
14358
>&#13;
14359
    In <SPAN
14360
CLASS="application"
14361
>SCons</SPAN
14362
>, you don't have to call an external command
14363
    to build a file.
14364
    You can, instead, define a Python function
14365
    that a <CODE
14366
CLASS="classname"
14367
>Builder</CODE
14368
> object can invoke
14369
    to build your target file (or files).
14370
    Such a <TT
14371
CLASS="literal"
14372
>builder function</TT
14373
> definition looks like:
14374
14375
    </P
14376
><PRE
14377
CLASS="programlisting"
14378
>&#13;       def build_function(target, source, env):
14379
           # Code to build "target" from "source"
14380
           return None
14381
    </PRE
14382
><P
14383
>&#13;
14384
    The arguments of a <TT
14385
CLASS="literal"
14386
>builder function</TT
14387
> are:
14388
14389
    </P
14390
><P
14391
></P
14392
><DIV
14393
CLASS="variablelist"
14394
><DL
14395
><DT
14396
>target</DT
14397
><DD
14398
><P
14399
>&#13;
14400
      A list of Node objects representing
14401
      the target or targets to be
14402
      built by this builder function.
14403
      The file names of these target(s)
14404
      may be extracted using the Python <CODE
14405
CLASS="function"
14406
>str</CODE
14407
> function.
14408
14409
      </P
14410
></DD
14411
><DT
14412
>source</DT
14413
><DD
14414
><P
14415
>&#13;
14416
      A list of Node objects representing
14417
      the sources to be
14418
      used by this builder function to build the targets.
14419
      The file names of these source(s)
14420
      may be extracted using the Python <CODE
14421
CLASS="function"
14422
>str</CODE
14423
> function.
14424
14425
      </P
14426
></DD
14427
><DT
14428
>env</DT
14429
><DD
14430
><P
14431
>&#13;
14432
      The <TT
14433
CLASS="literal"
14434
>construction environment</TT
14435
> used for building the target(s).
14436
      The builder function may use any of the
14437
      environment's construction variables
14438
      in any way to affect how it builds the targets.
14439
14440
      </P
14441
></DD
14442
></DL
14443
></DIV
14444
><P
14445
>&#13;
14446
    The builder function must
14447
    return a <TT
14448
CLASS="literal"
14449
>0</TT
14450
> or <TT
14451
CLASS="literal"
14452
>None</TT
14453
> value
14454
    if the target(s) are built successfully.
14455
    The builder function
14456
    may raise an exception
14457
    or return any non-zero value
14458
    to indicate that the build is unsuccessful,
14459
14460
    </P
14461
><P
14462
>&#13;
14463
    Once you've defined the Python function
14464
    that will build your target file,
14465
    defining a <CODE
14466
CLASS="classname"
14467
>Builder</CODE
14468
> object for it is as
14469
    simple as specifying the name of the function,
14470
    instead of an external command,
14471
    as the <CODE
14472
CLASS="classname"
14473
>Builder</CODE
14474
>'s
14475
    <TT
14476
CLASS="literal"
14477
>action</TT
14478
>
14479
    argument:
14480
14481
    </P
14482
><PRE
14483
CLASS="programlisting"
14484
>&#13;       def build_function(target, source, env):
14485
           # Code to build "target" from "source"
14486
           return None
14487
       bld = Builder(action = build_function,
14488
                     suffix = '.foo',
14489
                     src_suffix = '.input')
14490
       env = Environment(BUILDERS = {'Foo' : bld})
14491
       env.Foo('file')
14492
    </PRE
14493
><P
14494
>&#13;
14495
    And notice that the output changes slightly,
14496
    reflecting the fact that a Python function,
14497
    not an external command,
14498
    is now called to build the target file:
14499
14500
    </P
14501
><PRE
14502
CLASS="screen"
14503
>&#13;      % <KBD
14504
CLASS="userinput"
14505
>scons -Q</KBD
14506
>
14507
      build_function(["file.foo"], ["file.input"])
14508
    </PRE
14509
></DIV
14510
><DIV
14511
CLASS="section"
14512
><HR><H2
14513
CLASS="section"
14514
><A
14515
NAME="AEN2636"
14516
>17.5. Builders That Create Actions Using a <TT
14517
CLASS="literal"
14518
>Generator</TT
14519
></A
14520
></H2
14521
><P
14522
>&#13;
14523
    <SPAN
14524
CLASS="application"
14525
>SCons</SPAN
14526
> Builder objects can create an action "on the fly"
14527
    by using a function called a <TT
14528
CLASS="literal"
14529
>generator</TT
14530
>.
14531
    This provides a great deal of flexibility to
14532
    construct just the right list of commands
14533
    to build your target.
14534
    A <TT
14535
CLASS="literal"
14536
>generator</TT
14537
> looks like:
14538
14539
    </P
14540
><PRE
14541
CLASS="programlisting"
14542
>&#13;       def generate_actions(source, target, env, for_signature):
14543
           return 'foobuild &#60; %s &#62; %s' % (target[0], source[0])
14544
    </PRE
14545
><P
14546
>&#13;
14547
    The arguments of a <TT
14548
CLASS="literal"
14549
>generator</TT
14550
> are:
14551
14552
    </P
14553
><P
14554
></P
14555
><DIV
14556
CLASS="variablelist"
14557
><DL
14558
><DT
14559
>source</DT
14560
><DD
14561
><P
14562
>&#13;
14563
      A list of Node objects representing
14564
      the sources to be built
14565
      by the command or other action
14566
      generated by this function.
14567
      The file names of these source(s)
14568
      may be extracted using the Python <CODE
14569
CLASS="function"
14570
>str</CODE
14571
> function.
14572
14573
      </P
14574
></DD
14575
><DT
14576
>target</DT
14577
><DD
14578
><P
14579
>&#13;
14580
      A list of Node objects representing
14581
      the target or targets to be built
14582
      by the command or other action
14583
      generated by this function.
14584
      The file names of these target(s)
14585
      may be extracted using the Python <CODE
14586
CLASS="function"
14587
>str</CODE
14588
> function.
14589
14590
      </P
14591
></DD
14592
><DT
14593
>env</DT
14594
><DD
14595
><P
14596
>&#13;
14597
      The <TT
14598
CLASS="literal"
14599
>construction environment</TT
14600
> used for building the target(s).
14601
      The generator may use any of the
14602
      environment's construction variables
14603
      in any way to determine what command
14604
      or other action to return.
14605
14606
      </P
14607
></DD
14608
><DT
14609
>for_signature</DT
14610
><DD
14611
><P
14612
>&#13;
14613
      A flag that specifies whether the
14614
      generator is being called to contribute to a build signature,
14615
      as opposed to actually executing the command.
14616
14617
      
14618
14619
      </P
14620
></DD
14621
></DL
14622
></DIV
14623
><P
14624
>&#13;
14625
    The <TT
14626
CLASS="literal"
14627
>generator</TT
14628
> must return a
14629
    command string or other action that will be used to
14630
    build the specified target(s) from the specified source(s).
14631
14632
    </P
14633
><P
14634
>&#13;
14635
    Once you've defined a <TT
14636
CLASS="literal"
14637
>generator</TT
14638
>,
14639
    you create a <CODE
14640
CLASS="classname"
14641
>Builder</CODE
14642
> to use it
14643
    by specifying the generator keyword argument
14644
    instead of <TT
14645
CLASS="literal"
14646
>action</TT
14647
>.
14648
14649
    </P
14650
><PRE
14651
CLASS="programlisting"
14652
>&#13;       def generate_actions(source, target, env, for_signature):
14653
           return 'foobuild &#60; %s &#62; %s' % (source[0], target[0])
14654
       bld = Builder(generator = generate_actions,
14655
                     suffix = '.foo',
14656
                     src_suffix = '.input')
14657
       env = Environment(BUILDERS = {'Foo' : bld})
14658
       env.Foo('file')
14659
    </PRE
14660
><PRE
14661
CLASS="screen"
14662
>&#13;      % <KBD
14663
CLASS="userinput"
14664
>scons -Q</KBD
14665
>
14666
      foobuild &#60; file.input &#62; file.foo
14667
    </PRE
14668
><P
14669
>&#13;
14670
    Note that it's illegal to specify both an
14671
    <TT
14672
CLASS="literal"
14673
>action</TT
14674
>
14675
    and a
14676
    <TT
14677
CLASS="literal"
14678
>generator</TT
14679
>
14680
    for a <CODE
14681
CLASS="classname"
14682
>Builder</CODE
14683
>.
14684
14685
    </P
14686
></DIV
14687
><DIV
14688
CLASS="section"
14689
><HR><H2
14690
CLASS="section"
14691
><A
14692
NAME="AEN2679"
14693
>17.6. Builders That Modify the Target or Source Lists Using an <TT
14694
CLASS="literal"
14695
>Emitter</TT
14696
></A
14697
></H2
14698
><P
14699
>&#13;
14700
    <SPAN
14701
CLASS="application"
14702
>SCons</SPAN
14703
> supports the ability for a Builder to modify the
14704
    lists of target(s) from the specified source(s).
14705
14706
    </P
14707
><PRE
14708
CLASS="programlisting"
14709
>&#13;       def modify_targets(target, source, env):
14710
           target.append('new_target')
14711
           source.append('new_source')
14712
           return target, source
14713
       bld = Builder(action = 'foobuild $TARGETS - $SOURCES',
14714
                     suffix = '.foo',
14715
                     src_suffix = '.input',
14716
                     emitter = modify_targets)
14717
       env = Environment(BUILDERS = {'Foo' : bld})
14718
       env.Foo('file')
14719
    </PRE
14720
><PRE
14721
CLASS="screen"
14722
>&#13;      % <KBD
14723
CLASS="userinput"
14724
>scons -Q</KBD
14725
>
14726
      foobuild file.foo new_target - file.input new_source
14727
    </PRE
14728
><PRE
14729
CLASS="programlisting"
14730
>&#13;       bld = Builder(action = 'my_command',
14731
                     suffix = '.foo',
14732
                     src_suffix = '.input',
14733
                     emitter = 'MY_EMITTER')
14734
       def modify1(target, source, env):
14735
           return target, source
14736
       def modify2(target, source, env):
14737
           return target, source
14738
       env1 = Environment(BUILDERS = {'Foo' : bld},
14739
                          MY_EMITTER = modify1)
14740
       env2 = Environment(BUILDERS = {'Foo' : bld},
14741
                          MY_EMITTER = modify2)
14742
       env1.Foo('file1')
14743
       env2.Foo('file2')
14744
    </PRE
14745
></DIV
14746
></DIV
14747
><DIV
14748
CLASS="chapter"
14749
><HR><H1
14750
><A
14751
NAME="chap-builders-commands"
14752
></A
14753
>Chapter 18. Not Writing a Builder:  the <CODE
14754
CLASS="function"
14755
>Command</CODE
14756
> Builder</H1
14757
><P
14758
>&#13;
14759
  Creating a <CODE
14760
CLASS="classname"
14761
>Builder</CODE
14762
> and attaching it to a <TT
14763
CLASS="literal"
14764
>construction environment</TT
14765
>
14766
  allows for a lot of flexibility when you
14767
  want to re-use actions
14768
  to build multiple files of the same type.
14769
  This can, however, be cumbersome
14770
  if you only need to execute one specific command
14771
  to build a single file (or group of files).
14772
  For these situations, <SPAN
14773
CLASS="application"
14774
>SCons</SPAN
14775
> supports a
14776
  <CODE
14777
CLASS="function"
14778
>Command</CODE
14779
> <CODE
14780
CLASS="classname"
14781
>Builder</CODE
14782
> that arranges
14783
  for a specific action to be executed
14784
  to build a specific file or files.
14785
  This looks a lot like the other builders
14786
  (like <A
14787
HREF="#b-Program"
14788
><CODE
14789
CLASS="function"
14790
>Program</CODE
14791
></A
14792
>, <A
14793
HREF="#b-Object"
14794
><CODE
14795
CLASS="function"
14796
>Object</CODE
14797
></A
14798
>, etc.),
14799
  but takes as an additional argument
14800
  the command to be executed to build the file:
14801
14802
  </P
14803
><PRE
14804
CLASS="programlisting"
14805
>&#13;     env = Environment()
14806
     env.Command('foo.out', 'foo.in', "sed 's/x/y/' &#60; $SOURCE &#62; $TARGET")
14807
  </PRE
14808
><P
14809
>&#13;
14810
  When executed,
14811
  <SPAN
14812
CLASS="application"
14813
>SCons</SPAN
14814
> runs the specified command,
14815
  substituting <A
14816
HREF="#cv-SOURCE"
14817
><CODE
14818
CLASS="envar"
14819
>$SOURCE</CODE
14820
></A
14821
> and <A
14822
HREF="#cv-TARGET"
14823
><CODE
14824
CLASS="envar"
14825
>$TARGET</CODE
14826
></A
14827
>
14828
  as expected:
14829
14830
  </P
14831
><PRE
14832
CLASS="screen"
14833
>&#13;    % <KBD
14834
CLASS="userinput"
14835
>scons -Q</KBD
14836
>
14837
    sed 's/x/y/' &#60; foo.in &#62; foo.out
14838
  </PRE
14839
><P
14840
>&#13;
14841
  This is often more convenient than
14842
  creating a <CODE
14843
CLASS="classname"
14844
>Builder</CODE
14845
> object
14846
  and adding it to the <A
14847
HREF="#cv-BUILDERS"
14848
><CODE
14849
CLASS="envar"
14850
>$BUILDERS</CODE
14851
></A
14852
> variable
14853
  of a <TT
14854
CLASS="literal"
14855
>construction environment</TT
14856
>
14857
14858
  </P
14859
><P
14860
>&#13;
14861
  Note that the action you specify to the
14862
  <CODE
14863
CLASS="function"
14864
>Command</CODE
14865
> <CODE
14866
CLASS="classname"
14867
>Builder</CODE
14868
> can be any legal <SPAN
14869
CLASS="application"
14870
>SCons</SPAN
14871
> <CODE
14872
CLASS="classname"
14873
>Action</CODE
14874
>,
14875
  such as a Python function:
14876
14877
  </P
14878
><PRE
14879
CLASS="programlisting"
14880
>&#13;     env = Environment()
14881
     def build(target, source, env):
14882
         # Whatever it takes to build
14883
         return None
14884
     env.Command('foo.out', 'foo.in', build)
14885
  </PRE
14886
><P
14887
>&#13;
14888
  Which executes as follows:
14889
14890
  </P
14891
><PRE
14892
CLASS="screen"
14893
>&#13;    % <KBD
14894
CLASS="userinput"
14895
>scons -Q</KBD
14896
>
14897
    build(["foo.out"], ["foo.in"])
14898
  </PRE
14899
></DIV
14900
><DIV
14901
CLASS="chapter"
14902
><HR><H1
14903
><A
14904
NAME="chap-add-method"
14905
></A
14906
>Chapter 19. Pseudo-Builders:  the AddMethod function</H1
14907
><P
14908
>&#13;
14909
  The env.AddMethod(function, [name]) function is used to add a method
14910
  to an environment.  It's typically used to add a "pseudo-builder" or
14911
  wrap up a call to multiple builders.  In the first example, we want
14912
  to install the program into the standard bin dir, but also copy it
14913
  into a local install/bin dir that might be used to build a package
14914
  from.
14915
14916
  </P
14917
><PRE
14918
CLASS="programlisting"
14919
>&#13;     def install_in_bin_dirs(env, source):
14920
         """Install source in both bin dirs"""
14921
         i1 = env.Install("$BIN", source)
14922
         i2 = env.Install("$LOCALBIN", source)
14923
         return [i1[0], i2][0] # Return a list, like a normal builder
14924
     env = Environment(BIN='/usr/bin', LOCALBIN='#install/bin')
14925
     env.AddMethod(install_in_bin_dirs, "InstallInBinDirs")
14926
     env.InstallInBinDirs(Program('hello.c')) # installs hello in both bin dirs     
14927
  </PRE
14928
><P
14929
>&#13;  This produces the following:
14930
  </P
14931
><PRE
14932
CLASS="screen"
14933
>&#13;    % <KBD
14934
CLASS="userinput"
14935
>scons -Q</KBD
14936
>
14937
    cc -o hello.o -c hello.c
14938
    cc -o hello hello.o
14939
    Install file: "hello" as "install/bin/hello"
14940
  </PRE
14941
><P
14942
>&#13;
14943
  It also gives more flexibility in parsing arguments than you can get
14944
  with a builder.  The next example shows a pseudo-builder with a
14945
  named argument that modifies the filename, and a separate argument
14946
  for the resource file (rather than having the builder figure it out
14947
  by file extension).  Also this example demonstrates using the global
14948
  AddMethod function to add a method to the global Environment class,
14949
  so it will be used in all subsequently created environments.
14950
14951
  </P
14952
><PRE
14953
CLASS="programlisting"
14954
>&#13;     import sys
14955
     def BuildTestProg(env, testfile, resourcefile, testdir="tests"):
14956
         """Build the test program;
14957
         prepends "test_" to src and target, and puts target into testdir."""
14958
         srcfile="test_%s.c"%testfile
14959
         if sys.platform=='win32':
14960
             target="%s/test_%s$EXESUFFIX"%(testdir,[testfile, resourcefile])
14961
         else:
14962
             target="%s/test_%s$EXESUFFIX"%(testdir,testfile)
14963
         p = env.Program(target, srcfile)
14964
         return p
14965
     AddMethod(Environment, BuildTestProg)
14966
14967
     # Now use it
14968
     env=Environment()
14969
     env.BuildTestProg('stuff', resourcefile='res.rc')
14970
  </PRE
14971
><P
14972
>&#13;  This produces the following (on Linux, anyway; Windows would include the
14973
  resource file):
14974
  </P
14975
><PRE
14976
CLASS="screen"
14977
>&#13;    % <KBD
14978
CLASS="userinput"
14979
>scons -Q</KBD
14980
>
14981
    cc -o test_stuff.o -c test_stuff.c
14982
    cc -o tests/test_stuff test_stuff.o
14983
  </PRE
14984
></DIV
14985
><DIV
14986
CLASS="chapter"
14987
><HR><H1
14988
><A
14989
NAME="chap-scanners"
14990
></A
14991
>Chapter 20. Writing Scanners</H1
14992
><P
14993
>&#13;
14994
    <SPAN
14995
CLASS="application"
14996
>SCons</SPAN
14997
> has built-in scanners that know how to look in
14998
    C, Fortran and IDL source files for information about
14999
    other files that targets built from those files depend on--for example,
15000
    in the case of files that use the C preprocessor,
15001
    the <TT
15002
CLASS="filename"
15003
>.h</TT
15004
> files that are specified
15005
    using <TT
15006
CLASS="literal"
15007
>#include</TT
15008
> lines in the source.
15009
    You can use the same mechanisms that <SPAN
15010
CLASS="application"
15011
>SCons</SPAN
15012
> uses to create
15013
    its built-in scanners to write scanners of your own for file types
15014
    that <SPAN
15015
CLASS="application"
15016
>SCons</SPAN
15017
> does not know how to scan "out of the box."
15018
15019
  </P
15020
><DIV
15021
CLASS="section"
15022
><HR><H2
15023
CLASS="section"
15024
><A
15025
NAME="AEN2744"
15026
>20.1. A Simple Scanner Example</A
15027
></H2
15028
><P
15029
>&#13;
15030
      Suppose, for example, that we want to create a simple scanner
15031
      for <TT
15032
CLASS="filename"
15033
>.foo</TT
15034
> files.
15035
      A <TT
15036
CLASS="filename"
15037
>.foo</TT
15038
> file contains some text that
15039
      will be processed,
15040
      and can include other files on lines that begin
15041
      with <TT
15042
CLASS="literal"
15043
>include</TT
15044
>
15045
      followed by a file name:
15046
15047
    </P
15048
><PRE
15049
CLASS="programlisting"
15050
>&#13;      include filename.foo
15051
    </PRE
15052
><P
15053
>&#13;
15054
      Scanning a file will be handled by a Python function
15055
      that you must supply.
15056
      Here is a function that will use the Python
15057
      <TT
15058
CLASS="filename"
15059
>re</TT
15060
> module
15061
      to scan for the <TT
15062
CLASS="literal"
15063
>include</TT
15064
> lines in our example:
15065
15066
    </P
15067
><PRE
15068
CLASS="programlisting"
15069
>&#13;      import re
15070
      
15071
      include_re = re.compile(r'^include\s+(\S+)$', re.M)
15072
      
15073
      def kfile_scan(node, env, path, arg):
15074
          contents = node.get_contents()
15075
          return include_re.findall(contents)
15076
    </PRE
15077
><P
15078
>&#13;
15079
      The scanner function must
15080
      accept the four specified arguments
15081
      and return a list of implicit dependencies.
15082
      Presumably, these would be dependencies found
15083
      from examining the contents of the file,
15084
      although the function can perform any
15085
      manipulation at all to generate the list of
15086
      dependencies.
15087
15088
    </P
15089
><P
15090
></P
15091
><DIV
15092
CLASS="variablelist"
15093
><DL
15094
><DT
15095
>node</DT
15096
><DD
15097
><P
15098
>&#13;
15099
      An <SPAN
15100
CLASS="application"
15101
>SCons</SPAN
15102
> node object representing the file being scanned.
15103
      The path name to the file can be
15104
      used by converting the node to a string
15105
      using the <TT
15106
CLASS="literal"
15107
>str()</TT
15108
> function,
15109
      or an internal <SPAN
15110
CLASS="application"
15111
>SCons</SPAN
15112
> <TT
15113
CLASS="literal"
15114
>get_contents()</TT
15115
>
15116
      object method can be used to fetch the contents.
15117
15118
      </P
15119
></DD
15120
><DT
15121
>env</DT
15122
><DD
15123
><P
15124
>&#13;
15125
      The construction environment in effect for this scan.
15126
      The scanner function may choose to use construction
15127
      variables from this environment to affect its behavior.
15128
15129
      </P
15130
></DD
15131
><DT
15132
>path</DT
15133
><DD
15134
><P
15135
>&#13;
15136
      A list of directories that form the search path for included files
15137
      for this scanner.
15138
      This is how <SPAN
15139
CLASS="application"
15140
>SCons</SPAN
15141
> handles the <A
15142
HREF="#cv-CPPPATH"
15143
><CODE
15144
CLASS="envar"
15145
>$CPPPATH</CODE
15146
></A
15147
> and <A
15148
HREF="#cv-LIBPATH"
15149
><CODE
15150
CLASS="envar"
15151
>$LIBPATH</CODE
15152
></A
15153
>
15154
      variables.
15155
15156
      </P
15157
></DD
15158
><DT
15159
>arg</DT
15160
><DD
15161
><P
15162
>&#13;
15163
      An optional argument that you can choose to
15164
      have passed to this scanner function by
15165
      various scanner instances.
15166
15167
      </P
15168
></DD
15169
></DL
15170
></DIV
15171
><P
15172
>&#13;
15173
    A Scanner object is created using the <CODE
15174
CLASS="classname"
15175
>Scanner</CODE
15176
> function,
15177
    which typically takes an <TT
15178
CLASS="literal"
15179
>skeys</TT
15180
> argument
15181
    to associate the type of file suffix with this scanner.
15182
    The Scanner object must then be associated with the
15183
    <A
15184
HREF="#cv-SCANNERS"
15185
><CODE
15186
CLASS="envar"
15187
>$SCANNERS</CODE
15188
></A
15189
> construction variable of a construction environment,
15190
    typically by using the <CODE
15191
CLASS="function"
15192
>Append</CODE
15193
> method:
15194
15195
    </P
15196
><PRE
15197
CLASS="programlisting"
15198
>&#13;       kscan = Scanner(function = kfile_scan,
15199
                       skeys = ['.k'])
15200
       env.Append(SCANNERS = kscan)
15201
    </PRE
15202
><P
15203
>&#13;
15204
    When we put it all together, it looks like:
15205
15206
    </P
15207
><PRE
15208
CLASS="programlisting"
15209
>&#13;        import re
15210
15211
        include_re = re.compile(r'^include\s+(\S+)$', re.M)
15212
15213
        def kfile_scan(node, env, path):
15214
            contents = node.get_contents()
15215
            includes = include_re.findall(contents)
15216
            return includes
15217
15218
        kscan = Scanner(function = kfile_scan,
15219
                        skeys = ['.k'])
15220
15221
        env = Environment(ENV = {'PATH' : '/usr/local/bin'})
15222
        env.Append(SCANNERS = kscan)
15223
15224
        env.Command('foo', 'foo.k', 'kprocess &#60; $SOURCES &#62; $TARGET')
15225
    </PRE
15226
></DIV
15227
></DIV
15228
><DIV
15229
CLASS="chapter"
15230
><HR><H1
15231
><A
15232
NAME="chap-repositories"
15233
></A
15234
>Chapter 21. Building From Code Repositories</H1
15235
><P
15236
>&#13;
15237
  Often, a software project will have
15238
  one or more central repositories,
15239
  directory trees that contain
15240
  source code, or derived files, or both.
15241
  You can eliminate additional unnecessary
15242
  rebuilds of files by having <SPAN
15243
CLASS="application"
15244
>SCons</SPAN
15245
>
15246
  use files from one or more code repositories
15247
  to build files in your local build tree.
15248
15249
  </P
15250
><DIV
15251
CLASS="section"
15252
><HR><H2
15253
CLASS="section"
15254
><A
15255
NAME="AEN2795"
15256
>21.1. The <CODE
15257
CLASS="function"
15258
>Repository</CODE
15259
> Method</A
15260
></H2
15261
><P
15262
>&#13;
15263
    It's often useful to allow multiple programmers working
15264
    on a project to build software from
15265
    source files and/or derived files that
15266
    are stored in a centrally-accessible repository,
15267
    a directory copy of the source code tree.
15268
    (Note that this is not the sort of repository
15269
    maintained by a source code management system
15270
    like BitKeeper, CVS, or Subversion.)
15271
    
15272
    You use the <CODE
15273
CLASS="function"
15274
>Repository</CODE
15275
> method
15276
    to tell <SPAN
15277
CLASS="application"
15278
>SCons</SPAN
15279
> to search one or more
15280
    central code repositories (in order)
15281
    for any source files and derived files
15282
    that are not present in the local build tree:
15283
15284
    </P
15285
><PRE
15286
CLASS="programlisting"
15287
>&#13;       env = Environment()
15288
       env.Program('hello.c')
15289
       Repository('/usr/repository1', '/usr/repository2')
15290
    </PRE
15291
><P
15292
>&#13;
15293
    Multiple calls to the <CODE
15294
CLASS="function"
15295
>Repository</CODE
15296
> method
15297
    will simply add repositories to the global list
15298
    that <SPAN
15299
CLASS="application"
15300
>SCons</SPAN
15301
> maintains,
15302
    with the exception that <SPAN
15303
CLASS="application"
15304
>SCons</SPAN
15305
> will automatically eliminate
15306
    the current directory and any non-existent
15307
    directories from the list.
15308
15309
    </P
15310
></DIV
15311
><DIV
15312
CLASS="section"
15313
><HR><H2
15314
CLASS="section"
15315
><A
15316
NAME="AEN2806"
15317
>21.2. Finding source files in repositories</A
15318
></H2
15319
><P
15320
>&#13;
15321
    The above example
15322
    specifies that <SPAN
15323
CLASS="application"
15324
>SCons</SPAN
15325
>
15326
    will first search for files under
15327
    the <TT
15328
CLASS="filename"
15329
>/usr/repository1</TT
15330
> tree
15331
    and next under the <TT
15332
CLASS="filename"
15333
>/usr/repository2</TT
15334
> tree.
15335
    <SPAN
15336
CLASS="application"
15337
>SCons</SPAN
15338
> expects that any files it searches
15339
    for will be found in the same position
15340
    relative to the top-level directory.
15341
    In the above example, if the <TT
15342
CLASS="filename"
15343
>hello.c</TT
15344
> file is not
15345
    found in the local build tree,
15346
    <SPAN
15347
CLASS="application"
15348
>SCons</SPAN
15349
> will search first for
15350
    a <TT
15351
CLASS="filename"
15352
>/usr/repository1/hello.c</TT
15353
> file
15354
    and then for a <TT
15355
CLASS="filename"
15356
>/usr/repository2/hello.c</TT
15357
> file
15358
    to use in its place.
15359
15360
    </P
15361
><P
15362
>&#13;
15363
    So given the <TT
15364
CLASS="filename"
15365
>SConstruct</TT
15366
> file above,
15367
    if the <TT
15368
CLASS="filename"
15369
>hello.c</TT
15370
> file exists in the local
15371
    build directory,
15372
    <SPAN
15373
CLASS="application"
15374
>SCons</SPAN
15375
> will rebuild the <SPAN
15376
CLASS="application"
15377
>hello</SPAN
15378
> program
15379
    as normal:
15380
15381
    </P
15382
><PRE
15383
CLASS="screen"
15384
>&#13;      % <KBD
15385
CLASS="userinput"
15386
>scons -Q</KBD
15387
>
15388
      cc -o hello.o -c hello.c
15389
      cc -o hello hello.o
15390
    </PRE
15391
><P
15392
>&#13;
15393
    If, however, there is no local <TT
15394
CLASS="filename"
15395
>hello.c</TT
15396
> file,
15397
    but one exists in <TT
15398
CLASS="filename"
15399
>/usr/repository1</TT
15400
>,
15401
    <SPAN
15402
CLASS="application"
15403
>SCons</SPAN
15404
> will recompile the <SPAN
15405
CLASS="application"
15406
>hello</SPAN
15407
> program
15408
    from the source file it finds in the repository:
15409
15410
    </P
15411
><PRE
15412
CLASS="screen"
15413
>&#13;      % <KBD
15414
CLASS="userinput"
15415
>scons -Q</KBD
15416
>
15417
      cc -o hello.o -c /usr/repository1/hello.c
15418
      cc -o hello hello.o
15419
    </PRE
15420
><P
15421
>&#13;
15422
    And similarly, if there is no local <TT
15423
CLASS="filename"
15424
>hello.c</TT
15425
> file
15426
    and no <TT
15427
CLASS="filename"
15428
>/usr/repository1/hello.c</TT
15429
>,
15430
    but one exists in <TT
15431
CLASS="filename"
15432
>/usr/repository2</TT
15433
>:
15434
15435
    </P
15436
><PRE
15437
CLASS="screen"
15438
>&#13;      % <KBD
15439
CLASS="userinput"
15440
>scons -Q</KBD
15441
>
15442
      cc -o hello.o -c /usr/repository2/hello.c
15443
      cc -o hello hello.o
15444
    </PRE
15445
><P
15446
>&#13;
15447
    </P
15448
></DIV
15449
><DIV
15450
CLASS="section"
15451
><HR><H2
15452
CLASS="section"
15453
><A
15454
NAME="AEN2838"
15455
>21.3. Finding <TT
15456
CLASS="literal"
15457
>#include</TT
15458
> files in repositories</A
15459
></H2
15460
><P
15461
>&#13;
15462
    We've already seen that SCons will scan the contents of
15463
    a source file for <TT
15464
CLASS="literal"
15465
>#include</TT
15466
> file names
15467
    and realize that targets built from that source file
15468
    also depend on the <TT
15469
CLASS="literal"
15470
>#include</TT
15471
> file(s).
15472
    For each directory in the <A
15473
HREF="#cv-CPPPATH"
15474
><CODE
15475
CLASS="envar"
15476
>$CPPPATH</CODE
15477
></A
15478
> list,
15479
    <SPAN
15480
CLASS="application"
15481
>SCons</SPAN
15482
> will actually search the corresponding directories
15483
    in any repository trees and establish the
15484
    correct dependencies on any
15485
    <TT
15486
CLASS="literal"
15487
>#include</TT
15488
> files that it finds
15489
    in repository directory.
15490
15491
    </P
15492
><P
15493
>&#13;
15494
    Unless the C compiler also knows about these directories
15495
    in the repository trees, though,
15496
    it will be unable to find the <TT
15497
CLASS="literal"
15498
>#include</TT
15499
> files.
15500
    If, for example, the <TT
15501
CLASS="filename"
15502
>hello.c</TT
15503
> file in
15504
    our previous example includes the <SPAN
15505
CLASS="application"
15506
>hello</SPAN
15507
>.h;
15508
    in its current directory,
15509
    and the <SPAN
15510
CLASS="application"
15511
>hello</SPAN
15512
>.h; only exists in the repository:
15513
15514
    </P
15515
><PRE
15516
CLASS="screen"
15517
>&#13;      % <KBD
15518
CLASS="userinput"
15519
>scons -Q</KBD
15520
>
15521
      cc -o hello.o -c hello.c
15522
      hello.c:1: hello.h: No such file or directory
15523
    </PRE
15524
><P
15525
>&#13;
15526
    In order to inform the C compiler about the repositories,
15527
    <SPAN
15528
CLASS="application"
15529
>SCons</SPAN
15530
> will add appropriate
15531
    <TT
15532
CLASS="literal"
15533
>-I</TT
15534
> flags to the compilation commands
15535
    for each directory in the <CODE
15536
CLASS="envar"
15537
>$CPPPATH</CODE
15538
> list.
15539
    So if we add the current directory to the
15540
    construction environment <CODE
15541
CLASS="envar"
15542
>$CPPPATH</CODE
15543
> like so:
15544
15545
    </P
15546
><PRE
15547
CLASS="programlisting"
15548
>&#13;       env = Environment(CPPPATH = ['.'])
15549
       env.Program('hello.c')
15550
       Repository('/usr/repository1')
15551
    </PRE
15552
><P
15553
>&#13;
15554
    Then re-executing <SPAN
15555
CLASS="application"
15556
>SCons</SPAN
15557
> yields:
15558
15559
    </P
15560
><PRE
15561
CLASS="screen"
15562
>&#13;      % <KBD
15563
CLASS="userinput"
15564
>scons -Q</KBD
15565
>
15566
      cc -o hello.o -c -I. -I/usr/repository1 hello.c
15567
      cc -o hello hello.o
15568
    </PRE
15569
><P
15570
>&#13;
15571
    The order of the <TT
15572
CLASS="literal"
15573
>-I</TT
15574
> options replicates,
15575
    for the C preprocessor,
15576
    the same repository-directory search path
15577
    that <SPAN
15578
CLASS="application"
15579
>SCons</SPAN
15580
> uses for its own dependency analysis.
15581
    If there are multiple repositories and multiple <CODE
15582
CLASS="envar"
15583
>$CPPPATH</CODE
15584
>
15585
    directories, <SPAN
15586
CLASS="application"
15587
>SCons</SPAN
15588
> will add the repository directories
15589
    to the beginning of each <CODE
15590
CLASS="envar"
15591
>$CPPPATH</CODE
15592
> directory,
15593
    rapidly multiplying the number of <TT
15594
CLASS="literal"
15595
>-I</TT
15596
> flags.
15597
    If, for example, the <CODE
15598
CLASS="envar"
15599
>$CPPPATH</CODE
15600
> contains three directories
15601
    (and shorter repository path names!):
15602
15603
    </P
15604
><PRE
15605
CLASS="programlisting"
15606
>&#13;       env = Environment(CPPPATH = ['dir1', 'dir2', 'dir3'])
15607
       env.Program('hello.c')
15608
       Repository('/r1', '/r2')
15609
    </PRE
15610
><P
15611
>&#13;
15612
    Then we'll end up with nine <TT
15613
CLASS="literal"
15614
>-I</TT
15615
> options
15616
    on the command line,
15617
    three (for each of the <CODE
15618
CLASS="envar"
15619
>$CPPPATH</CODE
15620
> directories)
15621
    times three (for the local directory plus the two repositories):
15622
15623
    </P
15624
><PRE
15625
CLASS="screen"
15626
>&#13;      % <KBD
15627
CLASS="userinput"
15628
>scons -Q</KBD
15629
>
15630
      cc -o hello.o -c -Idir1 -I/r1/dir1 -I/r2/dir1 -Idir2 -I/r1/dir2 -I/r2/dir2 -Idir3 -I/r1/dir3 -I/r2/dir3 hello.c
15631
      cc -o hello hello.o
15632
    </PRE
15633
><DIV
15634
CLASS="section"
15635
><HR><H3
15636
CLASS="section"
15637
><A
15638
NAME="AEN2879"
15639
>21.3.1. Limitations on <TT
15640
CLASS="literal"
15641
>#include</TT
15642
> files in repositories</A
15643
></H3
15644
><P
15645
>&#13;
15646
      <SPAN
15647
CLASS="application"
15648
>SCons</SPAN
15649
> relies on the C compiler's
15650
      <TT
15651
CLASS="literal"
15652
>-I</TT
15653
> options to control the order in which
15654
      the preprocessor will search the repository directories
15655
      for <TT
15656
CLASS="literal"
15657
>#include</TT
15658
> files.
15659
      This causes a problem, however, with how the C preprocessor
15660
      handles <TT
15661
CLASS="literal"
15662
>#include</TT
15663
> lines with
15664
      the file name included in double-quotes.
15665
15666
      </P
15667
><P
15668
>&#13;
15669
      As we've seen,
15670
      <SPAN
15671
CLASS="application"
15672
>SCons</SPAN
15673
> will compile the <TT
15674
CLASS="filename"
15675
>hello.c</TT
15676
> file from
15677
      the repository if it doesn't exist in
15678
      the local directory.
15679
      If, however, the <TT
15680
CLASS="filename"
15681
>hello.c</TT
15682
> file in the repository contains
15683
      a <TT
15684
CLASS="literal"
15685
>#include</TT
15686
> line with the file name in
15687
      double quotes:
15688
15689
      </P
15690
><PRE
15691
CLASS="programlisting"
15692
>&#13;        #include "hello.h"
15693
        int
15694
        main(int argc, char *argv[])
15695
        {
15696
            printf(HELLO_MESSAGE);
15697
            return (0);
15698
        }
15699
      </PRE
15700
><P
15701
>&#13;
15702
      Then the C preprocessor will <SPAN
15703
CLASS="emphasis"
15704
><I
15705
CLASS="emphasis"
15706
>always</I
15707
></SPAN
15708
>
15709
      use a <TT
15710
CLASS="filename"
15711
>hello.h</TT
15712
> file from the repository directory first,
15713
      even if there is a <TT
15714
CLASS="filename"
15715
>hello.h</TT
15716
> file in the local directory,
15717
      despite the fact that the command line specifies
15718
      <TT
15719
CLASS="literal"
15720
>-I</TT
15721
> as the first option:
15722
15723
      </P
15724
><PRE
15725
CLASS="screen"
15726
>&#13;        % <KBD
15727
CLASS="userinput"
15728
>scons -Q</KBD
15729
>
15730
        cc -o hello.o -c -I. -I/usr/repository1 /usr/repository1/hello.c
15731
        cc -o hello hello.o
15732
      </PRE
15733
><P
15734
>&#13;
15735
      This behavior of the C preprocessor--always search
15736
      for a <TT
15737
CLASS="literal"
15738
>#include</TT
15739
> file in double-quotes
15740
      first in the same directory as the source file,
15741
      and only then search the <TT
15742
CLASS="literal"
15743
>-I</TT
15744
>--can
15745
      not, in general, be changed.
15746
      In other words, it's a limitation
15747
      that must be lived with if you want to use
15748
      code repositories in this way.
15749
      There are three ways you can possibly
15750
      work around this C preprocessor behavior:
15751
15752
      </P
15753
><P
15754
></P
15755
><OL
15756
TYPE="1"
15757
><LI
15758
><P
15759
>&#13;
15760
        Some modern versions of C compilers do have an option
15761
        to disable or control this behavior.
15762
        If so, add that option to <A
15763
HREF="#cv-CFLAGS"
15764
><CODE
15765
CLASS="envar"
15766
>$CFLAGS</CODE
15767
></A
15768
>
15769
        (or <A
15770
HREF="#cv-CXXFLAGS"
15771
><CODE
15772
CLASS="envar"
15773
>$CXXFLAGS</CODE
15774
></A
15775
> or both) in your construction environment(s).
15776
        Make sure the option is used for all construction
15777
        environments that use C preprocessing!
15778
15779
        </P
15780
></LI
15781
><LI
15782
><P
15783
>&#13;
15784
        Change all occurrences of <TT
15785
CLASS="literal"
15786
>#include "file.h"</TT
15787
>
15788
        to <TT
15789
CLASS="literal"
15790
>#include &#60;file.h&#62;</TT
15791
>.
15792
        Use of <TT
15793
CLASS="literal"
15794
>#include</TT
15795
> with angle brackets
15796
        does not have the same behavior--the <TT
15797
CLASS="literal"
15798
>-I</TT
15799
>
15800
        directories are searched first
15801
        for <TT
15802
CLASS="literal"
15803
>#include</TT
15804
> files--which
15805
        gives <SPAN
15806
CLASS="application"
15807
>SCons</SPAN
15808
> direct control over the list of
15809
        directories the C preprocessor will search.
15810
15811
        </P
15812
></LI
15813
><LI
15814
><P
15815
>&#13;
15816
        Require that everyone working with compilation from
15817
        repositories check out and work on entire directories of files,
15818
        not individual files.
15819
        (If you use local wrapper scripts around
15820
        your source code control system's command,
15821
        you could add logic to enforce this restriction there.
15822
15823
        </P
15824
></LI
15825
></OL
15826
></DIV
15827
></DIV
15828
><DIV
15829
CLASS="section"
15830
><HR><H2
15831
CLASS="section"
15832
><A
15833
NAME="AEN2920"
15834
>21.4. Finding the <TT
15835
CLASS="filename"
15836
>SConstruct</TT
15837
> file in repositories</A
15838
></H2
15839
><P
15840
>&#13;
15841
    <SPAN
15842
CLASS="application"
15843
>SCons</SPAN
15844
> will also search in repositories
15845
    for the <TT
15846
CLASS="filename"
15847
>SConstruct</TT
15848
> file and any specified <TT
15849
CLASS="filename"
15850
>SConscript</TT
15851
> files.
15852
    This poses a problem, though:  how can <SPAN
15853
CLASS="application"
15854
>SCons</SPAN
15855
> search a
15856
    repository tree for an <TT
15857
CLASS="filename"
15858
>SConstruct</TT
15859
> file
15860
    if the <TT
15861
CLASS="filename"
15862
>SConstruct</TT
15863
> file itself contains the information
15864
    about the pathname of the repository?
15865
    To solve this problem, <SPAN
15866
CLASS="application"
15867
>SCons</SPAN
15868
> allows you
15869
    to specify repository directories
15870
    on the command line using the <TT
15871
CLASS="literal"
15872
>-Y</TT
15873
> option:
15874
15875
    </P
15876
><PRE
15877
CLASS="screen"
15878
>&#13;      % <KBD
15879
CLASS="userinput"
15880
>scons -Q -Y /usr/repository1 -Y /usr/repository2</KBD
15881
>
15882
    </PRE
15883
><P
15884
>&#13;
15885
    When looking for source or derived files,
15886
    <SPAN
15887
CLASS="application"
15888
>SCons</SPAN
15889
> will first search the repositories
15890
    specified on the command line,
15891
    and then search the repositories
15892
    specified in the <TT
15893
CLASS="filename"
15894
>SConstruct</TT
15895
> or <TT
15896
CLASS="filename"
15897
>SConscript</TT
15898
> files.
15899
15900
    </P
15901
></DIV
15902
><DIV
15903
CLASS="section"
15904
><HR><H2
15905
CLASS="section"
15906
><A
15907
NAME="AEN2938"
15908
>21.5. Finding derived files in repositories</A
15909
></H2
15910
><P
15911
>&#13;
15912
    If a repository contains not only source files,
15913
    but also derived files (such as object files,
15914
    libraries, or executables), <SPAN
15915
CLASS="application"
15916
>SCons</SPAN
15917
> will perform
15918
    its normal MD5 signature calculation to
15919
    decide if a derived file in a repository is up-to-date,
15920
    or the derived file must be rebuilt in the local build directory.
15921
    For the <SPAN
15922
CLASS="application"
15923
>SCons</SPAN
15924
> signature calculation to work correctly,
15925
    a repository tree must contain the <TT
15926
CLASS="filename"
15927
>.sconsign</TT
15928
> files
15929
    that <SPAN
15930
CLASS="application"
15931
>SCons</SPAN
15932
> uses to keep track of signature information.
15933
15934
    </P
15935
><P
15936
>&#13;
15937
    Usually, this would be done by a build integrator
15938
    who would run <SPAN
15939
CLASS="application"
15940
>SCons</SPAN
15941
> in the repository
15942
    to create all of its derived files and <TT
15943
CLASS="filename"
15944
>.sconsign</TT
15945
> files,
15946
    or who would run <SPAN
15947
CLASS="application"
15948
>SCons</SPAN
15949
> in a separate build directory
15950
    and copy the resulting tree to the desired repository:
15951
15952
    </P
15953
><PRE
15954
CLASS="screen"
15955
>&#13;      % <KBD
15956
CLASS="userinput"
15957
>cd /usr/repository1</KBD
15958
>
15959
      % <KBD
15960
CLASS="userinput"
15961
>scons -Q</KBD
15962
>
15963
      cc -o file1.o -c file1.c
15964
      cc -o file2.o -c file2.c
15965
      cc -o hello.o -c hello.c
15966
      cc -o hello hello.o file1.o file2.o
15967
    </PRE
15968
><P
15969
>&#13;    
15970
    (Note that this is safe even if the <TT
15971
CLASS="filename"
15972
>SConstruct</TT
15973
> file
15974
    lists <TT
15975
CLASS="filename"
15976
>/usr/repository1</TT
15977
> as a repository,
15978
    because <SPAN
15979
CLASS="application"
15980
>SCons</SPAN
15981
> will remove the current build directory
15982
    from its repository list for that invocation.)
15983
15984
    </P
15985
><P
15986
>&#13;
15987
    Now, with the repository populated,
15988
    we only need to create the one local source file
15989
    we're interested in working with at the moment,
15990
    and use the <TT
15991
CLASS="literal"
15992
>-Y</TT
15993
> option to
15994
    tell <SPAN
15995
CLASS="application"
15996
>SCons</SPAN
15997
> to fetch any other files it needs
15998
    from the repository:
15999
16000
    </P
16001
><PRE
16002
CLASS="screen"
16003
>&#13;      % <KBD
16004
CLASS="userinput"
16005
>cd $HOME/build</KBD
16006
>
16007
      % <KBD
16008
CLASS="userinput"
16009
>edit hello.c</KBD
16010
>
16011
      % <KBD
16012
CLASS="userinput"
16013
>scons -Q -Y /usr/repository1</KBD
16014
>
16015
      cc -c -o hello.o hello.c
16016
      cc -o hello hello.o /usr/repository1/file1.o /usr/repository1/file2.o
16017
    </PRE
16018
><P
16019
>&#13;
16020
    Notice that <SPAN
16021
CLASS="application"
16022
>SCons</SPAN
16023
> realizes that it does not need to
16024
    rebuild local copies <TT
16025
CLASS="filename"
16026
>file1.o</TT
16027
> and <TT
16028
CLASS="filename"
16029
>file2.o</TT
16030
> files,
16031
    but instead uses the already-compiled files
16032
    from the repository.
16033
16034
    </P
16035
></DIV
16036
><DIV
16037
CLASS="section"
16038
><HR><H2
16039
CLASS="section"
16040
><A
16041
NAME="AEN2967"
16042
>21.6. Guaranteeing local copies of files</A
16043
></H2
16044
><P
16045
>&#13;
16046
    If the repository tree contains the complete results of a build,
16047
    and we try to build from the repository
16048
    without any files in our local tree,
16049
    something moderately surprising happens:
16050
16051
    </P
16052
><PRE
16053
CLASS="screen"
16054
>&#13;      % <KBD
16055
CLASS="userinput"
16056
>mkdir $HOME/build2</KBD
16057
>
16058
      % <KBD
16059
CLASS="userinput"
16060
>cd $HOME/build2</KBD
16061
>
16062
      % <KBD
16063
CLASS="userinput"
16064
>scons -Q -Y /usr/all/repository hello</KBD
16065
>
16066
      scons: `hello' is up-to-date.
16067
    </PRE
16068
><P
16069
>&#13;
16070
    Why does <SPAN
16071
CLASS="application"
16072
>SCons</SPAN
16073
> say that the <SPAN
16074
CLASS="application"
16075
>hello</SPAN
16076
> program
16077
    is up-to-date when there is no <SPAN
16078
CLASS="application"
16079
>hello</SPAN
16080
> program
16081
    in the local build directory?
16082
    Because the repository (not the local directory)
16083
    contains the up-to-date <SPAN
16084
CLASS="application"
16085
>hello</SPAN
16086
> program,
16087
    and <SPAN
16088
CLASS="application"
16089
>SCons</SPAN
16090
> correctly determines that nothing
16091
    needs to be done to rebuild that
16092
    up-to-date copy of the file.
16093
16094
    </P
16095
><P
16096
>&#13;
16097
    There are, however, many times when you want to ensure that a
16098
    local copy of a file always exists.
16099
    A packaging or testing script, for example,
16100
    may assume that certain generated files exist locally.
16101
    To tell <SPAN
16102
CLASS="application"
16103
>SCons</SPAN
16104
> to make a copy of any up-to-date repository
16105
    file in the local build directory,
16106
    use the <CODE
16107
CLASS="function"
16108
>Local</CODE
16109
> function:
16110
16111
    </P
16112
><PRE
16113
CLASS="programlisting"
16114
>&#13;       env = Environment()
16115
       hello = env.Program('hello.c')
16116
       Local(hello)
16117
    </PRE
16118
><P
16119
>&#13;
16120
    If we then run the same command,
16121
    <SPAN
16122
CLASS="application"
16123
>SCons</SPAN
16124
> will make a local copy of the program
16125
    from the repository copy,
16126
    and tell you that it is doing so:
16127
16128
    </P
16129
><PRE
16130
CLASS="screen"
16131
>&#13;      % <KBD
16132
CLASS="userinput"
16133
>scons -Y /usr/all/repository hello</KBD
16134
>
16135
      Local copy of hello from /usr/all/repository/hello
16136
      scons: `hello' is up-to-date.
16137
    </PRE
16138
><P
16139
>&#13;
16140
    (Notice that, because the act of making the local copy
16141
    is not considered a "build" of the <SPAN
16142
CLASS="application"
16143
>hello</SPAN
16144
> file,
16145
    <SPAN
16146
CLASS="application"
16147
>SCons</SPAN
16148
> still reports that it is up-to-date.)
16149
16150
    </P
16151
></DIV
16152
></DIV
16153
><DIV
16154
CLASS="chapter"
16155
><HR><H1
16156
><A
16157
NAME="chap-sconf"
16158
></A
16159
>Chapter 22. Multi-Platform Configuration (<SPAN
16160
CLASS="application"
16161
>Autoconf</SPAN
16162
> Functionality)</H1
16163
><P
16164
>&#13;
16165
  <SPAN
16166
CLASS="application"
16167
>SCons</SPAN
16168
> has integrated support for multi-platform build configuration
16169
  similar to that offered by GNU <SPAN
16170
CLASS="application"
16171
>Autoconf</SPAN
16172
>,
16173
  such as
16174
  figuring out what libraries or header files
16175
  are available on the local system.
16176
  This section describes how to use
16177
  this <SPAN
16178
CLASS="application"
16179
>SCons</SPAN
16180
> feature.
16181
16182
  </P
16183
><DIV
16184
CLASS="note"
16185
><P
16186
></P
16187
><TABLE
16188
CLASS="note"
16189
WIDTH="100%"
16190
BORDER="0"
16191
><TR
16192
><TD
16193
WIDTH="25"
16194
ALIGN="CENTER"
16195
VALIGN="TOP"
16196
><IMG
16197
SRC="../images/note.gif"
16198
HSPACE="5"
16199
ALT="Note"></TD
16200
><TD
16201
ALIGN="LEFT"
16202
VALIGN="TOP"
16203
><P
16204
>&#13;  This chapter is still under development,
16205
  so not everything is explained as well as it should be.
16206
  See the <SPAN
16207
CLASS="application"
16208
>SCons</SPAN
16209
> man page for additional information.
16210
  </P
16211
></TD
16212
></TR
16213
></TABLE
16214
></DIV
16215
><DIV
16216
CLASS="section"
16217
><HR><H2
16218
CLASS="section"
16219
><A
16220
NAME="AEN3001"
16221
>22.1. <TT
16222
CLASS="literal"
16223
>Configure Contexts</TT
16224
></A
16225
></H2
16226
><P
16227
>&#13;
16228
    The basic framework for multi-platform build configuration
16229
    in <SPAN
16230
CLASS="application"
16231
>SCons</SPAN
16232
> is to attach a <TT
16233
CLASS="literal"
16234
>configure context</TT
16235
> to a
16236
    construction environment by calling the <CODE
16237
CLASS="function"
16238
>Configure</CODE
16239
> function,
16240
    perform a number of checks for
16241
    libraries, functions, header files, etc.,
16242
    and to then call the configure context's <CODE
16243
CLASS="function"
16244
>Finish</CODE
16245
> method
16246
    to finish off the configuration:
16247
16248
    </P
16249
><PRE
16250
CLASS="programlisting"
16251
>&#13;    env = Environment()
16252
    conf = Configure(env)
16253
    # Checks for libraries, header files, etc. go here!
16254
    env = conf.Finish()
16255
    </PRE
16256
><P
16257
>&#13;
16258
    <SPAN
16259
CLASS="application"
16260
>SCons</SPAN
16261
> provides a number of basic checks,
16262
    as well as a mechanism for adding your own custom checks.
16263
16264
    </P
16265
><P
16266
>&#13;
16267
    Note that <SPAN
16268
CLASS="application"
16269
>SCons</SPAN
16270
> uses its own dependency
16271
    mechanism to determine when a check
16272
    needs to be run--that is,
16273
    <SPAN
16274
CLASS="application"
16275
>SCons</SPAN
16276
> does not run the checks
16277
    every time it is invoked,
16278
    but caches the values returned by previous checks
16279
    and uses the cached values unless something has changed.
16280
    This saves a tremendous amount
16281
    of developer time while working on
16282
    cross-platform build issues.
16283
16284
    </P
16285
><P
16286
>&#13;
16287
    The next sections describe
16288
    the basic checks that <SPAN
16289
CLASS="application"
16290
>SCons</SPAN
16291
> supports,
16292
    as well as how to add your own custom checks.
16293
16294
    </P
16295
></DIV
16296
><DIV
16297
CLASS="section"
16298
><HR><H2
16299
CLASS="section"
16300
><A
16301
NAME="AEN3017"
16302
>22.2. Checking for the Existence of Header Files</A
16303
></H2
16304
><P
16305
>&#13;
16306
    Testing the existence of a header file
16307
    requires knowing what language the header file is.
16308
    A configure context has a <CODE
16309
CLASS="function"
16310
>CheckCHeader</CODE
16311
> method
16312
    that checks for the existence of a C header file:
16313
16314
    </P
16315
><PRE
16316
CLASS="programlisting"
16317
>&#13;    env = Environment()
16318
    conf = Configure(env)
16319
    if not conf.CheckCHeader('math.h'):
16320
        print 'Math.h must be installed!'
16321
        Exit(1)
16322
    if conf.CheckCHeader('foo.h'):
16323
        conf.env.Append('-DHAS_FOO_H')
16324
    env = conf.Finish()
16325
    </PRE
16326
><P
16327
>&#13;
16328
    Note that you can choose to terminate
16329
    the build if a given header file doesn't exist,
16330
    or you can modify the construction environment
16331
    based on the existence of a header file.
16332
16333
    </P
16334
><P
16335
>&#13;
16336
    If you need to check for the existence
16337
    a C++ header file,
16338
    use the <CODE
16339
CLASS="function"
16340
>CheckCXXHeader</CODE
16341
> method:
16342
16343
    </P
16344
><PRE
16345
CLASS="programlisting"
16346
>&#13;    env = Environment()
16347
    conf = Configure(env)
16348
    if not conf.CheckCXXHeader('vector.h'):
16349
        print 'vector.h must be installed!'
16350
        Exit(1)
16351
    env = conf.Finish()
16352
    </PRE
16353
></DIV
16354
><DIV
16355
CLASS="section"
16356
><HR><H2
16357
CLASS="section"
16358
><A
16359
NAME="AEN3026"
16360
>22.3. Checking for the Availability of a Function</A
16361
></H2
16362
><P
16363
>&#13;
16364
    Check for the availability of a specific function
16365
    using the <CODE
16366
CLASS="function"
16367
>CheckFunc</CODE
16368
> method:
16369
16370
    </P
16371
><PRE
16372
CLASS="programlisting"
16373
>&#13;    env = Environment()
16374
    conf = Configure(env)
16375
    if not conf.CheckFunc('strcpy'):
16376
        print 'Did not find strcpy(), using local version'
16377
        conf.env.Append('-Dstrcpy=my_local_strcpy')
16378
    env = conf.Finish()
16379
    </PRE
16380
></DIV
16381
><DIV
16382
CLASS="section"
16383
><HR><H2
16384
CLASS="section"
16385
><A
16386
NAME="AEN3031"
16387
>22.4. Checking for the Availability of a Library</A
16388
></H2
16389
><P
16390
>&#13;
16391
    Check for the availability of a library
16392
    using the <CODE
16393
CLASS="function"
16394
>CheckLib</CODE
16395
> method.
16396
    You only specify the basename of the library,
16397
    you don't need to add a <TT
16398
CLASS="literal"
16399
>lib</TT
16400
>
16401
    prefix or a <TT
16402
CLASS="literal"
16403
>.a</TT
16404
> or <TT
16405
CLASS="literal"
16406
>.lib</TT
16407
> suffix:
16408
16409
    </P
16410
><PRE
16411
CLASS="programlisting"
16412
>&#13;    env = Environment()
16413
    conf = Configure(env)
16414
    if not conf.CheckLib('m'):
16415
        print 'Did not find libm.a or m.lib, exiting!'
16416
        Exit(1)
16417
    env = conf.Finish()
16418
    </PRE
16419
><P
16420
>&#13;
16421
    Because the ability to use a library successfully
16422
    often depends on having access to a header file
16423
    that describes the library's interface,
16424
    you can check for a library
16425
    <SPAN
16426
CLASS="emphasis"
16427
><I
16428
CLASS="emphasis"
16429
>and</I
16430
></SPAN
16431
> a header file
16432
    at the same time by using the
16433
    <CODE
16434
CLASS="function"
16435
>CheckLibWithHeader</CODE
16436
> method:
16437
16438
    </P
16439
><PRE
16440
CLASS="programlisting"
16441
>&#13;    env = Environment()
16442
    conf = Configure(env)
16443
    if not conf.CheckLibWithHeader('m', 'math.h'):
16444
        print 'Did not find libm.a or m.lib, exiting!'
16445
        Exit(1)
16446
    env = conf.Finish()
16447
    </PRE
16448
><P
16449
>&#13;
16450
    This is essentially shorthand for
16451
    separate calls to the <CODE
16452
CLASS="function"
16453
>CheckHeader</CODE
16454
> and <CODE
16455
CLASS="function"
16456
>CheckLib</CODE
16457
>
16458
    functions.
16459
16460
    </P
16461
></DIV
16462
><DIV
16463
CLASS="section"
16464
><HR><H2
16465
CLASS="section"
16466
><A
16467
NAME="AEN3046"
16468
>22.5. Checking for the Availability of a <TT
16469
CLASS="literal"
16470
>typedef</TT
16471
></A
16472
></H2
16473
><P
16474
>&#13;
16475
    Check for the availability of a <TT
16476
CLASS="literal"
16477
>typedef</TT
16478
>
16479
    by using the <CODE
16480
CLASS="function"
16481
>CheckType</CODE
16482
> method:
16483
16484
    </P
16485
><PRE
16486
CLASS="programlisting"
16487
>&#13;    env = Environment()
16488
    conf = Configure(env)
16489
    if not conf.CheckType('off_t'):
16490
        print 'Did not find off_t typedef, assuming int'
16491
        conf.env.Append(CCFLAGS = '-Doff_t=int')
16492
    env = conf.Finish()
16493
    </PRE
16494
><P
16495
>&#13;
16496
    You can also add a string that will be
16497
    placed at the beginning of the test file
16498
    that will be used to check for the <TT
16499
CLASS="literal"
16500
>typedef</TT
16501
>.
16502
    This provide a way to specify
16503
    files that must be included to find the <TT
16504
CLASS="literal"
16505
>typedef</TT
16506
>:
16507
16508
    </P
16509
><PRE
16510
CLASS="programlisting"
16511
>&#13;    env = Environment()
16512
    conf = Configure(env)
16513
    if not conf.CheckType('off_t', '#include &#60;sys/types.h&#62;\n'):
16514
        print 'Did not find off_t typedef, assuming int'
16515
        conf.env.Append(CCFLAGS = '-Doff_t=int')
16516
    env = conf.Finish()
16517
    </PRE
16518
></DIV
16519
><DIV
16520
CLASS="section"
16521
><HR><H2
16522
CLASS="section"
16523
><A
16524
NAME="AEN3057"
16525
>22.6. Adding Your Own Custom Checks</A
16526
></H2
16527
><P
16528
>&#13;
16529
    A custom check is a Python function
16530
    that checks for a certain condition to exist
16531
    on the running system,
16532
    usually using methods that <SPAN
16533
CLASS="application"
16534
>SCons</SPAN
16535
>
16536
    supplies to take care of the details
16537
    of checking whether a compilation succeeds,
16538
    a link succeeds,
16539
    a program is runnable,
16540
    etc.
16541
    A simple custom check for the existence of
16542
    a specific library might look as follows:
16543
16544
    </P
16545
><PRE
16546
CLASS="programlisting"
16547
>&#13;    mylib_test_source_file = """
16548
    #include &#60;mylib.h&#62;
16549
    int main(int argc, char **argv)
16550
    {
16551
        MyLibrary mylib(argc, argv);
16552
        return 0;
16553
    }
16554
    """
16555
16556
    def CheckMyLibrary(context):
16557
        context.Message('Checking for MyLibrary...')
16558
        result = context.TryLink(mylib_test_source_file, '.c')
16559
        context.Result(result)
16560
        return result
16561
    </PRE
16562
><P
16563
>&#13;
16564
    The <CODE
16565
CLASS="function"
16566
>Message</CODE
16567
> and <CODE
16568
CLASS="function"
16569
>Result</CODE
16570
> methods
16571
    should typically begin and end a custom check to
16572
    let the user know what's going on:
16573
    the <CODE
16574
CLASS="function"
16575
>Message</CODE
16576
> call prints the
16577
    specified message (with no trailing newline)
16578
    and the <CODE
16579
CLASS="function"
16580
>Result</CODE
16581
> call prints
16582
    <TT
16583
CLASS="literal"
16584
>ok</TT
16585
> if the check succeeds and
16586
    <TT
16587
CLASS="literal"
16588
>failed</TT
16589
> if it doesn't.
16590
    The <CODE
16591
CLASS="function"
16592
>TryLink</CODE
16593
> method
16594
    actually tests for whether the
16595
    specified program text
16596
    will successfully link.
16597
16598
    </P
16599
><P
16600
>&#13;
16601
    (Note that a custom check can modify
16602
    its check based on any arguments you
16603
    choose to pass it,
16604
    or by using or modifying the configure context environment
16605
    in the <TT
16606
CLASS="literal"
16607
>context.env</TT
16608
> attribute.)
16609
16610
    </P
16611
><P
16612
>&#13;
16613
    This custom check function is
16614
    then attached to the <TT
16615
CLASS="literal"
16616
>configure context</TT
16617
>
16618
    by passing a dictionary
16619
    to the <CODE
16620
CLASS="function"
16621
>Configure</CODE
16622
> call
16623
    that maps a name of the check
16624
    to the underlying function:
16625
16626
    </P
16627
><PRE
16628
CLASS="programlisting"
16629
>&#13;    env = Environment()
16630
    conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
16631
    </PRE
16632
><P
16633
>&#13;
16634
    You'll typically want to make
16635
    the check and the function name the same,
16636
    as we've done here,
16637
    to avoid potential confusion.
16638
16639
    </P
16640
><P
16641
>&#13;
16642
    We can then put these pieces together
16643
    and actually call the <TT
16644
CLASS="literal"
16645
>CheckMyLibrary</TT
16646
> check
16647
    as follows:
16648
16649
    </P
16650
><PRE
16651
CLASS="programlisting"
16652
>&#13;    mylib_test_source_file = """
16653
    #include &#60;mylib.h&#62;
16654
    int main(int argc, char **argv)
16655
    {
16656
        MyLibrary mylib(argc, argv);
16657
        return 0;
16658
    }
16659
    """
16660
16661
    def CheckMyLibrary(context):
16662
        context.Message('Checking for MyLibrary... ')
16663
        result = context.TryLink(mylib_test_source_file, '.c')
16664
        context.Result(result)
16665
        return result
16666
16667
    env = Environment()
16668
    conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
16669
    if not conf.CheckMyLibrary():
16670
        print 'MyLibrary is not installed!'
16671
        Exit(1)
16672
    env = conf.Finish()
16673
16674
    # We would then add actual calls like Program() to build
16675
    # something using the "env" construction environment.
16676
    </PRE
16677
><P
16678
>&#13;
16679
    If MyLibrary is not installed on the system,
16680
    the output will look like:
16681
16682
    </P
16683
><PRE
16684
CLASS="screen"
16685
>&#13;    % <KBD
16686
CLASS="userinput"
16687
>scons</KBD
16688
>
16689
    scons: Reading SConscript file ...
16690
    Checking for MyLibrary... failed
16691
    MyLibrary is not installed!
16692
    </PRE
16693
><P
16694
>&#13;
16695
    If MyLibrary is installed,
16696
    the output will look like:
16697
16698
    </P
16699
><PRE
16700
CLASS="screen"
16701
>&#13;    % <KBD
16702
CLASS="userinput"
16703
>scons</KBD
16704
>
16705
    scons: Reading SConscript file ...
16706
    Checking for MyLibrary... failed
16707
    scons: done reading SConscript
16708
    scons: Building targets ...
16709
        .
16710
        .
16711
        .
16712
    </PRE
16713
></DIV
16714
><DIV
16715
CLASS="section"
16716
><HR><H2
16717
CLASS="section"
16718
><A
16719
NAME="AEN3086"
16720
>22.7. Not Configuring When Cleaning Targets</A
16721
></H2
16722
><P
16723
>&#13;
16724
    Using multi-platform configuration
16725
    as described in the previous sections
16726
    will run the configuration commands
16727
    even when invoking
16728
    <KBD
16729
CLASS="userinput"
16730
>scons -c</KBD
16731
>
16732
    to clean targets:
16733
16734
    </P
16735
><PRE
16736
CLASS="screen"
16737
>&#13;    % <KBD
16738
CLASS="userinput"
16739
>scons -Q -c</KBD
16740
>
16741
    Checking for MyLibrary... ok
16742
    Removed foo.o
16743
    Removed foo
16744
    </PRE
16745
><P
16746
>&#13;
16747
    Although running the platform checks
16748
    when removing targets doesn't hurt anything,
16749
    it's usually unnecessary.
16750
    You can avoid this by using the
16751
    <CODE
16752
CLASS="function"
16753
>GetOption</CODE
16754
>(); method to
16755
    check whether the <CODE
16756
CLASS="option"
16757
>-c</CODE
16758
> (clean)
16759
    option has been invoked on the command line:
16760
16761
    </P
16762
><PRE
16763
CLASS="programlisting"
16764
>&#13;    env = Environment()
16765
    if not env.GetOption('clean'):
16766
        conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
16767
        if not conf.CheckMyLibrary():
16768
            print 'MyLibrary is not installed!'
16769
            Exit(1)
16770
        env = conf.Finish()
16771
    </PRE
16772
><PRE
16773
CLASS="screen"
16774
>&#13;    % <KBD
16775
CLASS="userinput"
16776
>scons -Q -c</KBD
16777
>
16778
    Removed foo.o
16779
    Removed foo
16780
    </PRE
16781
></DIV
16782
></DIV
16783
><DIV
16784
CLASS="chapter"
16785
><HR><H1
16786
><A
16787
NAME="chap-caching"
16788
></A
16789
>Chapter 23. Caching Built Files</H1
16790
><P
16791
>&#13;
16792
  On multi-developer software projects,
16793
  you can sometimes speed up every developer's builds a lot by
16794
  allowing them to share the derived files that they build.
16795
  <SPAN
16796
CLASS="application"
16797
>SCons</SPAN
16798
> makes this easy, as well as reliable.
16799
16800
  </P
16801
><DIV
16802
CLASS="section"
16803
><HR><H2
16804
CLASS="section"
16805
><A
16806
NAME="AEN3102"
16807
>23.1. Specifying the Shared Cache Directory</A
16808
></H2
16809
><P
16810
>&#13;
16811
    To enable sharing of derived files,
16812
    use the <CODE
16813
CLASS="function"
16814
>CacheDir</CODE
16815
> function
16816
    in any <TT
16817
CLASS="filename"
16818
>SConscript</TT
16819
> file:
16820
16821
    </P
16822
><PRE
16823
CLASS="programlisting"
16824
>&#13;       CacheDir('/usr/local/build_cache')
16825
    </PRE
16826
><P
16827
>&#13;
16828
    Note that the directory you specify must already exist
16829
    and be readable and writable by all developers
16830
    who will be sharing derived files.
16831
    It should also be in some central location
16832
    that all builds will be able to access.
16833
    In environments where developers are using separate systems
16834
    (like individual workstations) for builds,
16835
    this directory would typically be
16836
    on a shared or NFS-mounted file system.
16837
16838
    </P
16839
><P
16840
>&#13;
16841
    Here's what happens:
16842
    When a build has a <CODE
16843
CLASS="function"
16844
>CacheDir</CODE
16845
> specified,
16846
    every time a file is built,
16847
    it is stored in the shared cache directory
16848
    along with its MD5 build signature.
16849
      <A
16850
NAME="AEN3111"
16851
HREF="#FTN.AEN3111"
16852
><SPAN
16853
CLASS="footnote"
16854
>[3]</SPAN
16855
></A
16856
>
16857
    On subsequent builds,
16858
    before an action is invoked to build a file,
16859
    <SPAN
16860
CLASS="application"
16861
>SCons</SPAN
16862
> will check the shared cache directory
16863
    to see if a file with the exact same build
16864
    signature already exists.
16865
    If so, the derived file will not be built locally,
16866
    but will be copied into the local build directory
16867
    from the shared cache directory,
16868
    like so:
16869
16870
    </P
16871
><PRE
16872
CLASS="screen"
16873
>&#13;      % <KBD
16874
CLASS="userinput"
16875
>scons -Q</KBD
16876
>
16877
      cc -o hello.o -c hello.c
16878
      cc -o hello hello.o
16879
      % <KBD
16880
CLASS="userinput"
16881
>scons -Q -c</KBD
16882
>
16883
      Removed hello.o
16884
      Removed hello
16885
      % <KBD
16886
CLASS="userinput"
16887
>scons -Q</KBD
16888
>
16889
      Retrieved `hello.o' from cache
16890
      Retrieved `hello' from cache
16891
    </PRE
16892
></DIV
16893
><DIV
16894
CLASS="section"
16895
><HR><H2
16896
CLASS="section"
16897
><A
16898
NAME="AEN3118"
16899
>23.2. Keeping Build Output Consistent</A
16900
></H2
16901
><P
16902
>&#13;
16903
    One potential drawback to using a shared cache
16904
    is that the output printed by <SPAN
16905
CLASS="application"
16906
>SCons</SPAN
16907
>
16908
    can be inconsistent from invocation to invocation,
16909
    because any given file may be rebuilt one time
16910
    and retrieved from the shared cache the next time.
16911
    This can make analyzing build output more difficult,
16912
    especially for automated scripts that
16913
    expect consistent output each time.
16914
16915
    </P
16916
><P
16917
>&#13;
16918
    If, however, you use the <TT
16919
CLASS="literal"
16920
>--cache-show</TT
16921
> option,
16922
    <SPAN
16923
CLASS="application"
16924
>SCons</SPAN
16925
> will print the command line that it
16926
    <SPAN
16927
CLASS="emphasis"
16928
><I
16929
CLASS="emphasis"
16930
>would</I
16931
></SPAN
16932
> have executed
16933
    to build the file,
16934
    even when it is retrieving the file from the shared cache.
16935
    This makes the build output consistent
16936
    every time the build is run:
16937
16938
    </P
16939
><PRE
16940
CLASS="screen"
16941
>&#13;      % <KBD
16942
CLASS="userinput"
16943
>scons -Q</KBD
16944
>
16945
      cc -o hello.o -c hello.c
16946
      cc -o hello hello.o
16947
      % <KBD
16948
CLASS="userinput"
16949
>scons -Q -c</KBD
16950
>
16951
      Removed hello.o
16952
      Removed hello
16953
      % <KBD
16954
CLASS="userinput"
16955
>scons -Q --cache-show</KBD
16956
>
16957
      cc -o hello.o -c hello.c
16958
      cc -o hello hello.o
16959
    </PRE
16960
><P
16961
>&#13;
16962
    The trade-off, of course, is that you no longer
16963
    know whether or not <SPAN
16964
CLASS="application"
16965
>SCons</SPAN
16966
>
16967
    has retrieved a derived file from cache
16968
    or has rebuilt it locally.
16969
16970
    </P
16971
></DIV
16972
><DIV
16973
CLASS="section"
16974
><HR><H2
16975
CLASS="section"
16976
><A
16977
NAME="AEN3132"
16978
>23.3. Not Using the Shared Cache for Specific Files</A
16979
></H2
16980
><P
16981
>&#13;
16982
    You may want to disable caching for certain
16983
    specific files in your configuration.
16984
    For example, if you only want to put
16985
    executable files in a central cache,
16986
    but not the intermediate object files,
16987
    you can use the <CODE
16988
CLASS="function"
16989
>NoCache</CODE
16990
>
16991
    function to specify that the
16992
    object files should not be cached:
16993
16994
    </P
16995
><PRE
16996
CLASS="programlisting"
16997
>&#13;       env = Environment()
16998
       obj = env.Object('hello.c')
16999
       env.Program('hello.c')
17000
       CacheDir('cache')
17001
       NoCache('hello.o')
17002
    </PRE
17003
><P
17004
>&#13;
17005
    Then when you run <SPAN
17006
CLASS="application"
17007
>scons</SPAN
17008
> after cleaning
17009
    the built targets,
17010
    it will recompile the object file locally
17011
    (since it doesn't exist in the shared cache directory),
17012
    but still realize that the shared cache directory
17013
    contains an up-to-date executable program
17014
    that can be retrieved instead of re-linking:
17015
17016
    </P
17017
><PRE
17018
CLASS="screen"
17019
>&#13;      % <KBD
17020
CLASS="userinput"
17021
>scons -Q</KBD
17022
>
17023
      cc -o hello.o -c hello.c
17024
      cc -o hello hello.o
17025
      % <KBD
17026
CLASS="userinput"
17027
>scons -Q -c</KBD
17028
>
17029
      Removed hello.o
17030
      Removed hello
17031
      % <KBD
17032
CLASS="userinput"
17033
>scons -Q</KBD
17034
>
17035
      cc -o hello.o -c hello.c
17036
      Retrieved `hello' from cache
17037
    </PRE
17038
></DIV
17039
><DIV
17040
CLASS="section"
17041
><HR><H2
17042
CLASS="section"
17043
><A
17044
NAME="AEN3143"
17045
>23.4. Disabling the Shared Cache</A
17046
></H2
17047
><P
17048
>&#13;
17049
    Retrieving an already-built file
17050
    from the shared cache
17051
    is usually a significant time-savings
17052
    over rebuilding the file,
17053
    but how much of a savings
17054
    (or even whether it saves time at all)
17055
    can depend a great deal on your
17056
    system or network configuration.
17057
    For example, retrieving cached files
17058
    from a busy server over a busy network
17059
    might end up being slower than
17060
    rebuilding the files locally.
17061
17062
    </P
17063
><P
17064
>&#13;
17065
    In these cases, you can specify
17066
    the <TT
17067
CLASS="literal"
17068
>--cache-disable</TT
17069
>
17070
    command-line option to tell <SPAN
17071
CLASS="application"
17072
>SCons</SPAN
17073
>
17074
    to not retrieve already-built files from the
17075
    shared cache directory:
17076
17077
    </P
17078
><PRE
17079
CLASS="screen"
17080
>&#13;      % <KBD
17081
CLASS="userinput"
17082
>scons -Q</KBD
17083
>
17084
      cc -o hello.o -c hello.c
17085
      cc -o hello hello.o
17086
      % <KBD
17087
CLASS="userinput"
17088
>scons -Q -c</KBD
17089
>
17090
      Removed hello.o
17091
      Removed hello
17092
      % <KBD
17093
CLASS="userinput"
17094
>scons -Q</KBD
17095
>
17096
      Retrieved `hello.o' from cache
17097
      Retrieved `hello' from cache
17098
      % <KBD
17099
CLASS="userinput"
17100
>scons -Q -c</KBD
17101
>
17102
      Removed hello.o
17103
      Removed hello
17104
      % <KBD
17105
CLASS="userinput"
17106
>scons -Q --cache-disable</KBD
17107
>
17108
      cc -o hello.o -c hello.c
17109
      cc -o hello hello.o
17110
    </PRE
17111
></DIV
17112
><DIV
17113
CLASS="section"
17114
><HR><H2
17115
CLASS="section"
17116
><A
17117
NAME="AEN3155"
17118
>23.5. Populating a Shared Cache With Already-Built Files</A
17119
></H2
17120
><P
17121
>&#13;
17122
    Sometimes, you may have one or more derived files
17123
    already built in your local build tree
17124
    that you wish to make available to other people doing builds.
17125
    For example, you may find it more effective to perform
17126
    integration builds with the cache disabled
17127
    (per the previous section)
17128
    and only populate the shared cache directory
17129
    with the built files after the integration build
17130
    has completed successfully.
17131
    This way, the cache will only get filled up
17132
    with derived files that are part of a complete, successful build
17133
    not with files that might be later overwritten
17134
    while you debug integration problems.
17135
17136
    </P
17137
><P
17138
>&#13;
17139
    In this case, you can use the
17140
    the <TT
17141
CLASS="literal"
17142
>--cache-force</TT
17143
> option
17144
    to tell <SPAN
17145
CLASS="application"
17146
>SCons</SPAN
17147
> to put all derived files in the cache,
17148
    even if the files already exist in your local tree
17149
    from having been built by a previous invocation:
17150
17151
    </P
17152
><PRE
17153
CLASS="screen"
17154
>&#13;      % <KBD
17155
CLASS="userinput"
17156
>scons -Q --cache-disable</KBD
17157
>
17158
      cc -o hello.o -c hello.c
17159
      cc -o hello hello.o
17160
      % <KBD
17161
CLASS="userinput"
17162
>scons -Q -c</KBD
17163
>
17164
      Removed hello.o
17165
      Removed hello
17166
      % <KBD
17167
CLASS="userinput"
17168
>scons -Q --cache-disable</KBD
17169
>
17170
      cc -o hello.o -c hello.c
17171
      cc -o hello hello.o
17172
      % <KBD
17173
CLASS="userinput"
17174
>scons -Q --cache-force</KBD
17175
>
17176
      scons: `.' is up to date.
17177
      % <KBD
17178
CLASS="userinput"
17179
>scons -Q</KBD
17180
>
17181
      scons: `.' is up to date.
17182
    </PRE
17183
><P
17184
>&#13;
17185
    Notice how the above sample run
17186
    demonstrates that the <TT
17187
CLASS="literal"
17188
>--cache-disable</TT
17189
>
17190
    option avoids putting the built
17191
    <TT
17192
CLASS="filename"
17193
>hello.o</TT
17194
>
17195
    and
17196
    <TT
17197
CLASS="filename"
17198
>hello</TT
17199
> files in the cache,
17200
    but after using the <TT
17201
CLASS="literal"
17202
>--cache-force</TT
17203
> option,
17204
    the files have been put in the cache
17205
    for the next invocation to retrieve.
17206
17207
    </P
17208
></DIV
17209
><DIV
17210
CLASS="section"
17211
><HR><H2
17212
CLASS="section"
17213
><A
17214
NAME="AEN3172"
17215
>23.6. Minimizing Cache Contention:  the <TT
17216
CLASS="literal"
17217
>--random</TT
17218
> Option</A
17219
></H2
17220
><P
17221
>&#13;
17222
    If you allow multiple builds to update the
17223
    shared cache directory simultaneously,
17224
    two builds that occur at the same time
17225
    can sometimes start "racing"
17226
    with one another to build the same files
17227
    in the same order.
17228
    If, for example,
17229
    you are linking multiple files into an executable program:
17230
17231
    </P
17232
><PRE
17233
CLASS="programlisting"
17234
>&#13;       Program('prog',
17235
               ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c'])
17236
    </PRE
17237
><P
17238
>&#13;
17239
    <SPAN
17240
CLASS="application"
17241
>SCons</SPAN
17242
> will normally build the input object files
17243
    on which the program depends in their normal, sorted order:
17244
17245
    </P
17246
><PRE
17247
CLASS="screen"
17248
>&#13;      % <KBD
17249
CLASS="userinput"
17250
>scons -Q</KBD
17251
>
17252
      cc -o f1.o -c f1.c
17253
      cc -o f2.o -c f2.c
17254
      cc -o f3.o -c f3.c
17255
      cc -o f4.o -c f4.c
17256
      cc -o f5.o -c f5.c
17257
      cc -o prog f1.o f2.o f3.o f4.o f5.o
17258
    </PRE
17259
><P
17260
>&#13;
17261
    But if two such builds take place simultaneously,
17262
    they may each look in the cache at nearly the same
17263
    time and both decide that <TT
17264
CLASS="filename"
17265
>f1.o</TT
17266
>
17267
    must be rebuilt and pushed into the shared cache directory,
17268
    then both decide that <TT
17269
CLASS="filename"
17270
>f2.o</TT
17271
>
17272
    must be rebuilt (and pushed into the shared cache directory),
17273
    then both decide that <TT
17274
CLASS="filename"
17275
>f3.o</TT
17276
>
17277
    must be rebuilt...
17278
    This won't cause any actual build problems--both
17279
    builds will succeed,
17280
    generate correct output files,
17281
    and populate the cache--but
17282
    it does represent wasted effort.
17283
17284
    </P
17285
><P
17286
>&#13;
17287
    To alleviate such contention for the cache,
17288
    you can use the <TT
17289
CLASS="literal"
17290
>--random</TT
17291
> command-line option
17292
    to tell <SPAN
17293
CLASS="application"
17294
>SCons</SPAN
17295
> to build dependencies
17296
    in a random order:
17297
17298
    </P
17299
><PRE
17300
CLASS="screen"
17301
>&#13;      % <KBD
17302
CLASS="userinput"
17303
>scons -Q --random</KBD
17304
>
17305
      cc -o f3.o -c f3.c
17306
      cc -o f1.o -c f1.c
17307
      cc -o f5.o -c f5.c
17308
      cc -o f2.o -c f2.c
17309
      cc -o f4.o -c f4.c
17310
      cc -o prog f1.o f2.o f3.o f4.o f5.o
17311
    </PRE
17312
><P
17313
>&#13;
17314
    Multiple builds using the <TT
17315
CLASS="literal"
17316
>--random</TT
17317
> option
17318
    will usually build their dependencies in different,
17319
    random orders,
17320
    which minimizes the chances for a lot of
17321
    contention for same-named files
17322
    in the shared cache directory.
17323
    Multiple simultaneous builds might still race to try to build
17324
    the same target file on occasion,
17325
    but long sequences of inefficient contention
17326
    should be rare.
17327
17328
    </P
17329
><P
17330
>&#13;
17331
    Note, of course,
17332
    the <TT
17333
CLASS="literal"
17334
>--random</TT
17335
> option
17336
    will cause the output that <SPAN
17337
CLASS="application"
17338
>SCons</SPAN
17339
> prints
17340
    to be inconsistent from invocation to invocation,
17341
    which may be an issue when
17342
    trying to compare output from different build runs.
17343
17344
    </P
17345
><P
17346
>&#13;
17347
    If you want to make sure dependencies will be built
17348
    in a random order without having to specify
17349
    the <TT
17350
CLASS="literal"
17351
>--random</TT
17352
> on very command line,
17353
    you can use the <CODE
17354
CLASS="function"
17355
>SetOption</CODE
17356
> function to
17357
    set the <TT
17358
CLASS="literal"
17359
>random</TT
17360
> option
17361
    within any <TT
17362
CLASS="filename"
17363
>SConscript</TT
17364
> file:
17365
17366
    </P
17367
><PRE
17368
CLASS="programlisting"
17369
>&#13;       Program('prog',
17370
               ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c'])
17371
17372
       SetOption('random', 1)
17373
       Program('prog',
17374
               ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c'])
17375
    </PRE
17376
></DIV
17377
></DIV
17378
><DIV
17379
CLASS="chapter"
17380
><HR><H1
17381
><A
17382
NAME="chap-alias"
17383
></A
17384
>Chapter 24. Alias Targets</H1
17385
><P
17386
>&#13;
17387
  We've already seen how you can use the <CODE
17388
CLASS="function"
17389
>Alias</CODE
17390
>
17391
  function to create a target named <TT
17392
CLASS="literal"
17393
>install</TT
17394
>:
17395
17396
  </P
17397
><PRE
17398
CLASS="programlisting"
17399
>&#13;     env = Environment()
17400
     hello = env.Program('hello.c')
17401
     env.Install('/usr/bin', hello)
17402
     env.Alias('install', '/usr/bin')
17403
  </PRE
17404
><P
17405
>&#13;
17406
  You can then use this alias on the command line
17407
  to tell <SPAN
17408
CLASS="application"
17409
>SCons</SPAN
17410
> more naturally that you want to install files:
17411
17412
  </P
17413
><PRE
17414
CLASS="screen"
17415
>&#13;     % <KBD
17416
CLASS="userinput"
17417
>scons -Q install</KBD
17418
>
17419
     cc -o hello.o -c hello.c
17420
     cc -o hello hello.o
17421
     Install file: "hello" as "/usr/bin/hello"
17422
  </PRE
17423
><P
17424
>&#13;
17425
  Like other <CODE
17426
CLASS="classname"
17427
>Builder</CODE
17428
> methods, though,
17429
  the <CODE
17430
CLASS="function"
17431
>Alias</CODE
17432
> method returns an object
17433
  representing the alias being built.
17434
  You can then use this object as input to anothother <CODE
17435
CLASS="classname"
17436
>Builder</CODE
17437
>.
17438
  This is especially useful if you use such an object
17439
  as input to another call to the <CODE
17440
CLASS="function"
17441
>Alias</CODE
17442
> <CODE
17443
CLASS="classname"
17444
>Builder</CODE
17445
>,
17446
  allowing you to create a hierarchy
17447
  of nested aliases:
17448
17449
  </P
17450
><PRE
17451
CLASS="programlisting"
17452
>&#13;     env = Environment()
17453
     p = env.Program('foo.c')
17454
     l = env.Library('bar.c')
17455
     env.Install('/usr/bin', p)
17456
     env.Install('/usr/lib', l)
17457
     ib = env.Alias('install-bin', '/usr/bin')
17458
     il = env.Alias('install-lib', '/usr/lib')
17459
     env.Alias('install', [ib, il])
17460
  </PRE
17461
><P
17462
>&#13;
17463
  This example defines separate <TT
17464
CLASS="literal"
17465
>install</TT
17466
>,
17467
  <TT
17468
CLASS="literal"
17469
>install-bin</TT
17470
>,
17471
  and <TT
17472
CLASS="literal"
17473
>install-lib</TT
17474
> aliases,
17475
  allowing you finer control over what gets installed:
17476
17477
  </P
17478
><PRE
17479
CLASS="screen"
17480
>&#13;     % <KBD
17481
CLASS="userinput"
17482
>scons -Q install-bin</KBD
17483
>
17484
     cc -o foo.o -c foo.c
17485
     cc -o foo foo.o
17486
     Install file: "foo" as "/usr/bin/foo"
17487
     % <KBD
17488
CLASS="userinput"
17489
>scons -Q install-lib</KBD
17490
>
17491
     cc -o bar.o -c bar.c
17492
     ar rc libbar.a bar.o
17493
     ranlib libbar.a
17494
     Install file: "libbar.a" as "/usr/lib/libbar.a"
17495
     % <KBD
17496
CLASS="userinput"
17497
>scons -Q -c /</KBD
17498
>
17499
     Removed foo.o
17500
     Removed foo
17501
     Removed /usr/bin/foo
17502
     Removed bar.o
17503
     Removed libbar.a
17504
     Removed /usr/lib/libbar.a
17505
     % <KBD
17506
CLASS="userinput"
17507
>scons -Q install</KBD
17508
>
17509
     cc -o foo.o -c foo.c
17510
     cc -o foo foo.o
17511
     Install file: "foo" as "/usr/bin/foo"
17512
     cc -o bar.o -c bar.c
17513
     ar rc libbar.a bar.o
17514
     ranlib libbar.a
17515
     Install file: "libbar.a" as "/usr/lib/libbar.a"
17516
  </PRE
17517
></DIV
17518
><DIV
17519
CLASS="chapter"
17520
><HR><H1
17521
><A
17522
NAME="chap-java"
17523
></A
17524
>Chapter 25. Java Builds</H1
17525
><P
17526
>&#13;
17527
  So far, we've been using examples of
17528
  building C and C++ programs
17529
  to demonstrate the features of <SPAN
17530
CLASS="application"
17531
>SCons</SPAN
17532
>.
17533
  <SPAN
17534
CLASS="application"
17535
>SCons</SPAN
17536
> also supports building Java programs,
17537
  but Java builds are handled slightly differently,
17538
  which reflects the ways in which
17539
  the Java compiler and tools
17540
  build programs differently than
17541
  other languages' tool chains.
17542
17543
  </P
17544
><DIV
17545
CLASS="section"
17546
><HR><H2
17547
CLASS="section"
17548
><A
17549
NAME="AEN3232"
17550
>25.1. Building Java Class Files:  the <CODE
17551
CLASS="function"
17552
>Java</CODE
17553
> Builder</A
17554
></H2
17555
><P
17556
>&#13;
17557
    The basic activity when programming in Java,
17558
    of course, is to take one or more <TT
17559
CLASS="filename"
17560
>.java</TT
17561
> files
17562
    containing Java source code
17563
    and to call the Java compiler
17564
    to turn them into one or more
17565
    <TT
17566
CLASS="filename"
17567
>.class</TT
17568
> files.
17569
    In <SPAN
17570
CLASS="application"
17571
>SCons</SPAN
17572
>, you do this
17573
    by giving the <A
17574
HREF="#b-Java"
17575
><CODE
17576
CLASS="function"
17577
>Java</CODE
17578
></A
17579
> Builder
17580
    a target directory in which
17581
    to put the <TT
17582
CLASS="filename"
17583
>.class</TT
17584
> files,
17585
    and a source directory that contains
17586
    the <TT
17587
CLASS="filename"
17588
>.java</TT
17589
> files:
17590
17591
    </P
17592
><PRE
17593
CLASS="programlisting"
17594
>&#13;      Java('classes', 'src')
17595
    </PRE
17596
><P
17597
>&#13;
17598
    If the <TT
17599
CLASS="filename"
17600
>src</TT
17601
> directory contains
17602
    three <TT
17603
CLASS="filename"
17604
>.java</TT
17605
> source files,
17606
    then running <SPAN
17607
CLASS="application"
17608
>SCons</SPAN
17609
> might look like this:
17610
17611
    </P
17612
><PRE
17613
CLASS="screen"
17614
>&#13;      % <KBD
17615
CLASS="userinput"
17616
>scons -Q</KBD
17617
>
17618
      javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java
17619
    </PRE
17620
><P
17621
>&#13;
17622
    <SPAN
17623
CLASS="application"
17624
>SCons</SPAN
17625
> will actually search the <TT
17626
CLASS="filename"
17627
>src</TT
17628
>
17629
    directory tree for all of the <TT
17630
CLASS="filename"
17631
>.java</TT
17632
> files.
17633
    The Java compiler will then create the
17634
    necessary class files in the <TT
17635
CLASS="filename"
17636
>classes</TT
17637
> subdirectory,
17638
    based on the class names found in the <TT
17639
CLASS="filename"
17640
>.java</TT
17641
> files.
17642
17643
    </P
17644
></DIV
17645
><DIV
17646
CLASS="section"
17647
><HR><H2
17648
CLASS="section"
17649
><A
17650
NAME="AEN3256"
17651
>25.2. How <SPAN
17652
CLASS="application"
17653
>SCons</SPAN
17654
> Handles Java Dependencies</A
17655
></H2
17656
><P
17657
>&#13;
17658
    In addition to searching the source directory for
17659
    <TT
17660
CLASS="filename"
17661
>.java</TT
17662
> files,
17663
    <SPAN
17664
CLASS="application"
17665
>SCons</SPAN
17666
> actually runs the <TT
17667
CLASS="filename"
17668
>.java</TT
17669
> files
17670
    through a stripped-down Java parser that figures out
17671
    what classes are defined.
17672
    In other words, <SPAN
17673
CLASS="application"
17674
>SCons</SPAN
17675
> knows,
17676
    without you having to tell it,
17677
    what <TT
17678
CLASS="filename"
17679
>.class</TT
17680
> files
17681
    will be produced by the <SPAN
17682
CLASS="application"
17683
>javac</SPAN
17684
> call.
17685
    So our one-liner example from the preceding section:
17686
17687
    </P
17688
><PRE
17689
CLASS="programlisting"
17690
>&#13;      Java('classes', 'src')
17691
    </PRE
17692
><P
17693
>&#13;
17694
    Will not only tell you reliably
17695
    that the <TT
17696
CLASS="filename"
17697
>.class</TT
17698
> files
17699
    in the <TT
17700
CLASS="filename"
17701
>classes</TT
17702
> subdirectory 
17703
    are up-to-date:
17704
17705
    </P
17706
><PRE
17707
CLASS="screen"
17708
>&#13;      % <KBD
17709
CLASS="userinput"
17710
>scons -Q</KBD
17711
>
17712
      javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java
17713
      % <KBD
17714
CLASS="userinput"
17715
>scons -Q classes</KBD
17716
>
17717
      scons: `classes' is up to date.
17718
    </PRE
17719
><P
17720
>&#13;
17721
    But it will also remove all of the generated
17722
    <TT
17723
CLASS="filename"
17724
>.class</TT
17725
> files,
17726
    even for inner classes,
17727
    without you having to specify them manually.
17728
    For example, if our
17729
    <TT
17730
CLASS="filename"
17731
>Example1.java</TT
17732
>
17733
    and
17734
    <TT
17735
CLASS="filename"
17736
>Example3.java</TT
17737
>
17738
    files both define additional classes,
17739
    and the class defined in <TT
17740
CLASS="filename"
17741
>Example2.java</TT
17742
>
17743
    has an inner class,
17744
    running <KBD
17745
CLASS="userinput"
17746
>scons -c</KBD
17747
>
17748
    will clean up all of those <TT
17749
CLASS="filename"
17750
>.class</TT
17751
> files
17752
    as well:
17753
17754
    </P
17755
><PRE
17756
CLASS="screen"
17757
>&#13;      % <KBD
17758
CLASS="userinput"
17759
>scons -Q</KBD
17760
>
17761
      javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java
17762
      % <KBD
17763
CLASS="userinput"
17764
>scons -Q -c classes</KBD
17765
>
17766
      Removed classes/Example1.class
17767
      Removed classes/AdditionalClass1.class
17768
      Removed classes/Example2$Inner2.class
17769
      Removed classes/Example2.class
17770
      Removed classes/Example3.class
17771
      Removed classes/AdditionalClass3.class
17772
    </PRE
17773
></DIV
17774
><DIV
17775
CLASS="section"
17776
><HR><H2
17777
CLASS="section"
17778
><A
17779
NAME="AEN3283"
17780
>25.3. Building Java Archive (<TT
17781
CLASS="filename"
17782
>.jar</TT
17783
>) Files:  the <CODE
17784
CLASS="function"
17785
>Jar</CODE
17786
> Builder</A
17787
></H2
17788
><P
17789
>&#13;
17790
    After building the class files,
17791
    it's common to collect them into
17792
    a Java archive (<TT
17793
CLASS="filename"
17794
>.jar</TT
17795
>) file,
17796
    which you do by calling the <A
17797
HREF="#b-Jar"
17798
><CODE
17799
CLASS="function"
17800
>Jar</CODE
17801
></A
17802
> Builder method.
17803
    If you want to just collect all of the
17804
    class files within a subdirectory,
17805
    you can just specify that subdirectory
17806
    as the <CODE
17807
CLASS="function"
17808
>Jar</CODE
17809
> source:
17810
17811
    </P
17812
><PRE
17813
CLASS="programlisting"
17814
>&#13;      Java(target = 'classes', source = 'src')
17815
      Jar(target = 'test.jar', source = 'classes')
17816
    </PRE
17817
><P
17818
>&#13;
17819
    <SPAN
17820
CLASS="application"
17821
>SCons</SPAN
17822
> will then pass that directory
17823
    to the <SPAN
17824
CLASS="application"
17825
>jar</SPAN
17826
> command,
17827
    which will collect all of the underlying
17828
    <TT
17829
CLASS="filename"
17830
>.class</TT
17831
> files:
17832
17833
    </P
17834
><PRE
17835
CLASS="screen"
17836
>&#13;      % <KBD
17837
CLASS="userinput"
17838
>scons -Q</KBD
17839
>
17840
      javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java
17841
      jar cf test.jar classes
17842
    </PRE
17843
><P
17844
>&#13;
17845
    If you want to keep all of the
17846
    <TT
17847
CLASS="filename"
17848
>.class</TT
17849
> files
17850
    for multiple programs in one location,
17851
    and only archive some of them in
17852
    each <TT
17853
CLASS="filename"
17854
>.jar</TT
17855
> file,
17856
    you can pass the <CODE
17857
CLASS="function"
17858
>Jar</CODE
17859
> builder a
17860
    list of files as its source.
17861
    It's extremely simple to create multiple
17862
    <TT
17863
CLASS="filename"
17864
>.jar</TT
17865
> files this way,
17866
    using the lists of target class files created
17867
    by calls to the <A
17868
HREF="#b-Java"
17869
><CODE
17870
CLASS="function"
17871
>Java</CODE
17872
></A
17873
> builder
17874
    as sources to the various <CODE
17875
CLASS="function"
17876
>Jar</CODE
17877
> calls:
17878
17879
    </P
17880
><PRE
17881
CLASS="programlisting"
17882
>&#13;      prog1_class_files = Java(target = 'classes', source = 'prog1')
17883
      prog2_class_files = Java(target = 'classes', source = 'prog2')
17884
      Jar(target = 'prog1.jar', source = prog1_class_files)
17885
      Jar(target = 'prog2.jar', source = prog2_class_files)
17886
    </PRE
17887
><P
17888
>&#13;
17889
    This will then create
17890
    <TT
17891
CLASS="filename"
17892
>prog1.jar</TT
17893
>
17894
    and <TT
17895
CLASS="filename"
17896
>prog2.jar</TT
17897
>
17898
    next to the subdirectories
17899
    that contain their <TT
17900
CLASS="filename"
17901
>.java</TT
17902
> files:
17903
17904
    </P
17905
><PRE
17906
CLASS="screen"
17907
>&#13;      % <KBD
17908
CLASS="userinput"
17909
>scons -Q</KBD
17910
>
17911
      javac -d classes -sourcepath prog1 prog1/Example1.java prog1/Example2.java
17912
      javac -d classes -sourcepath prog2 prog2/Example3.java prog2/Example4.java
17913
      jar cf prog1.jar -C classes Example1.class -C classes Example2.class
17914
      jar cf prog2.jar -C classes Example3.class -C classes Example4.class
17915
    </PRE
17916
></DIV
17917
><DIV
17918
CLASS="section"
17919
><HR><H2
17920
CLASS="section"
17921
><A
17922
NAME="AEN3314"
17923
>25.4. Building C Header and Stub Files:  the <CODE
17924
CLASS="function"
17925
>JavaH</CODE
17926
> Builder</A
17927
></H2
17928
><P
17929
>&#13;
17930
    You can generate C header and source files
17931
    for implementing native methods,
17932
    by using the <A
17933
HREF="#b-JavaH"
17934
><CODE
17935
CLASS="function"
17936
>JavaH</CODE
17937
></A
17938
> Builder.
17939
    There are several ways of using the <CODE
17940
CLASS="function"
17941
>JavaH</CODE
17942
> Builder.
17943
    One typical invocation might look like:
17944
17945
    </P
17946
><PRE
17947
CLASS="programlisting"
17948
>&#13;      classes = Java(target = 'classes', source = 'src/pkg/sub')
17949
      JavaH(target = 'native', source = classes)
17950
    </PRE
17951
><P
17952
>&#13;
17953
    The source is a list of class files generated by the
17954
    call to the <A
17955
HREF="#b-Java"
17956
><CODE
17957
CLASS="function"
17958
>Java</CODE
17959
></A
17960
> Builder,
17961
    and the target is the output directory in
17962
    which we want the C header files placed.
17963
    The target
17964
    gets converted into the <CODE
17965
CLASS="option"
17966
>-d</CODE
17967
>
17968
    when <SPAN
17969
CLASS="application"
17970
>SCons</SPAN
17971
> runs <SPAN
17972
CLASS="application"
17973
>javah</SPAN
17974
>:
17975
17976
    </P
17977
><PRE
17978
CLASS="screen"
17979
>&#13;      % <KBD
17980
CLASS="userinput"
17981
>scons -Q</KBD
17982
>
17983
      javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java
17984
      javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3
17985
    </PRE
17986
><P
17987
>&#13;
17988
    In this case,
17989
    the call to <SPAN
17990
CLASS="application"
17991
>javah</SPAN
17992
>
17993
    will generate the header files
17994
    <TT
17995
CLASS="filename"
17996
>native/pkg_sub_Example1.h</TT
17997
>,
17998
    <TT
17999
CLASS="filename"
18000
>native/pkg_sub_Example2.h</TT
18001
>
18002
    and
18003
    <TT
18004
CLASS="filename"
18005
>native/pkg_sub_Example3.h</TT
18006
>.
18007
    Notice that <SPAN
18008
CLASS="application"
18009
>SCons</SPAN
18010
> remembered that the class
18011
    files were generated with a target directory of
18012
    <TT
18013
CLASS="filename"
18014
>classes</TT
18015
>,
18016
    and that it then specified that target directory
18017
    as the <CODE
18018
CLASS="option"
18019
>-classpath</CODE
18020
> option
18021
    to the call to <SPAN
18022
CLASS="application"
18023
>javah</SPAN
18024
>.
18025
18026
    </P
18027
><P
18028
>&#13;
18029
    Although it's more convenient to use
18030
    the list of class files returned by
18031
    the <CODE
18032
CLASS="function"
18033
>Java</CODE
18034
> Builder
18035
    as the source of a call to the <CODE
18036
CLASS="function"
18037
>JavaH</CODE
18038
> Builder,
18039
    you <SPAN
18040
CLASS="emphasis"
18041
><I
18042
CLASS="emphasis"
18043
>can</I
18044
></SPAN
18045
>
18046
    specify the list of class files
18047
    by hand, if you prefer.
18048
    If you do,
18049
    you need to set the
18050
    <A
18051
HREF="#cv-JAVACLASSDIR"
18052
><CODE
18053
CLASS="envar"
18054
>$JAVACLASSDIR</CODE
18055
></A
18056
> construction variable
18057
    when calling <CODE
18058
CLASS="function"
18059
>JavaH</CODE
18060
>:
18061
18062
    </P
18063
><PRE
18064
CLASS="programlisting"
18065
>&#13;      Java(target = 'classes', source = 'src/pkg/sub')
18066
      class_file_list = ['classes/pkg/sub/Example1.class',
18067
                         'classes/pkg/sub/Example2.class',
18068
                         'classes/pkg/sub/Example3.class']
18069
      JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes')
18070
    </PRE
18071
><P
18072
>&#13;
18073
    The <CODE
18074
CLASS="envar"
18075
>$JAVACLASSDIR</CODE
18076
> value then
18077
    gets converted into the <CODE
18078
CLASS="option"
18079
>-classpath</CODE
18080
>
18081
    when <SPAN
18082
CLASS="application"
18083
>SCons</SPAN
18084
> runs <SPAN
18085
CLASS="application"
18086
>javah</SPAN
18087
>:
18088
18089
    </P
18090
><PRE
18091
CLASS="screen"
18092
>&#13;      % <KBD
18093
CLASS="userinput"
18094
>scons -Q</KBD
18095
>
18096
      javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java
18097
      javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3
18098
    </PRE
18099
><P
18100
>&#13;
18101
    Lastly, if you don't want a separate header file
18102
    generated for each source file,
18103
    you can specify an explicit File Node
18104
    as the target of the <CODE
18105
CLASS="function"
18106
>JavaH</CODE
18107
> Builder:
18108
18109
    </P
18110
><PRE
18111
CLASS="programlisting"
18112
>&#13;      classes = Java(target = 'classes', source = 'src/pkg/sub')
18113
      JavaH(target = File('native.h'), source = classes)
18114
    </PRE
18115
><P
18116
>&#13;
18117
    Because <SPAN
18118
CLASS="application"
18119
>SCons</SPAN
18120
> assumes by default
18121
    that the target of the <CODE
18122
CLASS="function"
18123
>JavaH</CODE
18124
> builder is a directory,
18125
    you need to use the <CODE
18126
CLASS="function"
18127
>File</CODE
18128
> function
18129
    to make sure that <SPAN
18130
CLASS="application"
18131
>SCons</SPAN
18132
> doesn't
18133
    create a directory named <TT
18134
CLASS="filename"
18135
>native.h</TT
18136
>.
18137
    When a file is used, though,
18138
    <SPAN
18139
CLASS="application"
18140
>SCons</SPAN
18141
> correctly converts the file name
18142
    into the <SPAN
18143
CLASS="application"
18144
>javah</SPAN
18145
> <CODE
18146
CLASS="option"
18147
>-o</CODE
18148
> option:
18149
18150
    </P
18151
><PRE
18152
CLASS="screen"
18153
>&#13;      % <KBD
18154
CLASS="userinput"
18155
>scons -Q</KBD
18156
>
18157
      javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java
18158
      javah -o native.h -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3
18159
    </PRE
18160
></DIV
18161
><DIV
18162
CLASS="section"
18163
><HR><H2
18164
CLASS="section"
18165
><A
18166
NAME="AEN3368"
18167
>25.5. Building RMI Stub and Skeleton Class Files:  the <CODE
18168
CLASS="function"
18169
>RMIC</CODE
18170
> Builder</A
18171
></H2
18172
><P
18173
>&#13;
18174
    You can generate Remote Method Invocation stubs
18175
    by using the <A
18176
HREF="#b-RMIC"
18177
><CODE
18178
CLASS="function"
18179
>RMIC</CODE
18180
></A
18181
> Builder.
18182
    The source is a list of directories,
18183
    typically returned by a call to the <A
18184
HREF="#b-Java"
18185
><CODE
18186
CLASS="function"
18187
>Java</CODE
18188
></A
18189
> Builder,
18190
    and the target is an output directory
18191
    where the <TT
18192
CLASS="filename"
18193
>_Stub.class</TT
18194
>
18195
    and <TT
18196
CLASS="filename"
18197
>_Skel.class</TT
18198
> files will
18199
    be placed:
18200
18201
    </P
18202
><PRE
18203
CLASS="programlisting"
18204
>&#13;      classes = Java(target = 'classes', source = 'src/pkg/sub')
18205
      RMIC(target = 'outdir', source = classes)
18206
    </PRE
18207
><P
18208
>&#13;
18209
    As it did with the <A
18210
HREF="#b-JavaH"
18211
><CODE
18212
CLASS="function"
18213
>JavaH</CODE
18214
></A
18215
> Builder,
18216
    <SPAN
18217
CLASS="application"
18218
>SCons</SPAN
18219
> remembers the class directory
18220
    and passes it as the <CODE
18221
CLASS="option"
18222
>-classpath</CODE
18223
> option
18224
    to <SPAN
18225
CLASS="application"
18226
>rmic</SPAN
18227
>:
18228
18229
    </P
18230
><PRE
18231
CLASS="screen"
18232
>&#13;      % <KBD
18233
CLASS="userinput"
18234
>scons -Q</KBD
18235
>
18236
      javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java
18237
      rmic -d outdir -classpath classes pkg.sub.Example1 pkg.sub.Example2
18238
    </PRE
18239
><P
18240
>&#13;
18241
    This example would generate the files
18242
    <TT
18243
CLASS="filename"
18244
>outdir/pkg/sub/Example1_Skel.class</TT
18245
>,
18246
    <TT
18247
CLASS="filename"
18248
>outdir/pkg/sub/Example1_Stub.class</TT
18249
>,
18250
    <TT
18251
CLASS="filename"
18252
>outdir/pkg/sub/Example2_Skel.class</TT
18253
> and
18254
    <TT
18255
CLASS="filename"
18256
>outdir/pkg/sub/Example2_Stub.class</TT
18257
>.
18258
18259
    </P
18260
></DIV
18261
></DIV
18262
><DIV
18263
CLASS="chapter"
18264
><HR><H1
18265
><A
18266
NAME="chap-troubleshooting"
18267
></A
18268
>Chapter 26. Troubleshooting</H1
18269
><P
18270
>&#13;
18271
  The experience of configuring any
18272
  software build tool to build a large code base
18273
  usually, at some point,
18274
  involves trying to figure out why
18275
  the tool is behaving a certain way,
18276
  and how to get it to behave the way you want.
18277
  <SPAN
18278
CLASS="application"
18279
>SCons</SPAN
18280
> is no different.
18281
  This appendix contains a number of
18282
  different ways in which you can
18283
  get some additional insight into <SPAN
18284
CLASS="application"
18285
>SCons</SPAN
18286
>' behavior.
18287
18288
  </P
18289
><P
18290
>&#13;
18291
  Note that we're always interested in trying to
18292
  improve how you can troubleshoot configuration problems.
18293
  If you run into a problem that has
18294
  you scratching your head,
18295
  and which there just doesn't seem to be a good way to debug,
18296
  odds are pretty good that someone else will run into
18297
  the same problem, too.
18298
  If so, please let the SCons development team know
18299
  (preferably by filing a bug report
18300
  or feature request at our project pages at tigris.org)
18301
  so that we can use your feedback
18302
  to try to come up with a better way to help you,
18303
  and others, get the necessary insight into <SPAN
18304
CLASS="application"
18305
>SCons</SPAN
18306
> behavior
18307
  to help identify and fix configuration issues.
18308
18309
  </P
18310
><DIV
18311
CLASS="section"
18312
><HR><H2
18313
CLASS="section"
18314
><A
18315
NAME="AEN3399"
18316
>26.1. Why is That Target Being Rebuilt?  the <TT
18317
CLASS="literal"
18318
>--debug=explain</TT
18319
> Option</A
18320
></H2
18321
><P
18322
>&#13;
18323
    Let's look at a simple example of
18324
    a misconfigured build
18325
    that causes a target to be rebuilt
18326
    every time <SPAN
18327
CLASS="application"
18328
>SCons</SPAN
18329
> is run:
18330
18331
    </P
18332
><PRE
18333
CLASS="programlisting"
18334
>&#13;      # Intentionally misspell the output file name in the
18335
      # command used to create the file:
18336
      Command('file.out', 'file.in', 'cp $SOURCE file.oout')
18337
    </PRE
18338
><P
18339
>&#13;
18340
    (Note to Windows users:  The POSIX <SPAN
18341
CLASS="application"
18342
>cp</SPAN
18343
> command
18344
    copies the first file named on the command line
18345
    to the second file.
18346
    In our example, it copies the <TT
18347
CLASS="filename"
18348
>file.in</TT
18349
> file
18350
    to the <TT
18351
CLASS="filename"
18352
>file.out</TT
18353
> file.)
18354
18355
    </P
18356
><P
18357
>&#13;
18358
    Now if we run <SPAN
18359
CLASS="application"
18360
>SCons</SPAN
18361
> multiple times on this example,
18362
    we see that it re-runs the <SPAN
18363
CLASS="application"
18364
>cp</SPAN
18365
>
18366
    command every time:
18367
18368
    </P
18369
><PRE
18370
CLASS="screen"
18371
>&#13;      % <KBD
18372
CLASS="userinput"
18373
>scons -Q</KBD
18374
>
18375
      cp file.in file.oout
18376
      % <KBD
18377
CLASS="userinput"
18378
>scons -Q</KBD
18379
>
18380
      cp file.in file.oout
18381
      % <KBD
18382
CLASS="userinput"
18383
>scons -Q</KBD
18384
>
18385
      cp file.in file.oout
18386
    </PRE
18387
><P
18388
>&#13;
18389
    In this example,
18390
    the underlying cause is obvious:
18391
    we've intentionally misspelled the output file name
18392
    in the <SPAN
18393
CLASS="application"
18394
>cp</SPAN
18395
> command,
18396
    so the command doesn't actually
18397
    build the <TT
18398
CLASS="filename"
18399
>file.out</TT
18400
> file that we've told <SPAN
18401
CLASS="application"
18402
>SCons</SPAN
18403
> to expect.
18404
    But if the problem weren't obvious,
18405
    it would be helpful
18406
    to specify the <TT
18407
CLASS="literal"
18408
>--debug=explain</TT
18409
> option
18410
    on the command line
18411
    to have <SPAN
18412
CLASS="application"
18413
>SCons</SPAN
18414
> tell us very specifically
18415
    why it's decided to rebuild the target:
18416
18417
    </P
18418
><PRE
18419
CLASS="screen"
18420
>&#13;      % <KBD
18421
CLASS="userinput"
18422
>scons -Q --debug=explain</KBD
18423
>
18424
      scons: building `file.out' because it doesn't exist
18425
      cp file.in file.oout
18426
    </PRE
18427
><P
18428
>&#13;
18429
    If this had been a more complicated example
18430
    involving a lot of build output,
18431
    having <SPAN
18432
CLASS="application"
18433
>SCons</SPAN
18434
> tell us that
18435
    it's trying to rebuild the target file
18436
    because it doesn't exist
18437
    would be an important clue
18438
    that something was wrong with
18439
    the command that we invoked to build it.
18440
18441
    </P
18442
><P
18443
>&#13;
18444
    The <TT
18445
CLASS="literal"
18446
>--debug=explain</TT
18447
> option also comes in handy
18448
    to help figure out what input file changed.
18449
    Given a simple configuration that builds
18450
    a program from three source files,
18451
    changing one of the source files
18452
    and rebuilding with the <TT
18453
CLASS="literal"
18454
>--debug=explain</TT
18455
>
18456
    option shows very specifically
18457
    why <SPAN
18458
CLASS="application"
18459
>SCons</SPAN
18460
> rebuilds the files that it does:
18461
18462
    </P
18463
><PRE
18464
CLASS="screen"
18465
>&#13;      % <KBD
18466
CLASS="userinput"
18467
>scons -Q</KBD
18468
>
18469
      cc -o file1.o -c file1.c
18470
      cc -o file2.o -c file2.c
18471
      cc -o file3.o -c file3.c
18472
      cc -o prog file1.o file2.o file3.o
18473
      % <KBD
18474
CLASS="userinput"
18475
>edit file2.c</KBD
18476
>
18477
          [CHANGE THE CONTENTS OF file2.c]
18478
      % <KBD
18479
CLASS="userinput"
18480
>scons -Q --debug=explain</KBD
18481
>
18482
      scons: rebuilding `file2.o' because `file2.c' changed
18483
      cc -o file2.o -c file2.c
18484
      scons: rebuilding `prog' because `file2.o' changed
18485
      cc -o prog file1.o file2.o file3.o
18486
    </PRE
18487
><P
18488
>&#13;
18489
    This becomes even more helpful
18490
    in identifying when a file is rebuilt
18491
    due to a change in an implicit dependency,
18492
    such as an incuded <TT
18493
CLASS="filename"
18494
>.h</TT
18495
> file.
18496
    If the <TT
18497
CLASS="filename"
18498
>file1.c</TT
18499
>
18500
    and <TT
18501
CLASS="filename"
18502
>file3.c</TT
18503
> files
18504
    in our example
18505
    both included a <TT
18506
CLASS="filename"
18507
>hello.h</TT
18508
> file,
18509
    then changing that included file
18510
    and re-running <SPAN
18511
CLASS="application"
18512
>SCons</SPAN
18513
> with the <TT
18514
CLASS="literal"
18515
>--debug=explain</TT
18516
> option
18517
    will pinpoint that it's the change to the included file
18518
    that starts the chain of rebuilds:
18519
18520
    </P
18521
><PRE
18522
CLASS="screen"
18523
>&#13;      % <KBD
18524
CLASS="userinput"
18525
>scons -Q</KBD
18526
>
18527
      cc -o file1.o -c -I. file1.c
18528
      cc -o file2.o -c -I. file2.c
18529
      cc -o file3.o -c -I. file3.c
18530
      cc -o prog file1.o file2.o file3.o
18531
      % <KBD
18532
CLASS="userinput"
18533
>edit hello.h</KBD
18534
>
18535
          [CHANGE THE CONTENTS OF hello.h]
18536
      % <KBD
18537
CLASS="userinput"
18538
>scons -Q --debug=explain</KBD
18539
>
18540
      scons: rebuilding `file1.o' because `hello.h' changed
18541
      cc -o file1.o -c -I. file1.c
18542
      scons: rebuilding `file3.o' because `hello.h' changed
18543
      cc -o file3.o -c -I. file3.c
18544
      scons: rebuilding `prog' because:
18545
                 `file1.o' changed
18546
                 `file3.o' changed
18547
      cc -o prog file1.o file2.o file3.o
18548
    </PRE
18549
><P
18550
>&#13;
18551
    (Note that the <TT
18552
CLASS="literal"
18553
>--debug=explain</TT
18554
> option will only tell you
18555
    why <SPAN
18556
CLASS="application"
18557
>SCons</SPAN
18558
> decided to rebuild necessary targets.
18559
    It does not tell you what files it examined
18560
    when deciding <SPAN
18561
CLASS="emphasis"
18562
><I
18563
CLASS="emphasis"
18564
>not</I
18565
></SPAN
18566
>
18567
    to rebuild a target file,
18568
    which is often a more valuable question to answer.)
18569
18570
    </P
18571
></DIV
18572
><DIV
18573
CLASS="section"
18574
><HR><H2
18575
CLASS="section"
18576
><A
18577
NAME="AEN3449"
18578
>26.2. What's in That Construction Environment?  the <CODE
18579
CLASS="function"
18580
>Dump</CODE
18581
> Method</A
18582
></H2
18583
><P
18584
>&#13;
18585
    When you create a construction environment,
18586
    <SPAN
18587
CLASS="application"
18588
>SCons</SPAN
18589
> populates it
18590
    with construction variables that are set up
18591
    for various compilers, linkers and utilities
18592
    that it finds on your system.
18593
    Although this is usually helpful and what you want,
18594
    it might be frustrating if <SPAN
18595
CLASS="application"
18596
>SCons</SPAN
18597
>
18598
    doesn't set certain variables that you
18599
    expect to be set.
18600
    In situations like this,
18601
    it's sometimes helpful to use the
18602
    construction environment <CODE
18603
CLASS="function"
18604
>Dump</CODE
18605
> method
18606
    to print all or some of
18607
    the construction variables.
18608
    Note that the <CODE
18609
CLASS="function"
18610
>Dump</CODE
18611
> method
18612
    <SPAN
18613
CLASS="emphasis"
18614
><I
18615
CLASS="emphasis"
18616
>returns</I
18617
></SPAN
18618
>
18619
    the representation of the variables
18620
    in the environment
18621
    for you to print (or otherwise manipulate):
18622
18623
    </P
18624
><PRE
18625
CLASS="programlisting"
18626
>&#13;         env = Environment()
18627
         print env.Dump()
18628
    </PRE
18629
><P
18630
>&#13;
18631
    On a POSIX system with gcc installed,
18632
    this might generate:
18633
18634
    </P
18635
><PRE
18636
CLASS="screen"
18637
>&#13;      % <KBD
18638
CLASS="userinput"
18639
>scons</KBD
18640
>
18641
      scons: Reading SConscript files ...
18642
      { 'BUILDERS': {'_InternalInstall': &#60;function InstallBuilderWrapper at 0x700000&#62;, '_InternalInstallAs': &#60;function InstallAsBuilderWrapper at 0x700000&#62;},
18643
        'CONFIGUREDIR': '#/.sconf_temp',
18644
        'CONFIGURELOG': '#/config.log',
18645
        'CPPSUFFIXES': [ '.c',
18646
                         '.C',
18647
                         '.cxx',
18648
                         '.cpp',
18649
                         '.c++',
18650
                         '.cc',
18651
                         '.h',
18652
                         '.H',
18653
                         '.hxx',
18654
                         '.hpp',
18655
                         '.hh',
18656
                         '.F',
18657
                         '.fpp',
18658
                         '.FPP',
18659
                         '.m',
18660
                         '.mm',
18661
                         '.S',
18662
                         '.spp',
18663
                         '.SPP'],
18664
        'DSUFFIXES': ['.d'],
18665
        'Dir': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18666
        'Dirs': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18667
        'ENV': {'PATH': '/usr/local/bin:/opt/bin:/bin:/usr/bin'},
18668
        'ESCAPE': &#60;function escape at 0x700000&#62;,
18669
        'File': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18670
        'IDLSUFFIXES': ['.idl', '.IDL'],
18671
        'INSTALL': &#60;function copyFunc at 0x700000&#62;,
18672
        'LATEXSUFFIXES': ['.tex', '.ltx', '.latex'],
18673
        'LIBPREFIX': 'lib',
18674
        'LIBPREFIXES': ['$LIBPREFIX'],
18675
        'LIBSUFFIX': '.a',
18676
        'LIBSUFFIXES': ['$LIBSUFFIX', '$SHLIBSUFFIX'],
18677
        'MAXLINELENGTH': 128072,
18678
        'OBJPREFIX': '',
18679
        'OBJSUFFIX': '.o',
18680
        'PLATFORM': 'posix',
18681
        'PROGPREFIX': '',
18682
        'PROGSUFFIX': '',
18683
        'PSPAWN': &#60;function piped_env_spawn at 0x700000&#62;,
18684
        'RDirs': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18685
        'SCANNERS': [],
18686
        'SHELL': 'sh',
18687
        'SHLIBPREFIX': '$LIBPREFIX',
18688
        'SHLIBSUFFIX': '.so',
18689
        'SHOBJPREFIX': '$OBJPREFIX',
18690
        'SHOBJSUFFIX': '$OBJSUFFIX',
18691
        'SPAWN': &#60;function spawnvpe_spawn at 0x700000&#62;,
18692
        'TEMPFILE': &#60;class SCons.Platform.TempFileMunge at 0x700000&#62;,
18693
        'TEMPFILEPREFIX': '@',
18694
        'TOOLS': ['install', 'install'],
18695
        '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}',
18696
        '_CPPINCFLAGS': '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
18697
        '_LIBDIRFLAGS': '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
18698
        '_LIBFLAGS': '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}',
18699
        '__RPATH': '$_RPATH',
18700
        '_concat': &#60;function _concat at 0x700000&#62;,
18701
        '_defines': &#60;function _defines at 0x700000&#62;,
18702
        '_stripixes': &#60;function _stripixes at 0x700000&#62;}
18703
      scons: done reading SConscript files.
18704
      scons: Building targets ...
18705
      scons: `.' is up to date.
18706
      scons: done building targets.
18707
    </PRE
18708
><P
18709
>&#13;
18710
    On a Windows system with Visual C++
18711
    the output might look like:
18712
18713
    </P
18714
><PRE
18715
CLASS="screen"
18716
>&#13;      C:\&#62;<KBD
18717
CLASS="userinput"
18718
>scons</KBD
18719
>
18720
      scons: Reading SConscript files ...
18721
      { 'BUILDERS': {'_InternalInstall': &#60;function InstallBuilderWrapper at 0x700000&#62;, 'Object': &#60;SCons.Builder.CompositeBuilder instance at 0x700000&#62;, 'PCH': &#60;SCons.Builder.BuilderBase instance at 0x700000&#62;, 'RES': &#60;SCons.Builder.BuilderBase instance at 0x700000&#62;, 'SharedObject': &#60;SCons.Builder.CompositeBuilder instance at 0x700000&#62;, 'StaticObject': &#60;SCons.Builder.CompositeBuilder instance at 0x700000&#62;, '_InternalInstallAs': &#60;function InstallAsBuilderWrapper at 0x700000&#62;},
18722
        'CC': 'cl',
18723
        'CCCOM': &#60;SCons.Action.FunctionAction instance at 0x700000&#62;,
18724
        'CCCOMFLAGS': '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS',
18725
        'CCFLAGS': ['/nologo'],
18726
        'CCPCHFLAGS': ['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'],
18727
        'CCPDBFLAGS': ['${(PDB and "/Z7") or ""}'],
18728
        'CFILESUFFIX': '.c',
18729
        'CFLAGS': [],
18730
        'CONFIGUREDIR': '#/.sconf_temp',
18731
        'CONFIGURELOG': '#/config.log',
18732
        'CPPDEFPREFIX': '/D',
18733
        'CPPDEFSUFFIX': '',
18734
        'CPPSUFFIXES': [ '.c',
18735
                         '.C',
18736
                         '.cxx',
18737
                         '.cpp',
18738
                         '.c++',
18739
                         '.cc',
18740
                         '.h',
18741
                         '.H',
18742
                         '.hxx',
18743
                         '.hpp',
18744
                         '.hh',
18745
                         '.F',
18746
                         '.fpp',
18747
                         '.FPP',
18748
                         '.m',
18749
                         '.mm',
18750
                         '.S',
18751
                         '.spp',
18752
                         '.SPP'],
18753
        'CXX': '$CC',
18754
        'CXXCOM': '$CXX $CXXFLAGS $CCCOMFLAGS',
18755
        'CXXFILESUFFIX': '.cc',
18756
        'CXXFLAGS': ['$CCFLAGS', '$(', '/TP', '$)'],
18757
        'DSUFFIXES': ['.d'],
18758
        'Dir': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18759
        'Dirs': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18760
        'ENV': { 'INCLUDE': 'C:\\Program Files\\Microsoft Visual Studio/VC98\\include',
18761
                 'LIB': 'C:\\Program Files\\Microsoft Visual Studio/VC98\\lib',
18762
                 'PATH': 'C:\\Program Files\\Microsoft Visual Studio\\Common\\tools\\WIN95;C:\\Program Files\\Microsoft Visual Studio\\Common\\MSDev98\\bin;C:\\Program Files\\Microsoft Visual Studio\\Common\\tools;C:\\Program Files\\Microsoft Visual Studio/VC98\\bin',
18763
                 'PATHEXT': '.COM;.EXE;.BAT;.CMD',
18764
                 'SystemRoot': 'C:/WINDOWS'},
18765
        'ESCAPE': &#60;function escape at 0x700000&#62;,
18766
        'File': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18767
        'IDLSUFFIXES': ['.idl', '.IDL'],
18768
        'INCPREFIX': '/I',
18769
        'INCSUFFIX': '',
18770
        'INSTALL': &#60;function copyFunc at 0x700000&#62;,
18771
        'LATEXSUFFIXES': ['.tex', '.ltx', '.latex'],
18772
        'LIBPREFIX': '',
18773
        'LIBPREFIXES': ['$LIBPREFIX'],
18774
        'LIBSUFFIX': '.lib',
18775
        'LIBSUFFIXES': ['$LIBSUFFIX'],
18776
        'MAXLINELENGTH': 2048,
18777
        'MSVS': {'VERSION': '6.0', 'VERSIONS': ['6.0']},
18778
        'MSVS_VERSION': '6.0',
18779
        'OBJPREFIX': '',
18780
        'OBJSUFFIX': '.obj',
18781
        'PCHCOM': '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS',
18782
        'PCHPDBFLAGS': ['${(PDB and "/Yd") or ""}'],
18783
        'PLATFORM': 'win32',
18784
        'PROGPREFIX': '',
18785
        'PROGSUFFIX': '.exe',
18786
        'PSPAWN': &#60;function piped_spawn at 0x700000&#62;,
18787
        'RC': 'rc',
18788
        'RCCOM': '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES',
18789
        'RCFLAGS': [],
18790
        'RDirs': &#60;SCons.Defaults.Variable_Method_Caller instance at 0x700000&#62;,
18791
        'SCANNERS': [],
18792
        'SHCC': '$CC',
18793
        'SHCCCOM': &#60;SCons.Action.FunctionAction instance at 0x700000&#62;,
18794
        'SHCCFLAGS': ['$CCFLAGS'],
18795
        'SHCFLAGS': ['$CFLAGS'],
18796
        'SHCXX': '$CXX',
18797
        'SHCXXCOM': '$SHCXX $SHCXXFLAGS $CCCOMFLAGS',
18798
        'SHCXXFLAGS': ['$CXXFLAGS'],
18799
        'SHELL': None,
18800
        'SHLIBPREFIX': '',
18801
        'SHLIBSUFFIX': '.dll',
18802
        'SHOBJPREFIX': '$OBJPREFIX',
18803
        'SHOBJSUFFIX': '$OBJSUFFIX',
18804
        'SPAWN': &#60;function spawn at 0x700000&#62;,
18805
        'STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME': 1,
18806
        'TEMPFILE': &#60;class SCons.Platform.TempFileMunge at 0x700000&#62;,
18807
        'TEMPFILEPREFIX': '@',
18808
        'TOOLS': ['msvc', 'install', 'install'],
18809
        '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}',
18810
        '_CPPINCFLAGS': '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
18811
        '_LIBDIRFLAGS': '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
18812
        '_LIBFLAGS': '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}',
18813
        '_concat': &#60;function _concat at 0x700000&#62;,
18814
        '_defines': &#60;function _defines at 0x700000&#62;,
18815
        '_stripixes': &#60;function _stripixes at 0x700000&#62;}
18816
      scons: done reading SConscript files.
18817
      scons: Building targets ...
18818
      scons: `.' is up to date.
18819
      scons: done building targets.
18820
    </PRE
18821
><P
18822
>&#13;
18823
    The construction environments in these examples have
18824
    actually been restricted to just gcc and Visual C++,
18825
    respectively.
18826
    In a real-life situation,
18827
    the construction environments will
18828
    likely contain a great many more variables.
18829
    Also note that we've massaged the example output above
18830
    to make the memory address of all objects a constant 0x700000.
18831
    In reality, you would see a different hexadecimal
18832
    number for each object.
18833
18834
    </P
18835
><P
18836
>&#13;
18837
    To make it easier to see just what you're
18838
    interested in,
18839
    the <CODE
18840
CLASS="function"
18841
>Dump</CODE
18842
> method allows you to
18843
    specify a specific constrcution variable
18844
    that you want to disply.
18845
    For example,
18846
    it's not unusual to want to verify
18847
    the external environment used to execute build commands,
18848
    to make sure that the PATH and other
18849
    environment variables are set up the way they should be.
18850
    You can do this as follows:
18851
18852
    </P
18853
><PRE
18854
CLASS="programlisting"
18855
>&#13;         env = Environment()
18856
         print env.Dump('ENV')
18857
    </PRE
18858
><P
18859
>&#13;
18860
    Which might display the following when executed on a POSIX system:
18861
18862
    </P
18863
><PRE
18864
CLASS="screen"
18865
>&#13;      % <KBD
18866
CLASS="userinput"
18867
>scons</KBD
18868
>
18869
      scons: Reading SConscript files ...
18870
      {'PATH': '/usr/local/bin:/opt/bin:/bin:/usr/bin'}
18871
      scons: done reading SConscript files.
18872
      scons: Building targets ...
18873
      scons: `.' is up to date.
18874
      scons: done building targets.
18875
    </PRE
18876
><P
18877
>&#13;
18878
    And the following when executed on a Windows system:
18879
18880
    </P
18881
><PRE
18882
CLASS="screen"
18883
>&#13;      C:\&#62;<KBD
18884
CLASS="userinput"
18885
>scons</KBD
18886
>
18887
      scons: Reading SConscript files ...
18888
      { 'INCLUDE': 'C:\\Program Files\\Microsoft Visual Studio/VC98\\include',
18889
        'LIB': 'C:\\Program Files\\Microsoft Visual Studio/VC98\\lib',
18890
        'PATH': 'C:\\Program Files\\Microsoft Visual Studio\\Common\\tools\\WIN95;C:\\Program Files\\Microsoft Visual Studio\\Common\\MSDev98\\bin;C:\\Program Files\\Microsoft Visual Studio\\Common\\tools;C:\\Program Files\\Microsoft Visual Studio/VC98\\bin',
18891
        'PATHEXT': '.COM;.EXE;.BAT;.CMD',
18892
        'SystemRoot': 'C:/WINDOWS'}
18893
      scons: done reading SConscript files.
18894
      scons: Building targets ...
18895
      scons: `.' is up to date.
18896
      scons: done building targets.
18897
    </PRE
18898
></DIV
18899
><DIV
18900
CLASS="section"
18901
><HR><H2
18902
CLASS="section"
18903
><A
18904
NAME="AEN3475"
18905
>26.3. What Dependencies Does <SPAN
18906
CLASS="application"
18907
>SCons</SPAN
18908
> Know About?  the <TT
18909
CLASS="literal"
18910
>--tree</TT
18911
> Option</A
18912
></H2
18913
><P
18914
>&#13;
18915
    Sometimes the best way to try to figure out what
18916
    <SPAN
18917
CLASS="application"
18918
>SCons</SPAN
18919
> is doing is simply to take a look at the
18920
    dependency graph that it constructs
18921
    based on your <TT
18922
CLASS="filename"
18923
>SConscript</TT
18924
> files.
18925
    The <TT
18926
CLASS="literal"
18927
>--tree</TT
18928
> option
18929
    will display all or part of the
18930
    <SPAN
18931
CLASS="application"
18932
>SCons</SPAN
18933
> dependency graph in an
18934
    "ASCII art" graphical format
18935
    that shows the dependency hierarchy.
18936
18937
    </P
18938
><P
18939
>&#13;
18940
    For example, given the following input <TT
18941
CLASS="filename"
18942
>SConstruct</TT
18943
> file:
18944
18945
    </P
18946
><PRE
18947
CLASS="programlisting"
18948
>&#13;         env = Environment(CPPPATH = ['.'])
18949
         env.Program('prog', ['f1.c', 'f2.c', 'f3.c'])
18950
    </PRE
18951
><P
18952
>&#13;
18953
    Running <SPAN
18954
CLASS="application"
18955
>SCons</SPAN
18956
> with the <TT
18957
CLASS="literal"
18958
>--tree=all</TT
18959
>
18960
    option yields:
18961
18962
    </P
18963
><PRE
18964
CLASS="screen"
18965
>&#13;      % <KBD
18966
CLASS="userinput"
18967
>scons -Q --tree=all</KBD
18968
>
18969
      cc -o f1.o -c -I. f1.c
18970
      cc -o f2.o -c -I. f2.c
18971
      cc -o f3.o -c -I. f3.c
18972
      cc -o prog f1.o f2.o f3.o
18973
      +-.
18974
        +-SConstruct
18975
        +-f1.c
18976
        +-f1.o
18977
        | +-f1.c
18978
        | +-inc.h
18979
        +-f2.c
18980
        +-f2.o
18981
        | +-f2.c
18982
        | +-inc.h
18983
        +-f3.c
18984
        +-f3.o
18985
        | +-f3.c
18986
        | +-inc.h
18987
        +-inc.h
18988
        +-prog
18989
          +-f1.o
18990
          | +-f1.c
18991
          | +-inc.h
18992
          +-f2.o
18993
          | +-f2.c
18994
          | +-inc.h
18995
          +-f3.o
18996
            +-f3.c
18997
            +-inc.h
18998
    </PRE
18999
><P
19000
>&#13;
19001
    The tree will also be printed when the
19002
    <TT
19003
CLASS="literal"
19004
>-n</TT
19005
> (no execute) option is used,
19006
    which allows you to examine the dependency graph
19007
    for a configuration without actually
19008
    rebuilding anything in the tree.
19009
19010
    </P
19011
><P
19012
>&#13;
19013
    The <TT
19014
CLASS="literal"
19015
>--tree</TT
19016
> option only prints
19017
    the dependency graph for the specified targets
19018
    (or the default target(s) if none are specified on the command line).
19019
    So if you specify a target like <TT
19020
CLASS="filename"
19021
>f2.o</TT
19022
>
19023
    on the command line,
19024
    the <TT
19025
CLASS="literal"
19026
>--tree</TT
19027
> option will only
19028
    print the dependency graph for that file:
19029
19030
    </P
19031
><PRE
19032
CLASS="screen"
19033
>&#13;      % <KBD
19034
CLASS="userinput"
19035
>scons -Q --tree=all f2.o</KBD
19036
>
19037
      cc -o f2.o -c -I. f2.c
19038
      +-f2.o
19039
        +-f2.c
19040
        +-inc.h
19041
    </PRE
19042
><P
19043
>&#13;
19044
    This is, of course, useful for
19045
    restricting the output from a very large
19046
    build configuration to just a
19047
    portion in which you're interested.
19048
    Multiple targets are fine,
19049
    in which case a tree will be printed
19050
    for each specified target:
19051
19052
    </P
19053
><PRE
19054
CLASS="screen"
19055
>&#13;      % <KBD
19056
CLASS="userinput"
19057
>scons -Q --tree=all f1.o f3.o</KBD
19058
>
19059
      cc -o f1.o -c -I. f1.c
19060
      +-f1.o
19061
        +-f1.c
19062
        +-inc.h
19063
      cc -o f3.o -c -I. f3.c
19064
      +-f3.o
19065
        +-f3.c
19066
        +-inc.h
19067
    </PRE
19068
><P
19069
>&#13;
19070
    The <TT
19071
CLASS="literal"
19072
>status</TT
19073
> argument may be used
19074
    to tell <SPAN
19075
CLASS="application"
19076
>SCons</SPAN
19077
> to print status information about
19078
    each file in the dependency graph:
19079
19080
    </P
19081
><PRE
19082
CLASS="screen"
19083
>&#13;      % <KBD
19084
CLASS="userinput"
19085
>scons -Q --tree=status</KBD
19086
>
19087
      cc -o f1.o -c -I. f1.c
19088
      cc -o f2.o -c -I. f2.c
19089
      cc -o f3.o -c -I. f3.c
19090
      cc -o prog f1.o f2.o f3.o
19091
       E         = exists
19092
        R        = exists in repository only
19093
         b       = implicit builder
19094
         B       = explicit builder
19095
          S      = side effect
19096
           P     = precious
19097
            A    = always build
19098
             C   = current
19099
              N  = no clean
19100
               H = no cache
19101
      
19102
      [E b      ]+-.
19103
      [E     C  ]  +-SConstruct
19104
      [E     C  ]  +-f1.c
19105
      [E B   C  ]  +-f1.o
19106
      [E     C  ]  | +-f1.c
19107
      [E     C  ]  | +-inc.h
19108
      [E     C  ]  +-f2.c
19109
      [E B   C  ]  +-f2.o
19110
      [E     C  ]  | +-f2.c
19111
      [E     C  ]  | +-inc.h
19112
      [E     C  ]  +-f3.c
19113
      [E B   C  ]  +-f3.o
19114
      [E     C  ]  | +-f3.c
19115
      [E     C  ]  | +-inc.h
19116
      [E     C  ]  +-inc.h
19117
      [E B   C  ]  +-prog
19118
      [E B   C  ]    +-f1.o
19119
      [E     C  ]    | +-f1.c
19120
      [E     C  ]    | +-inc.h
19121
      [E B   C  ]    +-f2.o
19122
      [E     C  ]    | +-f2.c
19123
      [E     C  ]    | +-inc.h
19124
      [E B   C  ]    +-f3.o
19125
      [E     C  ]      +-f3.c
19126
      [E     C  ]      +-inc.h
19127
    </PRE
19128
><P
19129
>&#13;
19130
    Note that <TT
19131
CLASS="literal"
19132
>--tree=all,status</TT
19133
> is equivalent;
19134
    the <TT
19135
CLASS="literal"
19136
>all</TT
19137
>
19138
    is assumed if only <TT
19139
CLASS="literal"
19140
>status</TT
19141
> is present.
19142
    As an alternative to <TT
19143
CLASS="literal"
19144
>all</TT
19145
>,
19146
    you can specify <TT
19147
CLASS="literal"
19148
>--tree=derived</TT
19149
>
19150
    to have <SPAN
19151
CLASS="application"
19152
>SCons</SPAN
19153
> only print derived targets
19154
    in the tree output,
19155
    skipping source files
19156
    (like <TT
19157
CLASS="filename"
19158
>.c</TT
19159
> and <TT
19160
CLASS="filename"
19161
>.h</TT
19162
> files):
19163
19164
    </P
19165
><PRE
19166
CLASS="screen"
19167
>&#13;      % <KBD
19168
CLASS="userinput"
19169
>scons -Q --tree=derived</KBD
19170
>
19171
      cc -o f1.o -c -I. f1.c
19172
      cc -o f2.o -c -I. f2.c
19173
      cc -o f3.o -c -I. f3.c
19174
      cc -o prog f1.o f2.o f3.o
19175
      +-.
19176
        +-f1.o
19177
        +-f2.o
19178
        +-f3.o
19179
        +-prog
19180
          +-f1.o
19181
          +-f2.o
19182
          +-f3.o
19183
    </PRE
19184
><P
19185
>&#13;
19186
    You can use the <TT
19187
CLASS="literal"
19188
>status</TT
19189
>
19190
    modifier with <TT
19191
CLASS="literal"
19192
>derived</TT
19193
> as well:
19194
19195
    </P
19196
><PRE
19197
CLASS="screen"
19198
>&#13;      % <KBD
19199
CLASS="userinput"
19200
>scons -Q --tree=derived,status</KBD
19201
>
19202
      cc -o f1.o -c -I. f1.c
19203
      cc -o f2.o -c -I. f2.c
19204
      cc -o f3.o -c -I. f3.c
19205
      cc -o prog f1.o f2.o f3.o
19206
       E         = exists
19207
        R        = exists in repository only
19208
         b       = implicit builder
19209
         B       = explicit builder
19210
          S      = side effect
19211
           P     = precious
19212
            A    = always build
19213
             C   = current
19214
              N  = no clean
19215
               H = no cache
19216
      
19217
      [E b      ]+-.
19218
      [E B   C  ]  +-f1.o
19219
      [E B   C  ]  +-f2.o
19220
      [E B   C  ]  +-f3.o
19221
      [E B   C  ]  +-prog
19222
      [E B   C  ]    +-f1.o
19223
      [E B   C  ]    +-f2.o
19224
      [E B   C  ]    +-f3.o
19225
    </PRE
19226
><P
19227
>&#13;
19228
    Note that the order of the <TT
19229
CLASS="literal"
19230
>--tree=</TT
19231
>
19232
    arguments doesn't matter;
19233
    <TT
19234
CLASS="literal"
19235
>--tree=status,derived</TT
19236
> is
19237
    completely equivalent.
19238
19239
    </P
19240
><P
19241
>&#13;
19242
    The default behavior of the <TT
19243
CLASS="literal"
19244
>--tree</TT
19245
> option
19246
    is to repeat all of the dependencies each time the library dependency
19247
    (or any other dependency file) is encountered in the tree.
19248
    If certain target files share other target files,
19249
    such as two programs that use the same library:
19250
19251
    </P
19252
><PRE
19253
CLASS="programlisting"
19254
>&#13;         env = Environment(CPPPATH = ['.'],
19255
                           LIBS = ['foo'],
19256
                           LIBPATH = ['.'])
19257
         env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
19258
         env.Program('prog1.c')
19259
         env.Program('prog2.c')
19260
    </PRE
19261
><P
19262
>&#13;
19263
    Then there can be a <SPAN
19264
CLASS="emphasis"
19265
><I
19266
CLASS="emphasis"
19267
>lot</I
19268
></SPAN
19269
> of repetition in the
19270
    <TT
19271
CLASS="literal"
19272
>--tree=</TT
19273
> output:
19274
19275
    </P
19276
><PRE
19277
CLASS="screen"
19278
>&#13;      % <KBD
19279
CLASS="userinput"
19280
>scons -Q --tree=all</KBD
19281
>
19282
      cc -o f1.o -c -I. f1.c
19283
      cc -o f2.o -c -I. f2.c
19284
      cc -o f3.o -c -I. f3.c
19285
      ar rc libfoo.a f1.o f2.o f3.o
19286
      ranlib libfoo.a
19287
      cc -o prog1.o -c -I. prog1.c
19288
      cc -o prog1 prog1.o -L. -lfoo
19289
      cc -o prog2.o -c -I. prog2.c
19290
      cc -o prog2 prog2.o -L. -lfoo
19291
      +-.
19292
        +-SConstruct
19293
        +-f1.c
19294
        +-f1.o
19295
        | +-f1.c
19296
        | +-inc.h
19297
        +-f2.c
19298
        +-f2.o
19299
        | +-f2.c
19300
        | +-inc.h
19301
        +-f3.c
19302
        +-f3.o
19303
        | +-f3.c
19304
        | +-inc.h
19305
        +-inc.h
19306
        +-libfoo.a
19307
        | +-f1.o
19308
        | | +-f1.c
19309
        | | +-inc.h
19310
        | +-f2.o
19311
        | | +-f2.c
19312
        | | +-inc.h
19313
        | +-f3.o
19314
        |   +-f3.c
19315
        |   +-inc.h
19316
        +-prog1
19317
        | +-prog1.o
19318
        | | +-prog1.c
19319
        | | +-inc.h
19320
        | +-libfoo.a
19321
        |   +-f1.o
19322
        |   | +-f1.c
19323
        |   | +-inc.h
19324
        |   +-f2.o
19325
        |   | +-f2.c
19326
        |   | +-inc.h
19327
        |   +-f3.o
19328
        |     +-f3.c
19329
        |     +-inc.h
19330
        +-prog1.c
19331
        +-prog1.o
19332
        | +-prog1.c
19333
        | +-inc.h
19334
        +-prog2
19335
        | +-prog2.o
19336
        | | +-prog2.c
19337
        | | +-inc.h
19338
        | +-libfoo.a
19339
        |   +-f1.o
19340
        |   | +-f1.c
19341
        |   | +-inc.h
19342
        |   +-f2.o
19343
        |   | +-f2.c
19344
        |   | +-inc.h
19345
        |   +-f3.o
19346
        |     +-f3.c
19347
        |     +-inc.h
19348
        +-prog2.c
19349
        +-prog2.o
19350
          +-prog2.c
19351
          +-inc.h
19352
    </PRE
19353
><P
19354
>&#13;
19355
    In a large configuration with many internal libraries
19356
    and include files,
19357
    this can very quickly lead to huge output trees.
19358
    To help make this more manageable,
19359
    a <TT
19360
CLASS="literal"
19361
>prune</TT
19362
> modifier may
19363
    be added to the option list,
19364
    in which case <SPAN
19365
CLASS="application"
19366
>SCons</SPAN
19367
>
19368
    will print the name of a target that has
19369
    already been visited during the tree-printing
19370
    in <TT
19371
CLASS="literal"
19372
>[square brackets]</TT
19373
>
19374
    as an indication that the dependencies
19375
    of the target file may be found
19376
    by looking farther up the tree:
19377
19378
    </P
19379
><PRE
19380
CLASS="screen"
19381
>&#13;      % <KBD
19382
CLASS="userinput"
19383
>scons -Q --tree=prune</KBD
19384
>
19385
      cc -o f1.o -c -I. f1.c
19386
      cc -o f2.o -c -I. f2.c
19387
      cc -o f3.o -c -I. f3.c
19388
      ar rc libfoo.a f1.o f2.o f3.o
19389
      ranlib libfoo.a
19390
      cc -o prog1.o -c -I. prog1.c
19391
      cc -o prog1 prog1.o -L. -lfoo
19392
      cc -o prog2.o -c -I. prog2.c
19393
      cc -o prog2 prog2.o -L. -lfoo
19394
      +-.
19395
        +-SConstruct
19396
        +-f1.c
19397
        +-f1.o
19398
        | +-f1.c
19399
        | +-inc.h
19400
        +-f2.c
19401
        +-f2.o
19402
        | +-f2.c
19403
        | +-inc.h
19404
        +-f3.c
19405
        +-f3.o
19406
        | +-f3.c
19407
        | +-inc.h
19408
        +-inc.h
19409
        +-libfoo.a
19410
        | +-[f1.o]
19411
        | +-[f2.o]
19412
        | +-[f3.o]
19413
        +-prog1
19414
        | +-prog1.o
19415
        | | +-prog1.c
19416
        | | +-inc.h
19417
        | +-[libfoo.a]
19418
        +-prog1.c
19419
        +-[prog1.o]
19420
        +-prog2
19421
        | +-prog2.o
19422
        | | +-prog2.c
19423
        | | +-inc.h
19424
        | +-[libfoo.a]
19425
        +-prog2.c
19426
        +-[prog2.o]
19427
    </PRE
19428
><P
19429
>&#13;
19430
    Like the <TT
19431
CLASS="literal"
19432
>status</TT
19433
> keyword,
19434
    the <TT
19435
CLASS="literal"
19436
>prune</TT
19437
> argument by itself
19438
    is equivalent to <TT
19439
CLASS="literal"
19440
>--tree=all,prune</TT
19441
>.
19442
19443
    </P
19444
></DIV
19445
><DIV
19446
CLASS="section"
19447
><HR><H2
19448
CLASS="section"
19449
><A
19450
NAME="AEN3545"
19451
>26.4. How is <SPAN
19452
CLASS="application"
19453
>SCons</SPAN
19454
> Constructing the Command Lines It Executes?  the <TT
19455
CLASS="literal"
19456
>--debug=presub</TT
19457
> Option</A
19458
></H2
19459
><P
19460
>&#13;
19461
    Sometimes it's useful to look at the
19462
    pre-substitution string
19463
    that <SPAN
19464
CLASS="application"
19465
>SCons</SPAN
19466
> uses to generate
19467
    the command lines it executes.
19468
    This can be done with the <TT
19469
CLASS="literal"
19470
>--debug=presub</TT
19471
> option:
19472
19473
    </P
19474
><PRE
19475
CLASS="screen"
19476
>&#13;      % <KBD
19477
CLASS="userinput"
19478
>scons -Q --debug=presub</KBD
19479
>
19480
      Building prog.o with action:
19481
        $CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCOMCOM $SOURCES
19482
      cc -o prog.o -c -I. prog.c
19483
      Building prog with action:
19484
        $SMART_LINKCOM
19485
      cc -o prog prog.o
19486
    </PRE
19487
></DIV
19488
><DIV
19489
CLASS="section"
19490
><HR><H2
19491
CLASS="section"
19492
><A
19493
NAME="AEN3554"
19494
>26.5. Where is <SPAN
19495
CLASS="application"
19496
>SCons</SPAN
19497
> Searching for Libraries?  the <TT
19498
CLASS="literal"
19499
>--debug=findlibs</TT
19500
> Option</A
19501
></H2
19502
><P
19503
>&#13;
19504
    To get some insight into what library names
19505
    <SPAN
19506
CLASS="application"
19507
>SCons</SPAN
19508
> is searching for,
19509
    and in which directories it is searching,
19510
    Use the <TT
19511
CLASS="literal"
19512
>--debug=findlibs</TT
19513
> option.
19514
    Given the following input <TT
19515
CLASS="filename"
19516
>SConstruct</TT
19517
> file:
19518
19519
    </P
19520
><PRE
19521
CLASS="programlisting"
19522
>&#13;        env = Environment(LIBPATH = ['libs1', 'libs2'])
19523
        env.Program('prog.c', LIBS=['foo', 'bar'])
19524
    </PRE
19525
><P
19526
>&#13;
19527
    And the libraries <TT
19528
CLASS="filename"
19529
>libfoo.a</TT
19530
>
19531
    and <TT
19532
CLASS="filename"
19533
>libbar.a</TT
19534
>
19535
    in <TT
19536
CLASS="filename"
19537
>libs1</TT
19538
> and <TT
19539
CLASS="filename"
19540
>libs2</TT
19541
>,
19542
    respectively,
19543
    use of the <TT
19544
CLASS="literal"
19545
>--debug=findlibs</TT
19546
> option yields:
19547
19548
    </P
19549
><PRE
19550
CLASS="screen"
19551
>&#13;      % <KBD
19552
CLASS="userinput"
19553
>scons -Q --debug=findlibs</KBD
19554
>
19555
        findlibs: looking for 'libfoo.a' in 'libs1' ...
19556
        findlibs: ... FOUND 'libfoo.a' in 'libs1'
19557
        findlibs: looking for 'libfoo.so' in 'libs1' ...
19558
        findlibs: looking for 'libfoo.so' in 'libs2' ...
19559
        findlibs: looking for 'libbar.a' in 'libs1' ...
19560
        findlibs: looking for 'libbar.a' in 'libs2' ...
19561
        findlibs: ... FOUND 'libbar.a' in 'libs2'
19562
        findlibs: looking for 'libbar.so' in 'libs1' ...
19563
        findlibs: looking for 'libbar.so' in 'libs2' ...
19564
      cc -o prog.o -c prog.c
19565
      cc -o prog prog.o -Llibs1 -Llibs2 -lfoo -lbar
19566
    </PRE
19567
></DIV
19568
><DIV
19569
CLASS="section"
19570
><HR><H2
19571
CLASS="section"
19572
><A
19573
NAME="AEN3571"
19574
>26.6. Where is <SPAN
19575
CLASS="application"
19576
>SCons</SPAN
19577
> Blowing Up?  the <TT
19578
CLASS="literal"
19579
>--debug=stacktrace</TT
19580
> Option</A
19581
></H2
19582
><P
19583
>&#13;
19584
    In general, <SPAN
19585
CLASS="application"
19586
>SCons</SPAN
19587
> tries to keep its error
19588
    messages short and informative.
19589
    That means we usually try to avoid showing
19590
    the stack traces that are familiar
19591
    to experienced Python programmers,
19592
    since they usually contain much more
19593
    information than is useful to most people.
19594
19595
    </P
19596
><P
19597
>&#13;
19598
    For example, the following <TT
19599
CLASS="filename"
19600
>SConstruct</TT
19601
> file:
19602
19603
    </P
19604
><PRE
19605
CLASS="programlisting"
19606
>&#13;         Program('prog.c')
19607
    </PRE
19608
><P
19609
>&#13;
19610
    Generates the following error if the
19611
    <TT
19612
CLASS="filename"
19613
>prog.c</TT
19614
> file
19615
    does not exist:
19616
19617
    </P
19618
><PRE
19619
CLASS="screen"
19620
>&#13;      % <KBD
19621
CLASS="userinput"
19622
>scons -Q</KBD
19623
>
19624
      scons: *** Source `prog.c' not found, needed by target `prog.o'.  Stop.
19625
    </PRE
19626
><P
19627
>&#13;
19628
    In this case,
19629
    the error is pretty obvious.
19630
    But if it weren't,
19631
    and you wanted to try to get more information
19632
    about the error,
19633
    the <TT
19634
CLASS="literal"
19635
>--debug=stacktrace</TT
19636
> option
19637
    would show you exactly where in the <SPAN
19638
CLASS="application"
19639
>SCons</SPAN
19640
> source code
19641
    the problem occurs:
19642
19643
    </P
19644
><PRE
19645
CLASS="screen"
19646
>&#13;      % <KBD
19647
CLASS="userinput"
19648
>scons -Q --debug=stacktrace</KBD
19649
>
19650
      scons: *** Source `prog.c' not found, needed by target `prog.o'.  Stop.
19651
      scons: internal stack trace:
19652
        File "bootstrap/src/engine/SCons/Job.py", line 187, in start
19653
        File "bootstrap/src/engine/SCons/Script/Main.py", line 169, in prepare
19654
        File "bootstrap/src/engine/SCons/Taskmaster.py", line 184, in prepare
19655
        File "bootstrap/src/engine/SCons/Executor.py", line 171, in prepare
19656
    </PRE
19657
><P
19658
>&#13;
19659
    Of course, if you do need to dive into the <SPAN
19660
CLASS="application"
19661
>SCons</SPAN
19662
> source code,
19663
    we'd like to know if, or how,
19664
    the error messages or troubleshooting options
19665
    could have been improved to avoid that.
19666
    Not everyone has the necessary time or
19667
    Python skill to dive into the source code,
19668
    and we'd like to improve <SPAN
19669
CLASS="application"
19670
>SCons</SPAN
19671
>
19672
    for those people as well...
19673
19674
    </P
19675
></DIV
19676
><DIV
19677
CLASS="section"
19678
><HR><H2
19679
CLASS="section"
19680
><A
19681
NAME="AEN3592"
19682
>26.7. How is <SPAN
19683
CLASS="application"
19684
>SCons</SPAN
19685
> Making Its Decisions?  the <TT
19686
CLASS="literal"
19687
>--taskmastertrace</TT
19688
> Option</A
19689
></H2
19690
><P
19691
>&#13;
19692
    The internal <SPAN
19693
CLASS="application"
19694
>SCons</SPAN
19695
> subsystem that handles walking
19696
    the dependency graph
19697
    and controls the decision-making about what to rebuild
19698
    is the <TT
19699
CLASS="literal"
19700
>Taskmaster</TT
19701
>.
19702
    <SPAN
19703
CLASS="application"
19704
>SCons</SPAN
19705
> supports a <TT
19706
CLASS="literal"
19707
>--taskmastertrace</TT
19708
>
19709
    option that tells the Taskmaster to print
19710
    information about the children (dependencies)
19711
    of the various Nodes on its walk down the graph,
19712
    which specific dependent Nodes are being evaluated,
19713
    and in what order.
19714
19715
    </P
19716
><P
19717
>&#13;
19718
    The <TT
19719
CLASS="literal"
19720
>--taskmastertrace</TT
19721
> option
19722
    takes as an argument the name of a file in
19723
    which to put the trace output,
19724
    with <TT
19725
CLASS="filename"
19726
>-</TT
19727
> (a single hyphen)
19728
    indicating that the trace messages
19729
    should be printed to the standard output:
19730
19731
    </P
19732
><PRE
19733
CLASS="programlisting"
19734
>&#13;      env = Environment(CPPPATH = ['.'])
19735
      env.Program('prog.c')
19736
    </PRE
19737
><PRE
19738
CLASS="screen"
19739
>&#13;      % <KBD
19740
CLASS="userinput"
19741
>scons -Q --taskmastertrace=- prog</KBD
19742
>
19743
      
19744
      Taskmaster: Looking for a node to evaluate
19745
      Taskmaster:     Considering node &#60;no_state   'prog'&#62; and its children:
19746
      Taskmaster:        &#60;no_state   'prog.o'&#62;
19747
      Taskmaster:     Considering node &#60;no_state   'prog.o'&#62; and its children:
19748
      Taskmaster:        &#60;no_state   'prog.c'&#62;
19749
      Taskmaster:        &#60;no_state   'inc.h'&#62;
19750
      Taskmaster:     Considering node &#60;no_state   'prog.c'&#62; and its children:
19751
      Taskmaster: Evaluating &#60;pending    'prog.c'&#62;
19752
      
19753
      Taskmaster: Looking for a node to evaluate
19754
      Taskmaster:     Considering node &#60;no_state   'inc.h'&#62; and its children:
19755
      Taskmaster: Evaluating &#60;pending    'inc.h'&#62;
19756
      
19757
      Taskmaster: Looking for a node to evaluate
19758
      Taskmaster:     Considering node &#60;pending    'prog.o'&#62; and its children:
19759
      Taskmaster:        &#60;up_to_date 'prog.c'&#62;
19760
      Taskmaster:        &#60;up_to_date 'inc.h'&#62;
19761
      Taskmaster: Evaluating &#60;pending    'prog.o'&#62;
19762
      cc -o prog.o -c -I. prog.c
19763
      
19764
      Taskmaster: Looking for a node to evaluate
19765
      Taskmaster:     Considering node &#60;pending    'prog'&#62; and its children:
19766
      Taskmaster:        &#60;executed   'prog.o'&#62;
19767
      Taskmaster: Evaluating &#60;pending    'prog'&#62;
19768
      cc -o prog prog.o
19769
      
19770
      Taskmaster: Looking for a node to evaluate
19771
      Taskmaster: No candidate anymore.
19772
    </PRE
19773
><P
19774
>&#13;
19775
    The <TT
19776
CLASS="literal"
19777
>--taskmastertrace</TT
19778
> option
19779
    doesn't provide information about the actual
19780
    calculations involved in deciding if a file is up-to-date,
19781
    but it does show all of the dependencies
19782
    it knows about for each Node,
19783
    and the order in which those dependencies are evaluated.
19784
    This can be useful as an alternate way to determine
19785
    whether or not your <SPAN
19786
CLASS="application"
19787
>SCons</SPAN
19788
> configuration,
19789
    or the implicit dependency scan,
19790
    has actually identified all the correct dependencies
19791
    you want it to.
19792
19793
    </P
19794
></DIV
19795
></DIV
19796
><DIV
19797
CLASS="appendix"
19798
><HR><H1
19799
><A
19800
NAME="app-variables"
19801
></A
19802
>Appendix A. Construction Variables</H1
19803
><P
19804
>&#13;
19805
This appendix contains descriptions of all of the
19806
construction variables that are <SPAN
19807
CLASS="emphasis"
19808
><I
19809
CLASS="emphasis"
19810
>potentially</I
19811
></SPAN
19812
>
19813
available "out of the box" in this version of SCons.
19814
Whether or not setting a construction variable
19815
in a construction environment
19816
will actually have an effect depends on
19817
whether any of the Tools and/or Builders
19818
that use the variable have been
19819
included in the construction environment.
19820
19821
</P
19822
><P
19823
>&#13;
19824
In this appendix, we have
19825
appended the initial <CODE
19826
CLASS="envar"
19827
>$</CODE
19828
>
19829
(dollar sign) to the beginning of each
19830
variable name when it appears in the text,
19831
but left off the dollar sign
19832
in the left-hand column
19833
where the name appears for each entry.
19834
19835
</P
19836
><P
19837
></P
19838
><DIV
19839
CLASS="variablelist"
19840
><DL
19841
><DT
19842
><A
19843
NAME="cv-AR"
19844
></A
19845
><CODE
19846
CLASS="envar"
19847
>AR</CODE
19848
></DT
19849
><DD
19850
><P
19851
>&#13;The static library archiver.
19852
</P
19853
></DD
19854
><DT
19855
><A
19856
NAME="cv-ARCHITECTURE"
19857
></A
19858
><CODE
19859
CLASS="envar"
19860
>ARCHITECTURE</CODE
19861
></DT
19862
><DD
19863
><P
19864
>&#13;Specifies the system architecture for which
19865
the package is being built.
19866
The default is the system architecture
19867
of the machine on which SCons is running.
19868
This is used to fill in the
19869
<TT
19870
CLASS="literal"
19871
>Architecture:</TT
19872
>
19873
field in an Ipkg
19874
<TT
19875
CLASS="filename"
19876
>control</TT
19877
> file,
19878
and as part of the name of a generated RPM file.
19879
</P
19880
></DD
19881
><DT
19882
><A
19883
NAME="cv-ARCOM"
19884
></A
19885
><CODE
19886
CLASS="envar"
19887
>ARCOM</CODE
19888
></DT
19889
><DD
19890
><P
19891
>&#13;The command line used to generate a static library from object files.
19892
</P
19893
></DD
19894
><DT
19895
><A
19896
NAME="cv-ARCOMSTR"
19897
></A
19898
><CODE
19899
CLASS="envar"
19900
>ARCOMSTR</CODE
19901
></DT
19902
><DD
19903
><P
19904
>&#13;The string displayed when an object file
19905
is generated from an assembly-language source file.
19906
If this is not set, then <A
19907
HREF="#cv-ARCOM"
19908
><CODE
19909
CLASS="envar"
19910
>$ARCOM</CODE
19911
></A
19912
> (the command line) is displayed.
19913
</P
19914
><PRE
19915
CLASS="programlisting"
19916
>&#13;env = Environment(ARCOMSTR = "Archiving $TARGET")
19917
</PRE
19918
></DD
19919
><DT
19920
><A
19921
NAME="cv-ARFLAGS"
19922
></A
19923
><CODE
19924
CLASS="envar"
19925
>ARFLAGS</CODE
19926
></DT
19927
><DD
19928
><P
19929
>&#13;General options passed to the static library archiver.
19930
</P
19931
></DD
19932
><DT
19933
><A
19934
NAME="cv-AS"
19935
></A
19936
><CODE
19937
CLASS="envar"
19938
>AS</CODE
19939
></DT
19940
><DD
19941
><P
19942
>&#13;The assembler.
19943
</P
19944
></DD
19945
><DT
19946
><A
19947
NAME="cv-ASCOM"
19948
></A
19949
><CODE
19950
CLASS="envar"
19951
>ASCOM</CODE
19952
></DT
19953
><DD
19954
><P
19955
>&#13;The command line used to generate an object file
19956
from an assembly-language source file.
19957
</P
19958
></DD
19959
><DT
19960
><A
19961
NAME="cv-ASCOMSTR"
19962
></A
19963
><CODE
19964
CLASS="envar"
19965
>ASCOMSTR</CODE
19966
></DT
19967
><DD
19968
><P
19969
>&#13;The string displayed when an object file
19970
is generated from an assembly-language source file.
19971
If this is not set, then <A
19972
HREF="#cv-ASCOM"
19973
><CODE
19974
CLASS="envar"
19975
>$ASCOM</CODE
19976
></A
19977
> (the command line) is displayed.
19978
</P
19979
><PRE
19980
CLASS="programlisting"
19981
>&#13;env = Environment(ASCOMSTR = "Assembling $TARGET")
19982
</PRE
19983
></DD
19984
><DT
19985
><A
19986
NAME="cv-ASFLAGS"
19987
></A
19988
><CODE
19989
CLASS="envar"
19990
>ASFLAGS</CODE
19991
></DT
19992
><DD
19993
><P
19994
>&#13;General options passed to the assembler.
19995
</P
19996
></DD
19997
><DT
19998
><A
19999
NAME="cv-ASPPCOM"
20000
></A
20001
><CODE
20002
CLASS="envar"
20003
>ASPPCOM</CODE
20004
></DT
20005
><DD
20006
><P
20007
>&#13;The command line used to assemble an assembly-language
20008
source file into an object file
20009
after first running the file through the C preprocessor.
20010
Any options specified
20011
in the <A
20012
HREF="#cv-ASFLAGS"
20013
><CODE
20014
CLASS="envar"
20015
>$ASFLAGS</CODE
20016
></A
20017
> and <A
20018
HREF="#cv-CPPFLAGS"
20019
><CODE
20020
CLASS="envar"
20021
>$CPPFLAGS</CODE
20022
></A
20023
> construction variables
20024
are included on this command line.
20025
</P
20026
></DD
20027
><DT
20028
><A
20029
NAME="cv-ASPPCOMSTR"
20030
></A
20031
><CODE
20032
CLASS="envar"
20033
>ASPPCOMSTR</CODE
20034
></DT
20035
><DD
20036
><P
20037
>&#13;The string displayed when an object file
20038
is generated from an assembly-language source file
20039
after first running the file through the C preprocessor.
20040
If this is not set, then <A
20041
HREF="#cv-ASPPCOM"
20042
><CODE
20043
CLASS="envar"
20044
>$ASPPCOM</CODE
20045
></A
20046
> (the command line) is displayed.
20047
</P
20048
><PRE
20049
CLASS="programlisting"
20050
>&#13;env = Environment(ASPPCOMSTR = "Assembling $TARGET")
20051
</PRE
20052
></DD
20053
><DT
20054
><A
20055
NAME="cv-ASPPFLAGS"
20056
></A
20057
><CODE
20058
CLASS="envar"
20059
>ASPPFLAGS</CODE
20060
></DT
20061
><DD
20062
><P
20063
>&#13;General options when an assembling an assembly-language
20064
source file into an object file
20065
after first running the file through the C preprocessor.
20066
The default is to use the value of <A
20067
HREF="#cv-ASFLAGS"
20068
><CODE
20069
CLASS="envar"
20070
>$ASFLAGS</CODE
20071
></A
20072
>.
20073
</P
20074
></DD
20075
><DT
20076
><A
20077
NAME="cv-BIBTEX"
20078
></A
20079
><CODE
20080
CLASS="envar"
20081
>BIBTEX</CODE
20082
></DT
20083
><DD
20084
><P
20085
>&#13;The bibliography generator for the TeX formatter and typesetter and the
20086
LaTeX structured formatter and typesetter.
20087
</P
20088
></DD
20089
><DT
20090
><A
20091
NAME="cv-BIBTEXCOM"
20092
></A
20093
><CODE
20094
CLASS="envar"
20095
>BIBTEXCOM</CODE
20096
></DT
20097
><DD
20098
><P
20099
>&#13;The command line used to call the bibliography generator for the
20100
TeX formatter and typesetter and the LaTeX structured formatter and
20101
typesetter.
20102
</P
20103
></DD
20104
><DT
20105
><A
20106
NAME="cv-BIBTEXCOMSTR"
20107
></A
20108
><CODE
20109
CLASS="envar"
20110
>BIBTEXCOMSTR</CODE
20111
></DT
20112
><DD
20113
><P
20114
>&#13;The string displayed when generating a bibliography
20115
for TeX or LaTeX.
20116
If this is not set, then <A
20117
HREF="#cv-BIBTEXCOM"
20118
><CODE
20119
CLASS="envar"
20120
>$BIBTEXCOM</CODE
20121
></A
20122
> (the command line) is displayed.
20123
</P
20124
><PRE
20125
CLASS="programlisting"
20126
>&#13;env = Environment(BIBTEXCOMSTR = "Generating bibliography $TARGET")
20127
</PRE
20128
></DD
20129
><DT
20130
><A
20131
NAME="cv-BIBTEXFLAGS"
20132
></A
20133
><CODE
20134
CLASS="envar"
20135
>BIBTEXFLAGS</CODE
20136
></DT
20137
><DD
20138
><P
20139
>&#13;General options passed to the bibliography generator for the TeX formatter
20140
and typesetter and the LaTeX structured formatter and typesetter.
20141
</P
20142
></DD
20143
><DT
20144
><A
20145
NAME="cv-BITKEEPER"
20146
></A
20147
><CODE
20148
CLASS="envar"
20149
>BITKEEPER</CODE
20150
></DT
20151
><DD
20152
><P
20153
>&#13;The BitKeeper executable.
20154
</P
20155
></DD
20156
><DT
20157
><A
20158
NAME="cv-BITKEEPERCOM"
20159
></A
20160
><CODE
20161
CLASS="envar"
20162
>BITKEEPERCOM</CODE
20163
></DT
20164
><DD
20165
><P
20166
>&#13;The command line for
20167
fetching source files using BitKeeper.
20168
</P
20169
></DD
20170
><DT
20171
><A
20172
NAME="cv-BITKEEPERCOMSTR"
20173
></A
20174
><CODE
20175
CLASS="envar"
20176
>BITKEEPERCOMSTR</CODE
20177
></DT
20178
><DD
20179
><P
20180
>&#13;The string displayed when fetching
20181
a source file using BitKeeper.
20182
If this is not set, then <A
20183
HREF="#cv-BITKEEPERCOM"
20184
><CODE
20185
CLASS="envar"
20186
>$BITKEEPERCOM</CODE
20187
></A
20188
>
20189
(the command line) is displayed.
20190
</P
20191
></DD
20192
><DT
20193
><A
20194
NAME="cv-BITKEEPERGET"
20195
></A
20196
><CODE
20197
CLASS="envar"
20198
>BITKEEPERGET</CODE
20199
></DT
20200
><DD
20201
><P
20202
>&#13;The command (<A
20203
HREF="#cv-BITKEEPER"
20204
><CODE
20205
CLASS="envar"
20206
>$BITKEEPER</CODE
20207
></A
20208
>) and subcommand
20209
for fetching source files using BitKeeper.
20210
</P
20211
></DD
20212
><DT
20213
><A
20214
NAME="cv-BITKEEPERGETFLAGS"
20215
></A
20216
><CODE
20217
CLASS="envar"
20218
>BITKEEPERGETFLAGS</CODE
20219
></DT
20220
><DD
20221
><P
20222
>&#13;Options that are passed to the BitKeeper
20223
<B
20224
CLASS="command"
20225
>get</B
20226
>
20227
subcommand.
20228
</P
20229
></DD
20230
><DT
20231
><A
20232
NAME="cv-BUILDERS"
20233
></A
20234
><CODE
20235
CLASS="envar"
20236
>BUILDERS</CODE
20237
></DT
20238
><DD
20239
><P
20240
>&#13;A dictionary mapping the names of the builders
20241
available through this environment
20242
to underlying Builder objects.
20243
Builders named
20244
Alias, CFile, CXXFile, DVI, Library, Object, PDF, PostScript, and Program
20245
are available by default.
20246
If you initialize this variable when an
20247
Environment is created:
20248
</P
20249
><PRE
20250
CLASS="programlisting"
20251
>&#13;env = Environment(BUILDERS = {'NewBuilder' : foo})
20252
</PRE
20253
><P
20254
>&#13;the default Builders will no longer be available.
20255
To use a new Builder object in addition to the default Builders,
20256
add your new Builder object like this:
20257
</P
20258
><PRE
20259
CLASS="programlisting"
20260
>&#13;env = Environment()
20261
env.Append(BUILDERS = {'NewBuilder' : foo})
20262
</PRE
20263
><P
20264
>&#13;or this:
20265
</P
20266
><PRE
20267
CLASS="programlisting"
20268
>&#13;env = Environment()
20269
env['BUILDERS]['NewBuilder'] = foo
20270
</PRE
20271
></DD
20272
><DT
20273
><A
20274
NAME="cv-CC"
20275
></A
20276
><CODE
20277
CLASS="envar"
20278
>CC</CODE
20279
></DT
20280
><DD
20281
><P
20282
>&#13;The C compiler.
20283
</P
20284
></DD
20285
><DT
20286
><A
20287
NAME="cv-CCCOM"
20288
></A
20289
><CODE
20290
CLASS="envar"
20291
>CCCOM</CODE
20292
></DT
20293
><DD
20294
><P
20295
>&#13;The command line used to compile a C source file to a (static) object
20296
file.  Any options specified in the <A
20297
HREF="#cv-CFLAGS"
20298
><CODE
20299
CLASS="envar"
20300
>$CFLAGS</CODE
20301
></A
20302
>, <A
20303
HREF="#cv-CCFLAGS"
20304
><CODE
20305
CLASS="envar"
20306
>$CCFLAGS</CODE
20307
></A
20308
> and
20309
<A
20310
HREF="#cv-CPPFLAGS"
20311
><CODE
20312
CLASS="envar"
20313
>$CPPFLAGS</CODE
20314
></A
20315
> construction variables are included on this command
20316
line.
20317
</P
20318
></DD
20319
><DT
20320
><A
20321
NAME="cv-CCCOMSTR"
20322
></A
20323
><CODE
20324
CLASS="envar"
20325
>CCCOMSTR</CODE
20326
></DT
20327
><DD
20328
><P
20329
>&#13;The string displayed when a C source file
20330
is compiled to a (static) object file.
20331
If this is not set, then <A
20332
HREF="#cv-CCCOM"
20333
><CODE
20334
CLASS="envar"
20335
>$CCCOM</CODE
20336
></A
20337
> (the command line) is displayed.
20338
</P
20339
><PRE
20340
CLASS="programlisting"
20341
>&#13;env = Environment(CCCOMSTR = "Compiling static object $TARGET")
20342
</PRE
20343
></DD
20344
><DT
20345
><A
20346
NAME="cv-CCFLAGS"
20347
></A
20348
><CODE
20349
CLASS="envar"
20350
>CCFLAGS</CODE
20351
></DT
20352
><DD
20353
><P
20354
>&#13;General options that are passed to the C and C++ compilers.
20355
</P
20356
></DD
20357
><DT
20358
><A
20359
NAME="cv-CCPCHFLAGS"
20360
></A
20361
><CODE
20362
CLASS="envar"
20363
>CCPCHFLAGS</CODE
20364
></DT
20365
><DD
20366
><P
20367
>&#13;Options added to the compiler command line
20368
to support building with precompiled headers.
20369
The default value expands expands to the appropriate
20370
Microsoft Visual C++ command-line options
20371
when the <A
20372
HREF="#cv-PCH"
20373
><CODE
20374
CLASS="envar"
20375
>$PCH</CODE
20376
></A
20377
> construction variable is set.
20378
</P
20379
></DD
20380
><DT
20381
><A
20382
NAME="cv-CCPDBFLAGS"
20383
></A
20384
><CODE
20385
CLASS="envar"
20386
>CCPDBFLAGS</CODE
20387
></DT
20388
><DD
20389
><P
20390
>&#13;Options added to the compiler command line
20391
to support storing debugging information in a
20392
Microsoft Visual C++ PDB file.
20393
The default value expands expands to appropriate
20394
Microsoft Visual C++ command-line options
20395
when the <A
20396
HREF="#cv-PDB"
20397
><CODE
20398
CLASS="envar"
20399
>$PDB</CODE
20400
></A
20401
> construction variable is set.</P
20402
><P
20403
>The Visual C++ compiler option that SCons uses by default
20404
to generate PDB information is <CODE
20405
CLASS="option"
20406
>/Z7</CODE
20407
>.
20408
This works correctly with parallel (<CODE
20409
CLASS="option"
20410
>-j</CODE
20411
>) builds
20412
because it embeds the debug information in the intermediate object files,
20413
as opposed to sharing a single PDB file between multiple object files.
20414
This is also the only way to get debug information
20415
embedded into a static library.
20416
Using the <CODE
20417
CLASS="option"
20418
>/Zi</CODE
20419
> instead may yield improved
20420
link-time performance,
20421
although parallel builds will no longer work.</P
20422
><P
20423
>You can generate PDB files with the <CODE
20424
CLASS="option"
20425
>/Zi</CODE
20426
>
20427
switch by overriding the default <A
20428
HREF="#cv-CCPDBFLAGS"
20429
><CODE
20430
CLASS="envar"
20431
>$CCPDBFLAGS</CODE
20432
></A
20433
> variable as follows:
20434
</P
20435
><PRE
20436
CLASS="programlisting"
20437
>&#13;import SCons.Util
20438
env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}'])
20439
</PRE
20440
><P
20441
>&#13;An alternative would be to use the <CODE
20442
CLASS="option"
20443
>/Zi</CODE
20444
>
20445
to put the debugging information in a separate <TT
20446
CLASS="filename"
20447
>.pdb</TT
20448
>
20449
file for each object file by overriding
20450
the <A
20451
HREF="#cv-CCPDBFLAGS"
20452
><CODE
20453
CLASS="envar"
20454
>$CCPDBFLAGS</CODE
20455
></A
20456
> variable as follows:
20457
</P
20458
><PRE
20459
CLASS="programlisting"
20460
>&#13;env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb'
20461
</PRE
20462
></DD
20463
><DT
20464
><A
20465
NAME="cv-CCVERSION"
20466
></A
20467
><CODE
20468
CLASS="envar"
20469
>CCVERSION</CODE
20470
></DT
20471
><DD
20472
><P
20473
>&#13;The version number of the C compiler.
20474
This may or may not be set,
20475
depending on the specific C compiler being used.
20476
</P
20477
></DD
20478
><DT
20479
><A
20480
NAME="cv-CFILESUFFIX"
20481
></A
20482
><CODE
20483
CLASS="envar"
20484
>CFILESUFFIX</CODE
20485
></DT
20486
><DD
20487
><P
20488
>&#13;The suffix for C source files.
20489
This is used by the internal CFile builder
20490
when generating C files from Lex (.l) or YACC (.y) input files.
20491
The default suffix, of course, is
20492
<TT
20493
CLASS="filename"
20494
>.c</TT
20495
>
20496
(lower case).
20497
On case-insensitive systems (like Windows),
20498
SCons also treats
20499
<TT
20500
CLASS="filename"
20501
>.C</TT
20502
>
20503
(upper case) files
20504
as C files.
20505
</P
20506
></DD
20507
><DT
20508
><A
20509
NAME="cv-CFLAGS"
20510
></A
20511
><CODE
20512
CLASS="envar"
20513
>CFLAGS</CODE
20514
></DT
20515
><DD
20516
><P
20517
>&#13;General options that are passed to the C compiler (C only; not C++).
20518
</P
20519
></DD
20520
><DT
20521
><A
20522
NAME="cv-CHANGE_SPECFILE"
20523
></A
20524
><CODE
20525
CLASS="envar"
20526
>CHANGE_SPECFILE</CODE
20527
></DT
20528
><DD
20529
><P
20530
>&#13;A hook for modifying the file that controls the packaging build
20531
(the <TT
20532
CLASS="filename"
20533
>.spec</TT
20534
> for RPM,
20535
the <TT
20536
CLASS="filename"
20537
>control</TT
20538
> for Ipkg,
20539
the <TT
20540
CLASS="filename"
20541
>.wxs</TT
20542
> for MSI).
20543
If set, the function will be called
20544
after the SCons template for the file has been written.
20545
XXX
20546
</P
20547
></DD
20548
><DT
20549
><A
20550
NAME="cv-CHANGELOG"
20551
></A
20552
><CODE
20553
CLASS="envar"
20554
>CHANGELOG</CODE
20555
></DT
20556
><DD
20557
><P
20558
>&#13;The name of a file containing the change log text
20559
to be included in the package.
20560
This is included as the
20561
<TT
20562
CLASS="literal"
20563
>%changelog</TT
20564
>
20565
section of the RPM
20566
<TT
20567
CLASS="filename"
20568
>.spec</TT
20569
> file.
20570
</P
20571
></DD
20572
><DT
20573
><A
20574
NAME="cv-_concat"
20575
></A
20576
><CODE
20577
CLASS="envar"
20578
>_concat</CODE
20579
></DT
20580
><DD
20581
><P
20582
>&#13;A function used to produce variables like <CODE
20583
CLASS="envar"
20584
>$_CPPINCFLAGS</CODE
20585
>. It takes
20586
four or five
20587
arguments: a prefix to concatenate onto each element, a list of
20588
elements, a suffix to concatenate onto each element, an environment
20589
for variable interpolation, and an optional function that will be
20590
called to transform the list before concatenation.
20591
</P
20592
><PRE
20593
CLASS="programlisting"
20594
>&#13;env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)',
20595
</PRE
20596
></DD
20597
><DT
20598
><A
20599
NAME="cv-CONFIGUREDIR"
20600
></A
20601
><CODE
20602
CLASS="envar"
20603
>CONFIGUREDIR</CODE
20604
></DT
20605
><DD
20606
><P
20607
>&#13;The name of the directory in which
20608
Configure context test files are written.
20609
The default is
20610
<TT
20611
CLASS="filename"
20612
>.sconf_temp</TT
20613
>
20614
in the top-level directory
20615
containing the
20616
<TT
20617
CLASS="filename"
20618
>SConstruct</TT
20619
>
20620
file.
20621
</P
20622
></DD
20623
><DT
20624
><A
20625
NAME="cv-CONFIGURELOG"
20626
></A
20627
><CODE
20628
CLASS="envar"
20629
>CONFIGURELOG</CODE
20630
></DT
20631
><DD
20632
><P
20633
>&#13;The name of the Configure context log file.
20634
The default is
20635
<TT
20636
CLASS="filename"
20637
>config.log</TT
20638
>
20639
in the top-level directory
20640
containing the
20641
<TT
20642
CLASS="filename"
20643
>SConstruct</TT
20644
>
20645
file.
20646
</P
20647
></DD
20648
><DT
20649
><A
20650
NAME="cv-_CPPDEFFLAGS"
20651
></A
20652
><CODE
20653
CLASS="envar"
20654
>_CPPDEFFLAGS</CODE
20655
></DT
20656
><DD
20657
><P
20658
>&#13;An automatically-generated construction variable
20659
containing the C preprocessor command-line options
20660
to define values.
20661
The value of <CODE
20662
CLASS="envar"
20663
>$_CPPDEFFLAGS</CODE
20664
> is created
20665
by appending <CODE
20666
CLASS="envar"
20667
>$CPPDEFPREFIX</CODE
20668
> and <CODE
20669
CLASS="envar"
20670
>$CPPDEFSUFFIX</CODE
20671
>
20672
to the beginning and end
20673
of each directory in <CODE
20674
CLASS="envar"
20675
>$CPPDEFINES</CODE
20676
>.
20677
</P
20678
></DD
20679
><DT
20680
><A
20681
NAME="cv-CPPDEFINES"
20682
></A
20683
><CODE
20684
CLASS="envar"
20685
>CPPDEFINES</CODE
20686
></DT
20687
><DD
20688
><P
20689
>&#13;A platform independent specification of C preprocessor definitions.
20690
The definitions will be added to command lines
20691
through the automatically-generated
20692
<CODE
20693
CLASS="envar"
20694
>$_CPPDEFFLAGS</CODE
20695
> construction variable (see above),
20696
which is constructed according to
20697
the type of value of <CODE
20698
CLASS="envar"
20699
>$CPPDEFINES</CODE
20700
>:</P
20701
><P
20702
>If <CODE
20703
CLASS="envar"
20704
>$CPPDEFINES</CODE
20705
> is a string,
20706
the values of the
20707
<CODE
20708
CLASS="envar"
20709
>$CPPDEFPREFIX</CODE
20710
> and <CODE
20711
CLASS="envar"
20712
>$CPPDEFSUFFIX</CODE
20713
>
20714
construction variables
20715
will be added to the beginning and end.
20716
</P
20717
><PRE
20718
CLASS="programlisting"
20719
>&#13;# Will add -Dxyz to POSIX compiler command lines,
20720
# and /Dxyz to Microsoft Visual C++ command lines.
20721
env = Environment(CPPDEFINES='xyz')
20722
</PRE
20723
><P
20724
>&#13;If <CODE
20725
CLASS="envar"
20726
>$CPPDEFINES</CODE
20727
> is a list,
20728
the values of the
20729
<CODE
20730
CLASS="envar"
20731
>$CPPDEFPREFIX</CODE
20732
> and <CODE
20733
CLASS="envar"
20734
>$CPPDEFSUFFIX</CODE
20735
>
20736
construction variables
20737
will be appended to the beginning and end
20738
of each element in the list.
20739
If any element is a list or tuple,
20740
then the first item is the name being
20741
defined and the second item is its value:
20742
</P
20743
><PRE
20744
CLASS="programlisting"
20745
>&#13;# Will add -DB=2 -DA to POSIX compiler command lines,
20746
# and /DB=2 /DA to Microsoft Visual C++ command lines.
20747
env = Environment(CPPDEFINES=[('B', 2), 'A'])
20748
</PRE
20749
><P
20750
>&#13;If <CODE
20751
CLASS="envar"
20752
>$CPPDEFINES</CODE
20753
> is a dictionary,
20754
the values of the
20755
<CODE
20756
CLASS="envar"
20757
>$CPPDEFPREFIX</CODE
20758
> and <CODE
20759
CLASS="envar"
20760
>$CPPDEFSUFFIX</CODE
20761
>
20762
construction variables
20763
will be appended to the beginning and end
20764
of each item from the dictionary.
20765
The key of each dictionary item
20766
is a name being defined
20767
to the dictionary item's corresponding value;
20768
if the value is
20769
<TT
20770
CLASS="literal"
20771
>None</TT
20772
>,
20773
then the name is defined without an explicit value.
20774
Note that the resulting flags are sorted by keyword
20775
to ensure that the order of the options on the
20776
command line is consistent each time
20777
<SPAN
20778
CLASS="application"
20779
>scons</SPAN
20780
>
20781
is run.
20782
</P
20783
><PRE
20784
CLASS="programlisting"
20785
>&#13;# Will add -DA -DB=2 to POSIX compiler command lines,
20786
# and /DA /DB=2 to Microsoft Visual C++ command lines.
20787
env = Environment(CPPDEFINES={'B':2, 'A':None})
20788
</PRE
20789
></DD
20790
><DT
20791
><A
20792
NAME="cv-CPPDEFPREFIX"
20793
></A
20794
><CODE
20795
CLASS="envar"
20796
>CPPDEFPREFIX</CODE
20797
></DT
20798
><DD
20799
><P
20800
>&#13;The prefix used to specify preprocessor definitions
20801
on the C compiler command line.
20802
This will be appended to the beginning of each definition
20803
in the <CODE
20804
CLASS="envar"
20805
>$CPPDEFINES</CODE
20806
> construction variable
20807
when the <CODE
20808
CLASS="envar"
20809
>$_CPPDEFFLAGS</CODE
20810
> variable is automatically generated.
20811
</P
20812
></DD
20813
><DT
20814
><A
20815
NAME="cv-CPPDEFSUFFIX"
20816
></A
20817
><CODE
20818
CLASS="envar"
20819
>CPPDEFSUFFIX</CODE
20820
></DT
20821
><DD
20822
><P
20823
>&#13;The suffix used to specify preprocessor definitions
20824
on the C compiler command line.
20825
This will be appended to the end of each definition
20826
in the <CODE
20827
CLASS="envar"
20828
>$CPPDEFINES</CODE
20829
> construction variable
20830
when the <CODE
20831
CLASS="envar"
20832
>$_CPPDEFFLAGS</CODE
20833
> variable is automatically generated.
20834
</P
20835
></DD
20836
><DT
20837
><A
20838
NAME="cv-CPPFLAGS"
20839
></A
20840
><CODE
20841
CLASS="envar"
20842
>CPPFLAGS</CODE
20843
></DT
20844
><DD
20845
><P
20846
>&#13;User-specified C preprocessor options.
20847
These will be included in any command that uses the C preprocessor,
20848
including not just compilation of C and C++ source files
20849
via the <A
20850
HREF="#cv-CCCOM"
20851
><CODE
20852
CLASS="envar"
20853
>$CCCOM</CODE
20854
></A
20855
>,
20856
<A
20857
HREF="#cv-SHCCCOM"
20858
><CODE
20859
CLASS="envar"
20860
>$SHCCCOM</CODE
20861
></A
20862
>,
20863
<A
20864
HREF="#cv-CXXCOM"
20865
><CODE
20866
CLASS="envar"
20867
>$CXXCOM</CODE
20868
></A
20869
> and
20870
<A
20871
HREF="#cv-SHCXXCOM"
20872
><CODE
20873
CLASS="envar"
20874
>$SHCXXCOM</CODE
20875
></A
20876
> command lines,
20877
but also the <A
20878
HREF="#cv-FORTRANPPCOM"
20879
><CODE
20880
CLASS="envar"
20881
>$FORTRANPPCOM</CODE
20882
></A
20883
>,
20884
<A
20885
HREF="#cv-SHFORTRANPPCOM"
20886
><CODE
20887
CLASS="envar"
20888
>$SHFORTRANPPCOM</CODE
20889
></A
20890
>,
20891
<A
20892
HREF="#cv-F77PPCOM"
20893
><CODE
20894
CLASS="envar"
20895
>$F77PPCOM</CODE
20896
></A
20897
> and
20898
<A
20899
HREF="#cv-SHF77PPCOM"
20900
><CODE
20901
CLASS="envar"
20902
>$SHF77PPCOM</CODE
20903
></A
20904
> command lines
20905
used to compile a Fortran source file,
20906
and the <A
20907
HREF="#cv-ASPPCOM"
20908
><CODE
20909
CLASS="envar"
20910
>$ASPPCOM</CODE
20911
></A
20912
> command line
20913
used to assemble an assembly language source file,
20914
after first running each file through the C preprocessor.
20915
Note that this variable does
20916
<SPAN
20917
CLASS="emphasis"
20918
><I
20919
CLASS="emphasis"
20920
>not</I
20921
></SPAN
20922
>
20923
contain
20924
<CODE
20925
CLASS="option"
20926
>-I</CODE
20927
>
20928
(or similar) include search path options
20929
that scons generates automatically from <A
20930
HREF="#cv-CPPPATH"
20931
><CODE
20932
CLASS="envar"
20933
>$CPPPATH</CODE
20934
></A
20935
>.
20936
See <A
20937
HREF="#cv-_CPPINCFLAGS"
20938
><CODE
20939
CLASS="envar"
20940
>$_CPPINCFLAGS</CODE
20941
></A
20942
>, below,
20943
for the variable that expands to those options.
20944
</P
20945
></DD
20946
><DT
20947
><A
20948
NAME="cv-_CPPINCFLAGS"
20949
></A
20950
><CODE
20951
CLASS="envar"
20952
>_CPPINCFLAGS</CODE
20953
></DT
20954
><DD
20955
><P
20956
>&#13;An automatically-generated construction variable
20957
containing the C preprocessor command-line options
20958
for specifying directories to be searched for include files.
20959
The value of <CODE
20960
CLASS="envar"
20961
>$_CPPINCFLAGS</CODE
20962
> is created
20963
by appending <CODE
20964
CLASS="envar"
20965
>$INCPREFIX</CODE
20966
> and <CODE
20967
CLASS="envar"
20968
>$INCSUFFIX</CODE
20969
>
20970
to the beginning and end
20971
of each directory in <CODE
20972
CLASS="envar"
20973
>$CPPPATH</CODE
20974
>.
20975
</P
20976
></DD
20977
><DT
20978
><A
20979
NAME="cv-CPPPATH"
20980
></A
20981
><CODE
20982
CLASS="envar"
20983
>CPPPATH</CODE
20984
></DT
20985
><DD
20986
><P
20987
>&#13;The list of directories that the C preprocessor will search for include
20988
directories. The C/C++ implicit dependency scanner will search these
20989
directories for include files. Don't explicitly put include directory
20990
arguments in CCFLAGS or CXXFLAGS because the result will be non-portable
20991
and the directories will not be searched by the dependency scanner. Note:
20992
directory names in CPPPATH will be looked-up relative to the SConscript
20993
directory when they are used in a command. To force
20994
<SPAN
20995
CLASS="application"
20996
>scons</SPAN
20997
>
20998
to look-up a directory relative to the root of the source tree use #:
20999
</P
21000
><PRE
21001
CLASS="programlisting"
21002
>&#13;env = Environment(CPPPATH='#/include')
21003
</PRE
21004
><P
21005
>&#13;The directory look-up can also be forced using the
21006
<CODE
21007
CLASS="function"
21008
>Dir</CODE
21009
>()
21010
function:
21011
</P
21012
><PRE
21013
CLASS="programlisting"
21014
>&#13;include = Dir('include')
21015
env = Environment(CPPPATH=include)
21016
</PRE
21017
><P
21018
>&#13;The directory list will be added to command lines
21019
through the automatically-generated
21020
<CODE
21021
CLASS="envar"
21022
>$_CPPINCFLAGS</CODE
21023
>
21024
construction variable,
21025
which is constructed by
21026
appending the values of the
21027
<CODE
21028
CLASS="envar"
21029
>$INCPREFIX</CODE
21030
> and <CODE
21031
CLASS="envar"
21032
>$INCSUFFIX</CODE
21033
>
21034
construction variables
21035
to the beginning and end
21036
of each directory in <CODE
21037
CLASS="envar"
21038
>$CPPPATH</CODE
21039
>.
21040
Any command lines you define that need
21041
the CPPPATH directory list should
21042
include <CODE
21043
CLASS="envar"
21044
>$_CPPINCFLAGS</CODE
21045
>:
21046
</P
21047
><PRE
21048
CLASS="programlisting"
21049
>&#13;env = Environment(CCCOM="my_compiler $_CPPINCFLAGS -c -o $TARGET $SOURCE")
21050
</PRE
21051
></DD
21052
><DT
21053
><A
21054
NAME="cv-CPPSUFFIXES"
21055
></A
21056
><CODE
21057
CLASS="envar"
21058
>CPPSUFFIXES</CODE
21059
></DT
21060
><DD
21061
><P
21062
>&#13;The list of suffixes of files that will be scanned
21063
for C preprocessor implicit dependencies
21064
(#include lines).
21065
The default list is:
21066
</P
21067
><PRE
21068
CLASS="programlisting"
21069
>&#13;[".c", ".C", ".cxx", ".cpp", ".c++", ".cc",
21070
 ".h", ".H", ".hxx", ".hpp", ".hh",
21071
 ".F", ".fpp", ".FPP",
21072
 ".m", ".mm",
21073
 ".S", ".spp", ".SPP"]
21074
</PRE
21075
></DD
21076
><DT
21077
><A
21078
NAME="cv-CVS"
21079
></A
21080
><CODE
21081
CLASS="envar"
21082
>CVS</CODE
21083
></DT
21084
><DD
21085
><P
21086
>&#13;The CVS executable.
21087
</P
21088
></DD
21089
><DT
21090
><A
21091
NAME="cv-CVSCOFLAGS"
21092
></A
21093
><CODE
21094
CLASS="envar"
21095
>CVSCOFLAGS</CODE
21096
></DT
21097
><DD
21098
><P
21099
>&#13;Options that are passed to the CVS checkout subcommand.
21100
</P
21101
></DD
21102
><DT
21103
><A
21104
NAME="cv-CVSCOM"
21105
></A
21106
><CODE
21107
CLASS="envar"
21108
>CVSCOM</CODE
21109
></DT
21110
><DD
21111
><P
21112
>&#13;The command line used to
21113
fetch source files from a CVS repository.
21114
</P
21115
></DD
21116
><DT
21117
><A
21118
NAME="cv-CVSCOMSTR"
21119
></A
21120
><CODE
21121
CLASS="envar"
21122
>CVSCOMSTR</CODE
21123
></DT
21124
><DD
21125
><P
21126
>&#13;The string displayed when fetching
21127
a source file from a CVS repository.
21128
If this is not set, then <A
21129
HREF="#cv-CVSCOM"
21130
><CODE
21131
CLASS="envar"
21132
>$CVSCOM</CODE
21133
></A
21134
>
21135
(the command line) is displayed.
21136
</P
21137
></DD
21138
><DT
21139
><A
21140
NAME="cv-CVSFLAGS"
21141
></A
21142
><CODE
21143
CLASS="envar"
21144
>CVSFLAGS</CODE
21145
></DT
21146
><DD
21147
><P
21148
>&#13;General options that are passed to CVS.
21149
By default, this is set to
21150
<TT
21151
CLASS="literal"
21152
>-d $CVSREPOSITORY</TT
21153
>
21154
to specify from where the files must be fetched.
21155
</P
21156
></DD
21157
><DT
21158
><A
21159
NAME="cv-CVSREPOSITORY"
21160
></A
21161
><CODE
21162
CLASS="envar"
21163
>CVSREPOSITORY</CODE
21164
></DT
21165
><DD
21166
><P
21167
>&#13;The path to the CVS repository.
21168
This is referenced in the default
21169
<A
21170
HREF="#cv-CVSFLAGS"
21171
><CODE
21172
CLASS="envar"
21173
>$CVSFLAGS</CODE
21174
></A
21175
> value.
21176
</P
21177
></DD
21178
><DT
21179
><A
21180
NAME="cv-CXX"
21181
></A
21182
><CODE
21183
CLASS="envar"
21184
>CXX</CODE
21185
></DT
21186
><DD
21187
><P
21188
>&#13;The C++ compiler.
21189
</P
21190
></DD
21191
><DT
21192
><A
21193
NAME="cv-CXXCOM"
21194
></A
21195
><CODE
21196
CLASS="envar"
21197
>CXXCOM</CODE
21198
></DT
21199
><DD
21200
><P
21201
>&#13;The command line used to compile a C++ source file to an object file.
21202
Any options specified in the <A
21203
HREF="#cv-CXXFLAGS"
21204
><CODE
21205
CLASS="envar"
21206
>$CXXFLAGS</CODE
21207
></A
21208
> and
21209
<A
21210
HREF="#cv-CPPFLAGS"
21211
><CODE
21212
CLASS="envar"
21213
>$CPPFLAGS</CODE
21214
></A
21215
> construction variables
21216
are included on this command line.
21217
</P
21218
></DD
21219
><DT
21220
><A
21221
NAME="cv-CXXCOMSTR"
21222
></A
21223
><CODE
21224
CLASS="envar"
21225
>CXXCOMSTR</CODE
21226
></DT
21227
><DD
21228
><P
21229
>&#13;The string displayed when a C++ source file
21230
is compiled to a (static) object file.
21231
If this is not set, then <A
21232
HREF="#cv-CXXCOM"
21233
><CODE
21234
CLASS="envar"
21235
>$CXXCOM</CODE
21236
></A
21237
> (the command line) is displayed.
21238
</P
21239
><PRE
21240
CLASS="programlisting"
21241
>&#13;env = Environment(CXXCOMSTR = "Compiling static object $TARGET")
21242
</PRE
21243
></DD
21244
><DT
21245
><A
21246
NAME="cv-CXXFILESUFFIX"
21247
></A
21248
><CODE
21249
CLASS="envar"
21250
>CXXFILESUFFIX</CODE
21251
></DT
21252
><DD
21253
><P
21254
>&#13;The suffix for C++ source files.
21255
This is used by the internal CXXFile builder
21256
when generating C++ files from Lex (.ll) or YACC (.yy) input files.
21257
The default suffix is
21258
<TT
21259
CLASS="filename"
21260
>.cc</TT
21261
>.
21262
SCons also treats files with the suffixes
21263
<TT
21264
CLASS="filename"
21265
>.cpp</TT
21266
>,
21267
<TT
21268
CLASS="filename"
21269
>.cxx</TT
21270
>,
21271
<TT
21272
CLASS="filename"
21273
>.c++</TT
21274
>,
21275
and
21276
<TT
21277
CLASS="filename"
21278
>.C++</TT
21279
>
21280
as C++ files,
21281
and files with
21282
<TT
21283
CLASS="filename"
21284
>.mm</TT
21285
>
21286
suffixes as Objective C++ files.
21287
On case-sensitive systems (Linux, UNIX, and other POSIX-alikes),
21288
SCons also treats
21289
<TT
21290
CLASS="filename"
21291
>.C</TT
21292
>
21293
(upper case) files
21294
as C++ files.
21295
</P
21296
></DD
21297
><DT
21298
><A
21299
NAME="cv-CXXFLAGS"
21300
></A
21301
><CODE
21302
CLASS="envar"
21303
>CXXFLAGS</CODE
21304
></DT
21305
><DD
21306
><P
21307
>&#13;General options that are passed to the C++ compiler.
21308
By default, this includes the value of <A
21309
HREF="#cv-CCFLAGS"
21310
><CODE
21311
CLASS="envar"
21312
>$CCFLAGS</CODE
21313
></A
21314
>,
21315
so that setting <CODE
21316
CLASS="envar"
21317
>$CCFLAGS</CODE
21318
> affects both C and C++ compilation.
21319
If you want to add C++-specific flags,
21320
you must set or override the value of <A
21321
HREF="#cv-CXXFLAGS"
21322
><CODE
21323
CLASS="envar"
21324
>$CXXFLAGS</CODE
21325
></A
21326
>.
21327
</P
21328
></DD
21329
><DT
21330
><A
21331
NAME="cv-CXXVERSION"
21332
></A
21333
><CODE
21334
CLASS="envar"
21335
>CXXVERSION</CODE
21336
></DT
21337
><DD
21338
><P
21339
>&#13;The version number of the C++ compiler.
21340
This may or may not be set,
21341
depending on the specific C++ compiler being used.
21342
</P
21343
></DD
21344
><DT
21345
><A
21346
NAME="cv-DESCRIPTION"
21347
></A
21348
><CODE
21349
CLASS="envar"
21350
>DESCRIPTION</CODE
21351
></DT
21352
><DD
21353
><P
21354
>&#13;A long description of the project being packaged.
21355
This is included in the relevant section
21356
of the file that controls the packaging build.
21357
</P
21358
></DD
21359
><DT
21360
><A
21361
NAME="cv-DESCRIPTION_lang"
21362
></A
21363
><CODE
21364
CLASS="envar"
21365
>DESCRIPTION_lang</CODE
21366
></DT
21367
><DD
21368
><P
21369
>&#13;A language-specific long description for
21370
the specified <CODE
21371
CLASS="varname"
21372
>lang</CODE
21373
>.
21374
This is used to populate a
21375
<TT
21376
CLASS="literal"
21377
>%description -l</TT
21378
>
21379
section of an RPM
21380
<TT
21381
CLASS="filename"
21382
>.spec</TT
21383
> file.
21384
</P
21385
></DD
21386
><DT
21387
><A
21388
NAME="cv-Dir"
21389
></A
21390
><CODE
21391
CLASS="envar"
21392
>Dir</CODE
21393
></DT
21394
><DD
21395
><P
21396
>&#13;A function that converts a string
21397
into a Dir instance relative to the target being built.
21398
</P
21399
></DD
21400
><DT
21401
><A
21402
NAME="cv-Dirs"
21403
></A
21404
><CODE
21405
CLASS="envar"
21406
>Dirs</CODE
21407
></DT
21408
><DD
21409
><P
21410
>&#13;A function that converts a list of strings
21411
into a list of Dir instances relative to the target being built.
21412
</P
21413
></DD
21414
><DT
21415
><A
21416
NAME="cv-DSUFFIXES"
21417
></A
21418
><CODE
21419
CLASS="envar"
21420
>DSUFFIXES</CODE
21421
></DT
21422
><DD
21423
><P
21424
>&#13;The list of suffixes of files that will be scanned
21425
for imported D package files.
21426
The default list is:
21427
</P
21428
><PRE
21429
CLASS="programlisting"
21430
>&#13;['.d']
21431
</PRE
21432
></DD
21433
><DT
21434
><A
21435
NAME="cv-DVIPDF"
21436
></A
21437
><CODE
21438
CLASS="envar"
21439
>DVIPDF</CODE
21440
></DT
21441
><DD
21442
><P
21443
>&#13;The TeX DVI file to PDF file converter.
21444
</P
21445
></DD
21446
><DT
21447
><A
21448
NAME="cv-DVIPDFCOM"
21449
></A
21450
><CODE
21451
CLASS="envar"
21452
>DVIPDFCOM</CODE
21453
></DT
21454
><DD
21455
><P
21456
>&#13;The command line used to convert TeX DVI files into a PDF file.
21457
</P
21458
></DD
21459
><DT
21460
><A
21461
NAME="cv-DVIPDFCOMSTR"
21462
></A
21463
><CODE
21464
CLASS="envar"
21465
>DVIPDFCOMSTR</CODE
21466
></DT
21467
><DD
21468
><P
21469
>&#13;The string displayed when a TeX DVI file
21470
is converted into a PDF file.
21471
If this is not set, then <A
21472
HREF="#cv-DVIPDFCOM"
21473
><CODE
21474
CLASS="envar"
21475
>$DVIPDFCOM</CODE
21476
></A
21477
> (the command line) is displayed.
21478
</P
21479
></DD
21480
><DT
21481
><A
21482
NAME="cv-DVIPDFFLAGS"
21483
></A
21484
><CODE
21485
CLASS="envar"
21486
>DVIPDFFLAGS</CODE
21487
></DT
21488
><DD
21489
><P
21490
>&#13;General options passed to the TeX DVI file to PDF file converter.
21491
</P
21492
></DD
21493
><DT
21494
><A
21495
NAME="cv-DVIPS"
21496
></A
21497
><CODE
21498
CLASS="envar"
21499
>DVIPS</CODE
21500
></DT
21501
><DD
21502
><P
21503
>&#13;The TeX DVI file to PostScript converter.
21504
</P
21505
></DD
21506
><DT
21507
><A
21508
NAME="cv-DVIPSFLAGS"
21509
></A
21510
><CODE
21511
CLASS="envar"
21512
>DVIPSFLAGS</CODE
21513
></DT
21514
><DD
21515
><P
21516
>&#13;General options passed to the TeX DVI file to PostScript converter.
21517
</P
21518
></DD
21519
><DT
21520
><A
21521
NAME="cv-ENV"
21522
></A
21523
><CODE
21524
CLASS="envar"
21525
>ENV</CODE
21526
></DT
21527
><DD
21528
><P
21529
>&#13;A dictionary of environment variables
21530
to use when invoking commands. When
21531
<CODE
21532
CLASS="envar"
21533
>$ENV</CODE
21534
> is used in a command all list
21535
values will be joined using the path separator and any other non-string
21536
values will simply be coerced to a string.
21537
Note that, by default,
21538
<SPAN
21539
CLASS="application"
21540
>scons</SPAN
21541
>
21542
does
21543
<SPAN
21544
CLASS="emphasis"
21545
><I
21546
CLASS="emphasis"
21547
>not</I
21548
></SPAN
21549
>
21550
propagate the environment in force when you
21551
execute
21552
<SPAN
21553
CLASS="application"
21554
>scons</SPAN
21555
>
21556
to the commands used to build target files.
21557
This is so that builds will be guaranteed
21558
repeatable regardless of the environment
21559
variables set at the time
21560
<SPAN
21561
CLASS="application"
21562
>scons</SPAN
21563
>
21564
is invoked.</P
21565
><P
21566
>If you want to propagate your
21567
environment variables
21568
to the commands executed
21569
to build target files,
21570
you must do so explicitly:
21571
</P
21572
><PRE
21573
CLASS="programlisting"
21574
>&#13;import os
21575
env = Environment(ENV = os.environ)
21576
</PRE
21577
><P
21578
>&#13;Note that you can choose only to propagate
21579
certain environment variables.
21580
A common example is
21581
the system
21582
<CODE
21583
CLASS="envar"
21584
>PATH</CODE
21585
>
21586
environment variable,
21587
so that
21588
<SPAN
21589
CLASS="application"
21590
>scons</SPAN
21591
>
21592
uses the same utilities
21593
as the invoking shell (or other process):
21594
</P
21595
><PRE
21596
CLASS="programlisting"
21597
>&#13;import os
21598
env = Environment(ENV = {'PATH' : os.environ['PATH']})
21599
</PRE
21600
></DD
21601
><DT
21602
><A
21603
NAME="cv-ESCAPE"
21604
></A
21605
><CODE
21606
CLASS="envar"
21607
>ESCAPE</CODE
21608
></DT
21609
><DD
21610
><P
21611
>&#13;A function that will be called to escape shell special characters in
21612
command lines. The function should take one argument: the command line
21613
string to escape; and should return the escaped command line.
21614
</P
21615
></DD
21616
><DT
21617
><A
21618
NAME="cv-F77"
21619
></A
21620
><CODE
21621
CLASS="envar"
21622
>F77</CODE
21623
></DT
21624
><DD
21625
><P
21626
>&#13;The Fortran 77 compiler.
21627
You should normally set the <A
21628
HREF="#cv-FORTRAN"
21629
><CODE
21630
CLASS="envar"
21631
>$FORTRAN</CODE
21632
></A
21633
> variable,
21634
which specifies the default Fortran compiler
21635
for all Fortran versions.
21636
You only need to set <A
21637
HREF="#cv-F77"
21638
><CODE
21639
CLASS="envar"
21640
>$F77</CODE
21641
></A
21642
> if you need to use a specific compiler
21643
or compiler version for Fortran 77 files.
21644
</P
21645
></DD
21646
><DT
21647
><A
21648
NAME="cv-F77COM"
21649
></A
21650
><CODE
21651
CLASS="envar"
21652
>F77COM</CODE
21653
></DT
21654
><DD
21655
><P
21656
>&#13;The command line used to compile a Fortran 77 source file to an object file.
21657
You only need to set <A
21658
HREF="#cv-F77COM"
21659
><CODE
21660
CLASS="envar"
21661
>$F77COM</CODE
21662
></A
21663
> if you need to use a specific
21664
command line for Fortran 77 files.
21665
You should normally set the <A
21666
HREF="#cv-FORTRANCOM"
21667
><CODE
21668
CLASS="envar"
21669
>$FORTRANCOM</CODE
21670
></A
21671
> variable,
21672
which specifies the default command line
21673
for all Fortran versions.
21674
</P
21675
></DD
21676
><DT
21677
><A
21678
NAME="cv-F77COMSTR"
21679
></A
21680
><CODE
21681
CLASS="envar"
21682
>F77COMSTR</CODE
21683
></DT
21684
><DD
21685
><P
21686
>&#13;The string displayed when a Fortran 77 source file
21687
is compiled to an object file.
21688
If this is not set, then <A
21689
HREF="#cv-F77COM"
21690
><CODE
21691
CLASS="envar"
21692
>$F77COM</CODE
21693
></A
21694
> or <A
21695
HREF="#cv-FORTRANCOM"
21696
><CODE
21697
CLASS="envar"
21698
>$FORTRANCOM</CODE
21699
></A
21700
>
21701
(the command line) is displayed.
21702
</P
21703
></DD
21704
><DT
21705
><A
21706
NAME="cv-F77FILESUFFIXES"
21707
></A
21708
><CODE
21709
CLASS="envar"
21710
>F77FILESUFFIXES</CODE
21711
></DT
21712
><DD
21713
><P
21714
>&#13;The list of file extensions for which the F77 dialect will be used. By
21715
default, this is ['.f77']
21716
</P
21717
></DD
21718
><DT
21719
><A
21720
NAME="cv-F77FLAGS"
21721
></A
21722
><CODE
21723
CLASS="envar"
21724
>F77FLAGS</CODE
21725
></DT
21726
><DD
21727
><P
21728
>&#13;General user-specified options that are passed to the Fortran 77 compiler.
21729
Note that this variable does
21730
<SPAN
21731
CLASS="emphasis"
21732
><I
21733
CLASS="emphasis"
21734
>not</I
21735
></SPAN
21736
>
21737
contain
21738
<CODE
21739
CLASS="option"
21740
>-I</CODE
21741
>
21742
(or similar) include search path options
21743
that scons generates automatically from <A
21744
HREF="#cv-F77PATH"
21745
><CODE
21746
CLASS="envar"
21747
>$F77PATH</CODE
21748
></A
21749
>.
21750
See
21751
<A
21752
HREF="#cv-_F77INCFLAGS"
21753
><CODE
21754
CLASS="envar"
21755
>$_F77INCFLAGS</CODE
21756
></A
21757
>
21758
below,
21759
for the variable that expands to those options.
21760
You only need to set <A
21761
HREF="#cv-F77FLAGS"
21762
><CODE
21763
CLASS="envar"
21764
>$F77FLAGS</CODE
21765
></A
21766
> if you need to define specific
21767
user options for Fortran 77 files.
21768
You should normally set the <A
21769
HREF="#cv-FORTRANFLAGS"
21770
><CODE
21771
CLASS="envar"
21772
>$FORTRANFLAGS</CODE
21773
></A
21774
> variable,
21775
which specifies the user-specified options
21776
passed to the default Fortran compiler
21777
for all Fortran versions.
21778
</P
21779
></DD
21780
><DT
21781
><A
21782
NAME="cv-_F77INCFLAGS"
21783
></A
21784
><CODE
21785
CLASS="envar"
21786
>_F77INCFLAGS</CODE
21787
></DT
21788
><DD
21789
><P
21790
>&#13;An automatically-generated construction variable
21791
containing the Fortran 77 compiler command-line options
21792
for specifying directories to be searched for include files.
21793
The value of <A
21794
HREF="#cv-_F77INCFLAGS"
21795
><CODE
21796
CLASS="envar"
21797
>$_F77INCFLAGS</CODE
21798
></A
21799
> is created
21800
by appending <A
21801
HREF="#cv-INCPREFIX"
21802
><CODE
21803
CLASS="envar"
21804
>$INCPREFIX</CODE
21805
></A
21806
> and <A
21807
HREF="#cv-INCSUFFIX"
21808
><CODE
21809
CLASS="envar"
21810
>$INCSUFFIX</CODE
21811
></A
21812
>
21813
to the beginning and end
21814
of each directory in <A
21815
HREF="#cv-F77PATH"
21816
><CODE
21817
CLASS="envar"
21818
>$F77PATH</CODE
21819
></A
21820
>.
21821
</P
21822
></DD
21823
><DT
21824
><A
21825
NAME="cv-F77PATH"
21826
></A
21827
><CODE
21828
CLASS="envar"
21829
>F77PATH</CODE
21830
></DT
21831
><DD
21832
><P
21833
>&#13;The list of directories that the Fortran 77 compiler will search for include
21834
directories. The implicit dependency scanner will search these
21835
directories for include files. Don't explicitly put include directory
21836
arguments in <A
21837
HREF="#cv-F77FLAGS"
21838
><CODE
21839
CLASS="envar"
21840
>$F77FLAGS</CODE
21841
></A
21842
> because the result will be non-portable
21843
and the directories will not be searched by the dependency scanner. Note:
21844
directory names in <A
21845
HREF="#cv-F77PATH"
21846
><CODE
21847
CLASS="envar"
21848
>$F77PATH</CODE
21849
></A
21850
> will be looked-up relative to the SConscript
21851
directory when they are used in a command. To force
21852
<SPAN
21853
CLASS="application"
21854
>scons</SPAN
21855
>
21856
to look-up a directory relative to the root of the source tree use #:
21857
You only need to set <A
21858
HREF="#cv-F77PATH"
21859
><CODE
21860
CLASS="envar"
21861
>$F77PATH</CODE
21862
></A
21863
> if you need to define a specific
21864
include path for Fortran 77 files.
21865
You should normally set the <A
21866
HREF="#cv-FORTRANPATH"
21867
><CODE
21868
CLASS="envar"
21869
>$FORTRANPATH</CODE
21870
></A
21871
> variable,
21872
which specifies the include path
21873
for the default Fortran compiler
21874
for all Fortran versions.
21875
</P
21876
><PRE
21877
CLASS="programlisting"
21878
>&#13;env = Environment(F77PATH='#/include')
21879
</PRE
21880
><P
21881
>&#13;The directory look-up can also be forced using the
21882
<CODE
21883
CLASS="function"
21884
>Dir</CODE
21885
>()
21886
function:
21887
</P
21888
><PRE
21889
CLASS="programlisting"
21890
>&#13;include = Dir('include')
21891
env = Environment(F77PATH=include)
21892
</PRE
21893
><P
21894
>&#13;The directory list will be added to command lines
21895
through the automatically-generated
21896
<A
21897
HREF="#cv-_F77INCFLAGS"
21898
><CODE
21899
CLASS="envar"
21900
>$_F77INCFLAGS</CODE
21901
></A
21902
>
21903
construction variable,
21904
which is constructed by
21905
appending the values of the
21906
<A
21907
HREF="#cv-INCPREFIX"
21908
><CODE
21909
CLASS="envar"
21910
>$INCPREFIX</CODE
21911
></A
21912
> and <A
21913
HREF="#cv-INCSUFFIX"
21914
><CODE
21915
CLASS="envar"
21916
>$INCSUFFIX</CODE
21917
></A
21918
>
21919
construction variables
21920
to the beginning and end
21921
of each directory in <A
21922
HREF="#cv-F77PATH"
21923
><CODE
21924
CLASS="envar"
21925
>$F77PATH</CODE
21926
></A
21927
>.
21928
Any command lines you define that need
21929
the F77PATH directory list should
21930
include <A
21931
HREF="#cv-_F77INCFLAGS"
21932
><CODE
21933
CLASS="envar"
21934
>$_F77INCFLAGS</CODE
21935
></A
21936
>:
21937
</P
21938
><PRE
21939
CLASS="programlisting"
21940
>&#13;env = Environment(F77COM="my_compiler $_F77INCFLAGS -c -o $TARGET $SOURCE")
21941
</PRE
21942
></DD
21943
><DT
21944
><A
21945
NAME="cv-F77PPCOM"
21946
></A
21947
><CODE
21948
CLASS="envar"
21949
>F77PPCOM</CODE
21950
></DT
21951
><DD
21952
><P
21953
>&#13;The command line used to compile a Fortran 77 source file to an object file
21954
after first running the file through the C preprocessor.
21955
Any options specified in the <A
21956
HREF="#cv-F77FLAGS"
21957
><CODE
21958
CLASS="envar"
21959
>$F77FLAGS</CODE
21960
></A
21961
> and <A
21962
HREF="#cv-CPPFLAGS"
21963
><CODE
21964
CLASS="envar"
21965
>$CPPFLAGS</CODE
21966
></A
21967
> construction variables
21968
are included on this command line.
21969
You only need to set <A
21970
HREF="#cv-F77PPCOM"
21971
><CODE
21972
CLASS="envar"
21973
>$F77PPCOM</CODE
21974
></A
21975
> if you need to use a specific
21976
C-preprocessor command line for Fortran 77 files.
21977
You should normally set the <A
21978
HREF="#cv-FORTRANPPCOM"
21979
><CODE
21980
CLASS="envar"
21981
>$FORTRANPPCOM</CODE
21982
></A
21983
> variable,
21984
which specifies the default C-preprocessor command line
21985
for all Fortran versions.
21986
</P
21987
></DD
21988
><DT
21989
><A
21990
NAME="cv-F77PPCOMSTR"
21991
></A
21992
><CODE
21993
CLASS="envar"
21994
>F77PPCOMSTR</CODE
21995
></DT
21996
><DD
21997
><P
21998
>&#13;The string displayed when a Fortran 77 source file
21999
is compiled to an object file
22000
after first running the file through the C preprocessor.
22001
If this is not set, then <A
22002
HREF="#cv-F77PPCOM"
22003
><CODE
22004
CLASS="envar"
22005
>$F77PPCOM</CODE
22006
></A
22007
> or <A
22008
HREF="#cv-FORTRANPPCOM"
22009
><CODE
22010
CLASS="envar"
22011
>$FORTRANPPCOM</CODE
22012
></A
22013
>
22014
(the command line) is displayed.
22015
</P
22016
></DD
22017
><DT
22018
><A
22019
NAME="cv-F77PPFILESUFFIXES"
22020
></A
22021
><CODE
22022
CLASS="envar"
22023
>F77PPFILESUFFIXES</CODE
22024
></DT
22025
><DD
22026
><P
22027
>&#13;The list of file extensions for which the compilation + preprocessor pass for
22028
F77 dialect will be used. By default, this is empty
22029
</P
22030
></DD
22031
><DT
22032
><A
22033
NAME="cv-F90"
22034
></A
22035
><CODE
22036
CLASS="envar"
22037
>F90</CODE
22038
></DT
22039
><DD
22040
><P
22041
>&#13;The Fortran 90 compiler.
22042
You should normally set the <A
22043
HREF="#cv-FORTRAN"
22044
><CODE
22045
CLASS="envar"
22046
>$FORTRAN</CODE
22047
></A
22048
> variable,
22049
which specifies the default Fortran compiler
22050
for all Fortran versions.
22051
You only need to set <A
22052
HREF="#cv-F90"
22053
><CODE
22054
CLASS="envar"
22055
>$F90</CODE
22056
></A
22057
> if you need to use a specific compiler
22058
or compiler version for Fortran 90 files.
22059
</P
22060
></DD
22061
><DT
22062
><A
22063
NAME="cv-F90COM"
22064
></A
22065
><CODE
22066
CLASS="envar"
22067
>F90COM</CODE
22068
></DT
22069
><DD
22070
><P
22071
>&#13;The command line used to compile a Fortran 90 source file to an object file.
22072
You only need to set <A
22073
HREF="#cv-F90COM"
22074
><CODE
22075
CLASS="envar"
22076
>$F90COM</CODE
22077
></A
22078
> if you need to use a specific
22079
command line for Fortran 90 files.
22080
You should normally set the <A
22081
HREF="#cv-FORTRANCOM"
22082
><CODE
22083
CLASS="envar"
22084
>$FORTRANCOM</CODE
22085
></A
22086
> variable,
22087
which specifies the default command line
22088
for all Fortran versions.
22089
</P
22090
></DD
22091
><DT
22092
><A
22093
NAME="cv-F90COMSTR"
22094
></A
22095
><CODE
22096
CLASS="envar"
22097
>F90COMSTR</CODE
22098
></DT
22099
><DD
22100
><P
22101
>&#13;The string displayed when a Fortran 90 source file
22102
is compiled to an object file.
22103
If this is not set, then <A
22104
HREF="#cv-F90COM"
22105
><CODE
22106
CLASS="envar"
22107
>$F90COM</CODE
22108
></A
22109
> or <A
22110
HREF="#cv-FORTRANCOM"
22111
><CODE
22112
CLASS="envar"
22113
>$FORTRANCOM</CODE
22114
></A
22115
>
22116
(the command line) is displayed.
22117
</P
22118
></DD
22119
><DT
22120
><A
22121
NAME="cv-F90FILESUFFIXES"
22122
></A
22123
><CODE
22124
CLASS="envar"
22125
>F90FILESUFFIXES</CODE
22126
></DT
22127
><DD
22128
><P
22129
>&#13;The list of file extensions for which the F90 dialect will be used. By
22130
default, this is ['.f90']
22131
</P
22132
></DD
22133
><DT
22134
><A
22135
NAME="cv-F90FLAGS"
22136
></A
22137
><CODE
22138
CLASS="envar"
22139
>F90FLAGS</CODE
22140
></DT
22141
><DD
22142
><P
22143
>&#13;General user-specified options that are passed to the Fortran 90 compiler.
22144
Note that this variable does
22145
<SPAN
22146
CLASS="emphasis"
22147
><I
22148
CLASS="emphasis"
22149
>not</I
22150
></SPAN
22151
>
22152
contain
22153
<CODE
22154
CLASS="option"
22155
>-I</CODE
22156
>
22157
(or similar) include search path options
22158
that scons generates automatically from <A
22159
HREF="#cv-F90PATH"
22160
><CODE
22161
CLASS="envar"
22162
>$F90PATH</CODE
22163
></A
22164
>.
22165
See
22166
<A
22167
HREF="#cv-_F90INCFLAGS"
22168
><CODE
22169
CLASS="envar"
22170
>$_F90INCFLAGS</CODE
22171
></A
22172
>
22173
below,
22174
for the variable that expands to those options.
22175
You only need to set <A
22176
HREF="#cv-F90FLAGS"
22177
><CODE
22178
CLASS="envar"
22179
>$F90FLAGS</CODE
22180
></A
22181
> if you need to define specific
22182
user options for Fortran 90 files.
22183
You should normally set the <A
22184
HREF="#cv-FORTRANFLAGS"
22185
><CODE
22186
CLASS="envar"
22187
>$FORTRANFLAGS</CODE
22188
></A
22189
> variable,
22190
which specifies the user-specified options
22191
passed to the default Fortran compiler
22192
for all Fortran versions.
22193
</P
22194
></DD
22195
><DT
22196
><A
22197
NAME="cv-_F90INCFLAGS"
22198
></A
22199
><CODE
22200
CLASS="envar"
22201
>_F90INCFLAGS</CODE
22202
></DT
22203
><DD
22204
><P
22205
>&#13;An automatically-generated construction variable
22206
containing the Fortran 90 compiler command-line options
22207
for specifying directories to be searched for include files.
22208
The value of <A
22209
HREF="#cv-_F90INCFLAGS"
22210
><CODE
22211
CLASS="envar"
22212
>$_F90INCFLAGS</CODE
22213
></A
22214
> is created
22215
by appending <A
22216
HREF="#cv-INCPREFIX"
22217
><CODE
22218
CLASS="envar"
22219
>$INCPREFIX</CODE
22220
></A
22221
> and <A
22222
HREF="#cv-INCSUFFIX"
22223
><CODE
22224
CLASS="envar"
22225
>$INCSUFFIX</CODE
22226
></A
22227
>
22228
to the beginning and end
22229
of each directory in <A
22230
HREF="#cv-F90PATH"
22231
><CODE
22232
CLASS="envar"
22233
>$F90PATH</CODE
22234
></A
22235
>.
22236
</P
22237
></DD
22238
><DT
22239
><A
22240
NAME="cv-F90PATH"
22241
></A
22242
><CODE
22243
CLASS="envar"
22244
>F90PATH</CODE
22245
></DT
22246
><DD
22247
><P
22248
>&#13;The list of directories that the Fortran 90 compiler will search for include
22249
directories. The implicit dependency scanner will search these
22250
directories for include files. Don't explicitly put include directory
22251
arguments in <A
22252
HREF="#cv-F90FLAGS"
22253
><CODE
22254
CLASS="envar"
22255
>$F90FLAGS</CODE
22256
></A
22257
> because the result will be non-portable
22258
and the directories will not be searched by the dependency scanner. Note:
22259
directory names in <A
22260
HREF="#cv-F90PATH"
22261
><CODE
22262
CLASS="envar"
22263
>$F90PATH</CODE
22264
></A
22265
> will be looked-up relative to the SConscript
22266
directory when they are used in a command. To force
22267
<SPAN
22268
CLASS="application"
22269
>scons</SPAN
22270
>
22271
to look-up a directory relative to the root of the source tree use #:
22272
You only need to set <A
22273
HREF="#cv-F90PATH"
22274
><CODE
22275
CLASS="envar"
22276
>$F90PATH</CODE
22277
></A
22278
> if you need to define a specific
22279
include path for Fortran 90 files.
22280
You should normally set the <A
22281
HREF="#cv-FORTRANPATH"
22282
><CODE
22283
CLASS="envar"
22284
>$FORTRANPATH</CODE
22285
></A
22286
> variable,
22287
which specifies the include path
22288
for the default Fortran compiler
22289
for all Fortran versions.
22290
</P
22291
><PRE
22292
CLASS="programlisting"
22293
>&#13;env = Environment(F90PATH='#/include')
22294
</PRE
22295
><P
22296
>&#13;The directory look-up can also be forced using the
22297
<CODE
22298
CLASS="function"
22299
>Dir</CODE
22300
>()
22301
function:
22302
</P
22303
><PRE
22304
CLASS="programlisting"
22305
>&#13;include = Dir('include')
22306
env = Environment(F90PATH=include)
22307
</PRE
22308
><P
22309
>&#13;The directory list will be added to command lines
22310
through the automatically-generated
22311
<A
22312
HREF="#cv-_F90INCFLAGS"
22313
><CODE
22314
CLASS="envar"
22315
>$_F90INCFLAGS</CODE
22316
></A
22317
>
22318
construction variable,
22319
which is constructed by
22320
appending the values of the
22321
<A
22322
HREF="#cv-INCPREFIX"
22323
><CODE
22324
CLASS="envar"
22325
>$INCPREFIX</CODE
22326
></A
22327
> and <A
22328
HREF="#cv-INCSUFFIX"
22329
><CODE
22330
CLASS="envar"
22331
>$INCSUFFIX</CODE
22332
></A
22333
>
22334
construction variables
22335
to the beginning and end
22336
of each directory in <A
22337
HREF="#cv-F90PATH"
22338
><CODE
22339
CLASS="envar"
22340
>$F90PATH</CODE
22341
></A
22342
>.
22343
Any command lines you define that need
22344
the F90PATH directory list should
22345
include <A
22346
HREF="#cv-_F90INCFLAGS"
22347
><CODE
22348
CLASS="envar"
22349
>$_F90INCFLAGS</CODE
22350
></A
22351
>:
22352
</P
22353
><PRE
22354
CLASS="programlisting"
22355
>&#13;env = Environment(F90COM="my_compiler $_F90INCFLAGS -c -o $TARGET $SOURCE")
22356
</PRE
22357
></DD
22358
><DT
22359
><A
22360
NAME="cv-F90PPCOM"
22361
></A
22362
><CODE
22363
CLASS="envar"
22364
>F90PPCOM</CODE
22365
></DT
22366
><DD
22367
><P
22368
>&#13;The command line used to compile a Fortran 90 source file to an object file
22369
after first running the file through the C preprocessor.
22370
Any options specified in the <A
22371
HREF="#cv-F90FLAGS"
22372
><CODE
22373
CLASS="envar"
22374
>$F90FLAGS</CODE
22375
></A
22376
> and <A
22377
HREF="#cv-CPPFLAGS"
22378
><CODE
22379
CLASS="envar"
22380
>$CPPFLAGS</CODE
22381
></A
22382
> construction variables
22383
are included on this command line.
22384
You only need to set <A
22385
HREF="#cv-F90PPCOM"
22386
><CODE
22387
CLASS="envar"
22388
>$F90PPCOM</CODE
22389
></A
22390
> if you need to use a specific
22391
C-preprocessor command line for Fortran 90 files.
22392
You should normally set the <A
22393
HREF="#cv-FORTRANPPCOM"
22394
><CODE
22395
CLASS="envar"
22396
>$FORTRANPPCOM</CODE
22397
></A
22398
> variable,
22399
which specifies the default C-preprocessor command line
22400
for all Fortran versions.
22401
</P
22402
></DD
22403
><DT
22404
><A
22405
NAME="cv-F90PPCOMSTR"
22406
></A
22407
><CODE
22408
CLASS="envar"
22409
>F90PPCOMSTR</CODE
22410
></DT
22411
><DD
22412
><P
22413
>&#13;The string displayed when a Fortran 90 source file
22414
is compiled after first running the file through the C preprocessor.
22415
If this is not set, then <A
22416
HREF="#cv-F90PPCOM"
22417
><CODE
22418
CLASS="envar"
22419
>$F90PPCOM</CODE
22420
></A
22421
> or <A
22422
HREF="#cv-FORTRANPPCOM"
22423
><CODE
22424
CLASS="envar"
22425
>$FORTRANPPCOM</CODE
22426
></A
22427
>
22428
(the command line) is displayed.
22429
</P
22430
></DD
22431
><DT
22432
><A
22433
NAME="cv-F90PPFILESUFFIXES"
22434
></A
22435
><CODE
22436
CLASS="envar"
22437
>F90PPFILESUFFIXES</CODE
22438
></DT
22439
><DD
22440
><P
22441
>&#13;The list of file extensions for which the compilation + preprocessor pass for
22442
F90 dialect will be used. By default, this is empty
22443
</P
22444
></DD
22445
><DT
22446
><A
22447
NAME="cv-F95"
22448
></A
22449
><CODE
22450
CLASS="envar"
22451
>F95</CODE
22452
></DT
22453
><DD
22454
><P
22455
>&#13;The Fortran 95 compiler.
22456
You should normally set the <A
22457
HREF="#cv-FORTRAN"
22458
><CODE
22459
CLASS="envar"
22460
>$FORTRAN</CODE
22461
></A
22462
> variable,
22463
which specifies the default Fortran compiler
22464
for all Fortran versions.
22465
You only need to set <A
22466
HREF="#cv-F95"
22467
><CODE
22468
CLASS="envar"
22469
>$F95</CODE
22470
></A
22471
> if you need to use a specific compiler
22472
or compiler version for Fortran 95 files.
22473
</P
22474
></DD
22475
><DT
22476
><A
22477
NAME="cv-F95COM"
22478
></A
22479
><CODE
22480
CLASS="envar"
22481
>F95COM</CODE
22482
></DT
22483
><DD
22484
><P
22485
>&#13;The command line used to compile a Fortran 95 source file to an object file.
22486
You only need to set <A
22487
HREF="#cv-F95COM"
22488
><CODE
22489
CLASS="envar"
22490
>$F95COM</CODE
22491
></A
22492
> if you need to use a specific
22493
command line for Fortran 95 files.
22494
You should normally set the <A
22495
HREF="#cv-FORTRANCOM"
22496
><CODE
22497
CLASS="envar"
22498
>$FORTRANCOM</CODE
22499
></A
22500
> variable,
22501
which specifies the default command line
22502
for all Fortran versions.
22503
</P
22504
></DD
22505
><DT
22506
><A
22507
NAME="cv-F95COMSTR"
22508
></A
22509
><CODE
22510
CLASS="envar"
22511
>F95COMSTR</CODE
22512
></DT
22513
><DD
22514
><P
22515
>&#13;The string displayed when a Fortran 95 source file
22516
is compiled to an object file.
22517
If this is not set, then <A
22518
HREF="#cv-F95COM"
22519
><CODE
22520
CLASS="envar"
22521
>$F95COM</CODE
22522
></A
22523
> or <A
22524
HREF="#cv-FORTRANCOM"
22525
><CODE
22526
CLASS="envar"
22527
>$FORTRANCOM</CODE
22528
></A
22529
>
22530
(the command line) is displayed.
22531
</P
22532
></DD
22533
><DT
22534
><A
22535
NAME="cv-F95FILESUFFIXES"
22536
></A
22537
><CODE
22538
CLASS="envar"
22539
>F95FILESUFFIXES</CODE
22540
></DT
22541
><DD
22542
><P
22543
>&#13;The list of file extensions for which the F95 dialect will be used. By
22544
default, this is ['.f95']
22545
</P
22546
></DD
22547
><DT
22548
><A
22549
NAME="cv-F95FLAGS"
22550
></A
22551
><CODE
22552
CLASS="envar"
22553
>F95FLAGS</CODE
22554
></DT
22555
><DD
22556
><P
22557
>&#13;General user-specified options that are passed to the Fortran 95 compiler.
22558
Note that this variable does
22559
<SPAN
22560
CLASS="emphasis"
22561
><I
22562
CLASS="emphasis"
22563
>not</I
22564
></SPAN
22565
>
22566
contain
22567
<CODE
22568
CLASS="option"
22569
>-I</CODE
22570
>
22571
(or similar) include search path options
22572
that scons generates automatically from <A
22573
HREF="#cv-F95PATH"
22574
><CODE
22575
CLASS="envar"
22576
>$F95PATH</CODE
22577
></A
22578
>.
22579
See
22580
<A
22581
HREF="#cv-_F95INCFLAGS"
22582
><CODE
22583
CLASS="envar"
22584
>$_F95INCFLAGS</CODE
22585
></A
22586
>
22587
below,
22588
for the variable that expands to those options.
22589
You only need to set <A
22590
HREF="#cv-F95FLAGS"
22591
><CODE
22592
CLASS="envar"
22593
>$F95FLAGS</CODE
22594
></A
22595
> if you need to define specific
22596
user options for Fortran 95 files.
22597
You should normally set the <A
22598
HREF="#cv-FORTRANFLAGS"
22599
><CODE
22600
CLASS="envar"
22601
>$FORTRANFLAGS</CODE
22602
></A
22603
> variable,
22604
which specifies the user-specified options
22605
passed to the default Fortran compiler
22606
for all Fortran versions.
22607
</P
22608
></DD
22609
><DT
22610
><A
22611
NAME="cv-_F95INCFLAGS"
22612
></A
22613
><CODE
22614
CLASS="envar"
22615
>_F95INCFLAGS</CODE
22616
></DT
22617
><DD
22618
><P
22619
>&#13;An automatically-generated construction variable
22620
containing the Fortran 95 compiler command-line options
22621
for specifying directories to be searched for include files.
22622
The value of <A
22623
HREF="#cv-_F95INCFLAGS"
22624
><CODE
22625
CLASS="envar"
22626
>$_F95INCFLAGS</CODE
22627
></A
22628
> is created
22629
by appending <A
22630
HREF="#cv-INCPREFIX"
22631
><CODE
22632
CLASS="envar"
22633
>$INCPREFIX</CODE
22634
></A
22635
> and <A
22636
HREF="#cv-INCSUFFIX"
22637
><CODE
22638
CLASS="envar"
22639
>$INCSUFFIX</CODE
22640
></A
22641
>
22642
to the beginning and end
22643
of each directory in <A
22644
HREF="#cv-F95PATH"
22645
><CODE
22646
CLASS="envar"
22647
>$F95PATH</CODE
22648
></A
22649
>.
22650
</P
22651
></DD
22652
><DT
22653
><A
22654
NAME="cv-F95PATH"
22655
></A
22656
><CODE
22657
CLASS="envar"
22658
>F95PATH</CODE
22659
></DT
22660
><DD
22661
><P
22662
>&#13;The list of directories that the Fortran 95 compiler will search for include
22663
directories. The implicit dependency scanner will search these
22664
directories for include files. Don't explicitly put include directory
22665
arguments in <A
22666
HREF="#cv-F95FLAGS"
22667
><CODE
22668
CLASS="envar"
22669
>$F95FLAGS</CODE
22670
></A
22671
> because the result will be non-portable
22672
and the directories will not be searched by the dependency scanner. Note:
22673
directory names in <A
22674
HREF="#cv-F95PATH"
22675
><CODE
22676
CLASS="envar"
22677
>$F95PATH</CODE
22678
></A
22679
> will be looked-up relative to the SConscript
22680
directory when they are used in a command. To force
22681
<SPAN
22682
CLASS="application"
22683
>scons</SPAN
22684
>
22685
to look-up a directory relative to the root of the source tree use #:
22686
You only need to set <A
22687
HREF="#cv-F95PATH"
22688
><CODE
22689
CLASS="envar"
22690
>$F95PATH</CODE
22691
></A
22692
> if you need to define a specific
22693
include path for Fortran 95 files.
22694
You should normally set the <A
22695
HREF="#cv-FORTRANPATH"
22696
><CODE
22697
CLASS="envar"
22698
>$FORTRANPATH</CODE
22699
></A
22700
> variable,
22701
which specifies the include path
22702
for the default Fortran compiler
22703
for all Fortran versions.
22704
</P
22705
><PRE
22706
CLASS="programlisting"
22707
>&#13;env = Environment(F95PATH='#/include')
22708
</PRE
22709
><P
22710
>&#13;The directory look-up can also be forced using the
22711
<CODE
22712
CLASS="function"
22713
>Dir</CODE
22714
>()
22715
function:
22716
</P
22717
><PRE
22718
CLASS="programlisting"
22719
>&#13;include = Dir('include')
22720
env = Environment(F95PATH=include)
22721
</PRE
22722
><P
22723
>&#13;The directory list will be added to command lines
22724
through the automatically-generated
22725
<A
22726
HREF="#cv-_F95INCFLAGS"
22727
><CODE
22728
CLASS="envar"
22729
>$_F95INCFLAGS</CODE
22730
></A
22731
>
22732
construction variable,
22733
which is constructed by
22734
appending the values of the
22735
<A
22736
HREF="#cv-INCPREFIX"
22737
><CODE
22738
CLASS="envar"
22739
>$INCPREFIX</CODE
22740
></A
22741
> and <A
22742
HREF="#cv-INCSUFFIX"
22743
><CODE
22744
CLASS="envar"
22745
>$INCSUFFIX</CODE
22746
></A
22747
>
22748
construction variables
22749
to the beginning and end
22750
of each directory in <A
22751
HREF="#cv-F95PATH"
22752
><CODE
22753
CLASS="envar"
22754
>$F95PATH</CODE
22755
></A
22756
>.
22757
Any command lines you define that need
22758
the F95PATH directory list should
22759
include <A
22760
HREF="#cv-_F95INCFLAGS"
22761
><CODE
22762
CLASS="envar"
22763
>$_F95INCFLAGS</CODE
22764
></A
22765
>:
22766
</P
22767
><PRE
22768
CLASS="programlisting"
22769
>&#13;env = Environment(F95COM="my_compiler $_F95INCFLAGS -c -o $TARGET $SOURCE")
22770
</PRE
22771
></DD
22772
><DT
22773
><A
22774
NAME="cv-F95PPCOM"
22775
></A
22776
><CODE
22777
CLASS="envar"
22778
>F95PPCOM</CODE
22779
></DT
22780
><DD
22781
><P
22782
>&#13;The command line used to compile a Fortran 95 source file to an object file
22783
after first running the file through the C preprocessor.
22784
Any options specified in the <A
22785
HREF="#cv-F95FLAGS"
22786
><CODE
22787
CLASS="envar"
22788
>$F95FLAGS</CODE
22789
></A
22790
> and <A
22791
HREF="#cv-CPPFLAGS"
22792
><CODE
22793
CLASS="envar"
22794
>$CPPFLAGS</CODE
22795
></A
22796
> construction variables
22797
are included on this command line.
22798
You only need to set <A
22799
HREF="#cv-F95PPCOM"
22800
><CODE
22801
CLASS="envar"
22802
>$F95PPCOM</CODE
22803
></A
22804
> if you need to use a specific
22805
C-preprocessor command line for Fortran 95 files.
22806
You should normally set the <A
22807
HREF="#cv-FORTRANPPCOM"
22808
><CODE
22809
CLASS="envar"
22810
>$FORTRANPPCOM</CODE
22811
></A
22812
> variable,
22813
which specifies the default C-preprocessor command line
22814
for all Fortran versions.
22815
</P
22816
></DD
22817
><DT
22818
><A
22819
NAME="cv-F95PPCOMSTR"
22820
></A
22821
><CODE
22822
CLASS="envar"
22823
>F95PPCOMSTR</CODE
22824
></DT
22825
><DD
22826
><P
22827
>&#13;The string displayed when a Fortran 95 source file
22828
is compiled to an object file
22829
after first running the file through the C preprocessor.
22830
If this is not set, then <A
22831
HREF="#cv-F95PPCOM"
22832
><CODE
22833
CLASS="envar"
22834
>$F95PPCOM</CODE
22835
></A
22836
> or <A
22837
HREF="#cv-FORTRANPPCOM"
22838
><CODE
22839
CLASS="envar"
22840
>$FORTRANPPCOM</CODE
22841
></A
22842
>
22843
(the command line) is displayed.
22844
</P
22845
></DD
22846
><DT
22847
><A
22848
NAME="cv-F95PPFILESUFFIXES"
22849
></A
22850
><CODE
22851
CLASS="envar"
22852
>F95PPFILESUFFIXES</CODE
22853
></DT
22854
><DD
22855
><P
22856
>&#13;The list of file extensions for which the compilation + preprocessor pass for
22857
F95 dialect will be used. By default, this is empty
22858
</P
22859
></DD
22860
><DT
22861
><A
22862
NAME="cv-File"
22863
></A
22864
><CODE
22865
CLASS="envar"
22866
>File</CODE
22867
></DT
22868
><DD
22869
><P
22870
>&#13;A function that converts a string into a File instance relative to the
22871
target being built.
22872
</P
22873
></DD
22874
><DT
22875
><A
22876
NAME="cv-FORTRAN"
22877
></A
22878
><CODE
22879
CLASS="envar"
22880
>FORTRAN</CODE
22881
></DT
22882
><DD
22883
><P
22884
>&#13;The default Fortran compiler
22885
for all versions of Fortran.
22886
</P
22887
></DD
22888
><DT
22889
><A
22890
NAME="cv-FORTRANCOM"
22891
></A
22892
><CODE
22893
CLASS="envar"
22894
>FORTRANCOM</CODE
22895
></DT
22896
><DD
22897
><P
22898
>&#13;The command line used to compile a Fortran source file to an object file.
22899
By default, any options specified
22900
in the <A
22901
HREF="#cv-FORTRANFLAGS"
22902
><CODE
22903
CLASS="envar"
22904
>$FORTRANFLAGS</CODE
22905
></A
22906
>,
22907
<A
22908
HREF="#cv-CPPFLAGS"
22909
><CODE
22910
CLASS="envar"
22911
>$CPPFLAGS</CODE
22912
></A
22913
>,
22914
<A
22915
HREF="#cv-_CPPDEFFLAGS"
22916
><CODE
22917
CLASS="envar"
22918
>$_CPPDEFFLAGS</CODE
22919
></A
22920
>,
22921
<A
22922
HREF="#cv-_FORTRANMODFLAG"
22923
><CODE
22924
CLASS="envar"
22925
>$_FORTRANMODFLAG</CODE
22926
></A
22927
>, and
22928
<A
22929
HREF="#cv-_FORTRANINCFLAGS"
22930
><CODE
22931
CLASS="envar"
22932
>$_FORTRANINCFLAGS</CODE
22933
></A
22934
> construction variables
22935
are included on this command line.
22936
</P
22937
></DD
22938
><DT
22939
><A
22940
NAME="cv-FORTRANCOMSTR"
22941
></A
22942
><CODE
22943
CLASS="envar"
22944
>FORTRANCOMSTR</CODE
22945
></DT
22946
><DD
22947
><P
22948
>&#13;The string displayed when a Fortran source file
22949
is compiled to an object file.
22950
If this is not set, then <A
22951
HREF="#cv-FORTRANCOM"
22952
><CODE
22953
CLASS="envar"
22954
>$FORTRANCOM</CODE
22955
></A
22956
>
22957
(the command line) is displayed.
22958
</P
22959
></DD
22960
><DT
22961
><A
22962
NAME="cv-FORTRANFILESUFFIXES"
22963
></A
22964
><CODE
22965
CLASS="envar"
22966
>FORTRANFILESUFFIXES</CODE
22967
></DT
22968
><DD
22969
><P
22970
>&#13;The list of file extensions for which the FORTRAN dialect will be used. By
22971
default, this is ['.f', '.for', '.ftn']
22972
</P
22973
></DD
22974
><DT
22975
><A
22976
NAME="cv-FORTRANFLAGS"
22977
></A
22978
><CODE
22979
CLASS="envar"
22980
>FORTRANFLAGS</CODE
22981
></DT
22982
><DD
22983
><P
22984
>&#13;General user-specified options that are passed to the Fortran compiler.
22985
Note that this variable does
22986
<SPAN
22987
CLASS="emphasis"
22988
><I
22989
CLASS="emphasis"
22990
>not</I
22991
></SPAN
22992
>
22993
contain
22994
<CODE
22995
CLASS="option"
22996
>-I</CODE
22997
>
22998
(or similar) include or module search path options
22999
that scons generates automatically from <A
23000
HREF="#cv-FORTRANPATH"
23001
><CODE
23002
CLASS="envar"
23003
>$FORTRANPATH</CODE
23004
></A
23005
>.
23006
See
23007
<A
23008
HREF="#cv-_FORTRANINCFLAGS"
23009
><CODE
23010
CLASS="envar"
23011
>$_FORTRANINCFLAGS</CODE
23012
></A
23013
> and <A
23014
HREF="#cv-_FORTRANMODFLAG"
23015
><CODE
23016
CLASS="envar"
23017
>$_FORTRANMODFLAG</CODE
23018
></A
23019
>,
23020
below,
23021
for the variables that expand those options.
23022
</P
23023
></DD
23024
><DT
23025
><A
23026
NAME="cv-_FORTRANINCFLAGS"
23027
></A
23028
><CODE
23029
CLASS="envar"
23030
>_FORTRANINCFLAGS</CODE
23031
></DT
23032
><DD
23033
><P
23034
>&#13;An automatically-generated construction variable
23035
containing the Fortran compiler command-line options
23036
for specifying directories to be searched for include
23037
files and module files.
23038
The value of <A
23039
HREF="#cv-_FORTRANINCFLAGS"
23040
><CODE
23041
CLASS="envar"
23042
>$_FORTRANINCFLAGS</CODE
23043
></A
23044
> is created
23045
by prepending/appending <A
23046
HREF="#cv-INCPREFIX"
23047
><CODE
23048
CLASS="envar"
23049
>$INCPREFIX</CODE
23050
></A
23051
> and <A
23052
HREF="#cv-INCSUFFIX"
23053
><CODE
23054
CLASS="envar"
23055
>$INCSUFFIX</CODE
23056
></A
23057
>
23058
to the beginning and end
23059
of each directory in <A
23060
HREF="#cv-FORTRANPATH"
23061
><CODE
23062
CLASS="envar"
23063
>$FORTRANPATH</CODE
23064
></A
23065
>.
23066
</P
23067
></DD
23068
><DT
23069
><A
23070
NAME="cv-FORTRANMODDIR"
23071
></A
23072
><CODE
23073
CLASS="envar"
23074
>FORTRANMODDIR</CODE
23075
></DT
23076
><DD
23077
><P
23078
>&#13;Directory location where the Fortran compiler should place
23079
any module files it generates.  This variable is empty, by default. Some
23080
Fortran compilers will internally append this directory in the search path
23081
for module files, as well.
23082
</P
23083
></DD
23084
><DT
23085
><A
23086
NAME="cv-FORTRANMODDIRPREFIX"
23087
></A
23088
><CODE
23089
CLASS="envar"
23090
>FORTRANMODDIRPREFIX</CODE
23091
></DT
23092
><DD
23093
><P
23094
>&#13;The prefix used to specify a module directory on the Fortran compiler command
23095
line.
23096
This will be appended to the beginning of the directory
23097
in the <A
23098
HREF="#cv-FORTRANMODDIR"
23099
><CODE
23100
CLASS="envar"
23101
>$FORTRANMODDIR</CODE
23102
></A
23103
> construction variables
23104
when the <A
23105
HREF="#cv-_FORTRANMODFLAG"
23106
><CODE
23107
CLASS="envar"
23108
>$_FORTRANMODFLAG</CODE
23109
></A
23110
> variables is automatically generated.
23111
</P
23112
></DD
23113
><DT
23114
><A
23115
NAME="cv-FORTRANMODDIRSUFFIX"
23116
></A
23117
><CODE
23118
CLASS="envar"
23119
>FORTRANMODDIRSUFFIX</CODE
23120
></DT
23121
><DD
23122
><P
23123
>&#13;The suffix used to specify a module directory on the Fortran compiler command
23124
line.
23125
This will be appended to the beginning of the directory
23126
in the <A
23127
HREF="#cv-FORTRANMODDIR"
23128
><CODE
23129
CLASS="envar"
23130
>$FORTRANMODDIR</CODE
23131
></A
23132
> construction variables
23133
when the <A
23134
HREF="#cv-_FORTRANMODFLAG"
23135
><CODE
23136
CLASS="envar"
23137
>$_FORTRANMODFLAG</CODE
23138
></A
23139
> variables is automatically generated.
23140
</P
23141
></DD
23142
><DT
23143
><A
23144
NAME="cv-_FORTRANMODFLAG"
23145
></A
23146
><CODE
23147
CLASS="envar"
23148
>_FORTRANMODFLAG</CODE
23149
></DT
23150
><DD
23151
><P
23152
>&#13;An automatically-generated construction variable
23153
containing the Fortran compiler command-line option
23154
for specifying the directory location where the Fortran
23155
compiler should place any module files that happen to get
23156
generated during compilation.
23157
The value of <A
23158
HREF="#cv-_FORTRANMODFLAG"
23159
><CODE
23160
CLASS="envar"
23161
>$_FORTRANMODFLAG</CODE
23162
></A
23163
> is created
23164
by prepending/appending <A
23165
HREF="#cv-FORTRANMODDIRPREFIX"
23166
><CODE
23167
CLASS="envar"
23168
>$FORTRANMODDIRPREFIX</CODE
23169
></A
23170
> and
23171
<A
23172
HREF="#cv-FORTRANMODDIRSUFFIX"
23173
><CODE
23174
CLASS="envar"
23175
>$FORTRANMODDIRSUFFIX</CODE
23176
></A
23177
>
23178
to the beginning and end of the directory in <A
23179
HREF="#cv-FORTRANMODDIR"
23180
><CODE
23181
CLASS="envar"
23182
>$FORTRANMODDIR</CODE
23183
></A
23184
>.
23185
</P
23186
></DD
23187
><DT
23188
><A
23189
NAME="cv-FORTRANMODPREFIX"
23190
></A
23191
><CODE
23192
CLASS="envar"
23193
>FORTRANMODPREFIX</CODE
23194
></DT
23195
><DD
23196
><P
23197
>&#13;The module file prefix used by the Fortran compiler.  SCons assumes that
23198
the Fortran compiler follows the quasi-standard naming convention for
23199
module files of
23200
<TT
23201
CLASS="filename"
23202
>module_name.mod</TT
23203
>.
23204
As a result, this variable is left empty, by default.  For situations in
23205
which the compiler does not necessarily follow the normal convention,
23206
the user may use this variable.  Its value will be appended to every
23207
module file name as scons attempts to resolve dependencies.
23208
</P
23209
></DD
23210
><DT
23211
><A
23212
NAME="cv-FORTRANMODSUFFIX"
23213
></A
23214
><CODE
23215
CLASS="envar"
23216
>FORTRANMODSUFFIX</CODE
23217
></DT
23218
><DD
23219
><P
23220
>&#13;The module file suffix used by the Fortran compiler.  SCons assumes that
23221
the Fortran compiler follows the quasi-standard naming convention for
23222
module files of
23223
<TT
23224
CLASS="filename"
23225
>module_name.mod</TT
23226
>.
23227
As a result, this variable is set to ".mod", by default.  For situations
23228
in which the compiler does not necessarily follow the normal convention,
23229
the user may use this variable.  Its value will be appended to every
23230
module file name as scons attempts to resolve dependencies.
23231
</P
23232
></DD
23233
><DT
23234
><A
23235
NAME="cv-FORTRANPATH"
23236
></A
23237
><CODE
23238
CLASS="envar"
23239
>FORTRANPATH</CODE
23240
></DT
23241
><DD
23242
><P
23243
>&#13;The list of directories that the Fortran compiler will search for
23244
include files and (for some compilers) module files. The Fortran implicit
23245
dependency scanner will search these directories for include files (but
23246
not module files since they are autogenerated and, as such, may not
23247
actually exist at the time the scan takes place). Don't explicitly put
23248
include directory arguments in FORTRANFLAGS because the result will be
23249
non-portable and the directories will not be searched by the dependency
23250
scanner. Note: directory names in FORTRANPATH will be looked-up relative
23251
to the SConscript directory when they are used in a command. To force
23252
<SPAN
23253
CLASS="application"
23254
>scons</SPAN
23255
>
23256
to look-up a directory relative to the root of the source tree use #:
23257
</P
23258
><PRE
23259
CLASS="programlisting"
23260
>&#13;env = Environment(FORTRANPATH='#/include')
23261
</PRE
23262
><P
23263
>&#13;The directory look-up can also be forced using the
23264
<CODE
23265
CLASS="function"
23266
>Dir</CODE
23267
>()
23268
function:
23269
</P
23270
><PRE
23271
CLASS="programlisting"
23272
>&#13;include = Dir('include')
23273
env = Environment(FORTRANPATH=include)
23274
</PRE
23275
><P
23276
>&#13;The directory list will be added to command lines
23277
through the automatically-generated
23278
<A
23279
HREF="#cv-_FORTRANINCFLAGS"
23280
><CODE
23281
CLASS="envar"
23282
>$_FORTRANINCFLAGS</CODE
23283
></A
23284
>
23285
construction variable,
23286
which is constructed by
23287
appending the values of the
23288
<A
23289
HREF="#cv-INCPREFIX"
23290
><CODE
23291
CLASS="envar"
23292
>$INCPREFIX</CODE
23293
></A
23294
> and <A
23295
HREF="#cv-INCSUFFIX"
23296
><CODE
23297
CLASS="envar"
23298
>$INCSUFFIX</CODE
23299
></A
23300
>
23301
construction variables
23302
to the beginning and end
23303
of each directory in <A
23304
HREF="#cv-FORTRANPATH"
23305
><CODE
23306
CLASS="envar"
23307
>$FORTRANPATH</CODE
23308
></A
23309
>.
23310
Any command lines you define that need
23311
the FORTRANPATH directory list should
23312
include <A
23313
HREF="#cv-_FORTRANINCFLAGS"
23314
><CODE
23315
CLASS="envar"
23316
>$_FORTRANINCFLAGS</CODE
23317
></A
23318
>:
23319
</P
23320
><PRE
23321
CLASS="programlisting"
23322
>&#13;env = Environment(FORTRANCOM="my_compiler $_FORTRANINCFLAGS -c -o $TARGET $SOURCE")
23323
</PRE
23324
></DD
23325
><DT
23326
><A
23327
NAME="cv-FORTRANPPCOM"
23328
></A
23329
><CODE
23330
CLASS="envar"
23331
>FORTRANPPCOM</CODE
23332
></DT
23333
><DD
23334
><P
23335
>&#13;The command line used to compile a Fortran source file to an object file
23336
after first running the file through the C preprocessor.
23337
By default, any options specified in the <A
23338
HREF="#cv-FORTRANFLAGS"
23339
><CODE
23340
CLASS="envar"
23341
>$FORTRANFLAGS</CODE
23342
></A
23343
>,
23344
<A
23345
HREF="#cv-CPPFLAGS"
23346
><CODE
23347
CLASS="envar"
23348
>$CPPFLAGS</CODE
23349
></A
23350
>,
23351
<A
23352
HREF="#cv-_CPPDEFFLAGS"
23353
><CODE
23354
CLASS="envar"
23355
>$_CPPDEFFLAGS</CODE
23356
></A
23357
>,
23358
<A
23359
HREF="#cv-_FORTRANMODFLAG"
23360
><CODE
23361
CLASS="envar"
23362
>$_FORTRANMODFLAG</CODE
23363
></A
23364
>, and
23365
<A
23366
HREF="#cv-_FORTRANINCFLAGS"
23367
><CODE
23368
CLASS="envar"
23369
>$_FORTRANINCFLAGS</CODE
23370
></A
23371
>
23372
construction variables are included on this command line.
23373
</P
23374
></DD
23375
><DT
23376
><A
23377
NAME="cv-FORTRANPPCOMSTR"
23378
></A
23379
><CODE
23380
CLASS="envar"
23381
>FORTRANPPCOMSTR</CODE
23382
></DT
23383
><DD
23384
><P
23385
>&#13;The string displayed when a Fortran source file
23386
is compiled to an object file
23387
after first running the file throught the C preprocessor.
23388
If this is not set, then <A
23389
HREF="#cv-FORTRANPPCOM"
23390
><CODE
23391
CLASS="envar"
23392
>$FORTRANPPCOM</CODE
23393
></A
23394
>
23395
(the command line) is displayed.
23396
</P
23397
></DD
23398
><DT
23399
><A
23400
NAME="cv-FORTRANPPFILESUFFIXES"
23401
></A
23402
><CODE
23403
CLASS="envar"
23404
>FORTRANPPFILESUFFIXES</CODE
23405
></DT
23406
><DD
23407
><P
23408
>&#13;The list of file extensions for which the compilation + preprocessor pass for
23409
FORTRAN dialect will be used. By default, this is ['.fpp', '.FPP']
23410
</P
23411
></DD
23412
><DT
23413
><A
23414
NAME="cv-FORTRANSUFFIXES"
23415
></A
23416
><CODE
23417
CLASS="envar"
23418
>FORTRANSUFFIXES</CODE
23419
></DT
23420
><DD
23421
><P
23422
>&#13;The list of suffixes of files that will be scanned
23423
for Fortran implicit dependencies
23424
(INCLUDE lines and USE statements).
23425
The default list is:
23426
</P
23427
><PRE
23428
CLASS="programlisting"
23429
>&#13;[".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP",
23430
".f77", ".F77", ".f90", ".F90", ".f95", ".F95"]
23431
</PRE
23432
></DD
23433
><DT
23434
><A
23435
NAME="cv-FRAMEWORKPATH"
23436
></A
23437
><CODE
23438
CLASS="envar"
23439
>FRAMEWORKPATH</CODE
23440
></DT
23441
><DD
23442
><P
23443
>&#13;On Mac OS X with gcc,
23444
a list containing the paths to search for frameworks.
23445
Used by the compiler to find framework-style includes like
23446
#include &#60;Fmwk/Header.h&#62;.
23447
Used by the linker to find user-specified frameworks when linking (see
23448
<A
23449
HREF="#cv-FRAMEWORKS"
23450
><CODE
23451
CLASS="envar"
23452
>$FRAMEWORKS</CODE
23453
></A
23454
>).
23455
For example:
23456
</P
23457
><PRE
23458
CLASS="programlisting"
23459
>&#13; env.AppendUnique(FRAMEWORKPATH='#myframeworkdir')
23460
</PRE
23461
><P
23462
>&#13;will add
23463
</P
23464
><PRE
23465
CLASS="programlisting"
23466
>&#13;  ... -Fmyframeworkdir
23467
</PRE
23468
><P
23469
>&#13;to the compiler and linker command lines.
23470
</P
23471
></DD
23472
><DT
23473
><A
23474
NAME="cv-_FRAMEWORKPATH"
23475
></A
23476
><CODE
23477
CLASS="envar"
23478
>_FRAMEWORKPATH</CODE
23479
></DT
23480
><DD
23481
><P
23482
>&#13;On Mac OS X with gcc, an automatically-generated construction variable
23483
containing the linker command-line options corresponding to
23484
<A
23485
HREF="#cv-FRAMEWORKPATH"
23486
><CODE
23487
CLASS="envar"
23488
>$FRAMEWORKPATH</CODE
23489
></A
23490
>.
23491
</P
23492
></DD
23493
><DT
23494
><A
23495
NAME="cv-FRAMEWORKPATHPREFIX"
23496
></A
23497
><CODE
23498
CLASS="envar"
23499
>FRAMEWORKPATHPREFIX</CODE
23500
></DT
23501
><DD
23502
><P
23503
>&#13;On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries.
23504
(see <A
23505
HREF="#cv-FRAMEWORKPATH"
23506
><CODE
23507
CLASS="envar"
23508
>$FRAMEWORKPATH</CODE
23509
></A
23510
>).
23511
The default value is
23512
<CODE
23513
CLASS="option"
23514
>-F</CODE
23515
>.
23516
</P
23517
></DD
23518
><DT
23519
><A
23520
NAME="cv-FRAMEWORKPREFIX"
23521
></A
23522
><CODE
23523
CLASS="envar"
23524
>FRAMEWORKPREFIX</CODE
23525
></DT
23526
><DD
23527
><P
23528
>&#13;On Mac OS X with gcc,
23529
the prefix to be used for linking in frameworks
23530
(see <A
23531
HREF="#cv-FRAMEWORKS"
23532
><CODE
23533
CLASS="envar"
23534
>$FRAMEWORKS</CODE
23535
></A
23536
>).
23537
The default value is
23538
<CODE
23539
CLASS="option"
23540
>-framework</CODE
23541
>.
23542
</P
23543
></DD
23544
><DT
23545
><A
23546
NAME="cv-_FRAMEWORKS"
23547
></A
23548
><CODE
23549
CLASS="envar"
23550
>_FRAMEWORKS</CODE
23551
></DT
23552
><DD
23553
><P
23554
>&#13;On Mac OS X with gcc,
23555
an automatically-generated construction variable
23556
containing the linker command-line options
23557
for linking with FRAMEWORKS.
23558
</P
23559
></DD
23560
><DT
23561
><A
23562
NAME="cv-FRAMEWORKS"
23563
></A
23564
><CODE
23565
CLASS="envar"
23566
>FRAMEWORKS</CODE
23567
></DT
23568
><DD
23569
><P
23570
>&#13;On Mac OS X with gcc, a list of the framework names to be linked into a
23571
program or shared library or bundle.
23572
The default value is the empty list.
23573
For example:
23574
</P
23575
><PRE
23576
CLASS="programlisting"
23577
>&#13; env.AppendUnique(FRAMEWORKS=Split('System Cocoa SystemConfiguration'))
23578
</PRE
23579
><P
23580
>&#13;</P
23581
></DD
23582
><DT
23583
><A
23584
NAME="cv-FRAMEWORKSFLAGS"
23585
></A
23586
><CODE
23587
CLASS="envar"
23588
>FRAMEWORKSFLAGS</CODE
23589
></DT
23590
><DD
23591
><P
23592
>&#13;On Mac OS X with gcc,
23593
general user-supplied frameworks options to be added at
23594
the end of a command
23595
line building a loadable module.
23596
(This has been largely superceded by
23597
the <A
23598
HREF="#cv-FRAMEWORKPATH"
23599
><CODE
23600
CLASS="envar"
23601
>$FRAMEWORKPATH</CODE
23602
></A
23603
>, <A
23604
HREF="#cv-FRAMEWORKPATHPREFIX"
23605
><CODE
23606
CLASS="envar"
23607
>$FRAMEWORKPATHPREFIX</CODE
23608
></A
23609
>,
23610
<A
23611
HREF="#cv-FRAMEWORKPREFIX"
23612
><CODE
23613
CLASS="envar"
23614
>$FRAMEWORKPREFIX</CODE
23615
></A
23616
> and <A
23617
HREF="#cv-FRAMEWORKS"
23618
><CODE
23619
CLASS="envar"
23620
>$FRAMEWORKS</CODE
23621
></A
23622
> variables
23623
described above.)
23624
</P
23625
></DD
23626
><DT
23627
><A
23628
NAME="cv-GS"
23629
></A
23630
><CODE
23631
CLASS="envar"
23632
>GS</CODE
23633
></DT
23634
><DD
23635
><P
23636
>&#13;The Ghostscript program used to convert PostScript to PDF files.
23637
</P
23638
></DD
23639
><DT
23640
><A
23641
NAME="cv-GSCOM"
23642
></A
23643
><CODE
23644
CLASS="envar"
23645
>GSCOM</CODE
23646
></DT
23647
><DD
23648
><P
23649
>&#13;The Ghostscript command line used to convert PostScript to PDF files.
23650
</P
23651
></DD
23652
><DT
23653
><A
23654
NAME="cv-GSCOMSTR"
23655
></A
23656
><CODE
23657
CLASS="envar"
23658
>GSCOMSTR</CODE
23659
></DT
23660
><DD
23661
><P
23662
>&#13;The string displayed when
23663
Ghostscript is used to convert
23664
a PostScript file to a PDF file.
23665
If this is not set, then <A
23666
HREF="#cv-GSCOM"
23667
><CODE
23668
CLASS="envar"
23669
>$GSCOM</CODE
23670
></A
23671
> (the command line) is displayed.
23672
</P
23673
></DD
23674
><DT
23675
><A
23676
NAME="cv-GSFLAGS"
23677
></A
23678
><CODE
23679
CLASS="envar"
23680
>GSFLAGS</CODE
23681
></DT
23682
><DD
23683
><P
23684
>&#13;General options passed to the Ghostscript program
23685
when converting PostScript to PDF files.
23686
</P
23687
></DD
23688
><DT
23689
><A
23690
NAME="cv-IDLSUFFIXES"
23691
></A
23692
><CODE
23693
CLASS="envar"
23694
>IDLSUFFIXES</CODE
23695
></DT
23696
><DD
23697
><P
23698
>&#13;The list of suffixes of files that will be scanned
23699
for IDL implicit dependencies
23700
(#include or import lines).
23701
The default list is:
23702
</P
23703
><PRE
23704
CLASS="programlisting"
23705
>&#13;[".idl", ".IDL"]
23706
</PRE
23707
></DD
23708
><DT
23709
><A
23710
NAME="cv-IMPLICIT_COMMAND_DEPENDENCIES"
23711
></A
23712
><CODE
23713
CLASS="envar"
23714
>IMPLICIT_COMMAND_DEPENDENCIES</CODE
23715
></DT
23716
><DD
23717
><P
23718
>&#13;Controls whether or not SCons will
23719
add implicit dependencies for the commands
23720
executed to build targets.</P
23721
><P
23722
>By default, SCons will add
23723
to each target
23724
an implicit dependency on the command
23725
represented by the first argument on any
23726
command line it executes.
23727
The specific file for the dependency is
23728
found by searching the
23729
<CODE
23730
CLASS="varname"
23731
>PATH</CODE
23732
>
23733
variable in the
23734
<CODE
23735
CLASS="varname"
23736
>ENV</CODE
23737
>
23738
environment used to execute the command.</P
23739
><P
23740
>If the construction variable
23741
<CODE
23742
CLASS="envar"
23743
>$IMPLICIT_COMMAND_DEPENDENCIES</CODE
23744
>
23745
is set to a false value
23746
(<TT
23747
CLASS="literal"
23748
>None</TT
23749
>,
23750
<TT
23751
CLASS="literal"
23752
>False</TT
23753
>,
23754
<TT
23755
CLASS="literal"
23756
>0</TT
23757
>,
23758
etc.),
23759
then the implicit dependency will
23760
not be added to the targets
23761
built with that construction environment.
23762
</P
23763
><PRE
23764
CLASS="programlisting"
23765
>&#13;env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0)
23766
</PRE
23767
></DD
23768
><DT
23769
><A
23770
NAME="cv-INCPREFIX"
23771
></A
23772
><CODE
23773
CLASS="envar"
23774
>INCPREFIX</CODE
23775
></DT
23776
><DD
23777
><P
23778
>&#13;The prefix used to specify an include directory on the C compiler command
23779
line.
23780
This will be appended to the beginning of each directory
23781
in the <CODE
23782
CLASS="envar"
23783
>$CPPPATH</CODE
23784
> and <CODE
23785
CLASS="envar"
23786
>$FORTRANPATH</CODE
23787
> construction variables
23788
when the <CODE
23789
CLASS="envar"
23790
>$_CPPINCFLAGS</CODE
23791
> and <CODE
23792
CLASS="envar"
23793
>$_FORTRANINCFLAGS</CODE
23794
>
23795
variables are automatically generated.
23796
</P
23797
></DD
23798
><DT
23799
><A
23800
NAME="cv-INCSUFFIX"
23801
></A
23802
><CODE
23803
CLASS="envar"
23804
>INCSUFFIX</CODE
23805
></DT
23806
><DD
23807
><P
23808
>&#13;The suffix used to specify an include directory on the C compiler command
23809
line.
23810
This will be appended to the end of each directory
23811
in the <CODE
23812
CLASS="envar"
23813
>$CPPPATH</CODE
23814
> and <CODE
23815
CLASS="envar"
23816
>$FORTRANPATH</CODE
23817
> construction variables
23818
when the <CODE
23819
CLASS="envar"
23820
>$_CPPINCFLAGS</CODE
23821
> and <CODE
23822
CLASS="envar"
23823
>$_FORTRANINCFLAGS</CODE
23824
>
23825
variables are automatically generated.
23826
</P
23827
></DD
23828
><DT
23829
><A
23830
NAME="cv-INSTALL"
23831
></A
23832
><CODE
23833
CLASS="envar"
23834
>INSTALL</CODE
23835
></DT
23836
><DD
23837
><P
23838
>&#13;A function to be called to install a file into a
23839
destination file name.
23840
The default function copies the file into the destination
23841
(and sets the destination file's mode and permission bits
23842
to match the source file's).
23843
The function takes the following arguments:
23844
</P
23845
><PRE
23846
CLASS="programlisting"
23847
>&#13;def install(dest, source, env):
23848
</PRE
23849
><P
23850
>&#13;<CODE
23851
CLASS="varname"
23852
>dest</CODE
23853
>
23854
is the path name of the destination file.
23855
<CODE
23856
CLASS="varname"
23857
>source</CODE
23858
>
23859
is the path name of the source file.
23860
<CODE
23861
CLASS="varname"
23862
>env</CODE
23863
>
23864
is the construction environment
23865
(a dictionary of construction values)
23866
in force for this file installation.
23867
</P
23868
></DD
23869
><DT
23870
><A
23871
NAME="cv-INSTALLSTR"
23872
></A
23873
><CODE
23874
CLASS="envar"
23875
>INSTALLSTR</CODE
23876
></DT
23877
><DD
23878
><P
23879
>&#13;The string displayed when a file is
23880
installed into a destination file name.
23881
The default is:
23882
</P
23883
><PRE
23884
CLASS="programlisting"
23885
>&#13;Install file: "$SOURCE" as "$TARGET"
23886
</PRE
23887
></DD
23888
><DT
23889
><A
23890
NAME="cv-INTEL_C_COMPILER_VERSION"
23891
></A
23892
><CODE
23893
CLASS="envar"
23894
>INTEL_C_COMPILER_VERSION</CODE
23895
></DT
23896
><DD
23897
><P
23898
>&#13;Set by the "intelc" Tool
23899
to the major version number of the Intel C compiler
23900
selected for use.
23901
</P
23902
></DD
23903
><DT
23904
><A
23905
NAME="cv-JAR"
23906
></A
23907
><CODE
23908
CLASS="envar"
23909
>JAR</CODE
23910
></DT
23911
><DD
23912
><P
23913
>&#13;The Java archive tool.
23914
</P
23915
></DD
23916
><DT
23917
><A
23918
NAME="cv-JARCHDIR"
23919
></A
23920
><CODE
23921
CLASS="envar"
23922
>JARCHDIR</CODE
23923
></DT
23924
><DD
23925
><P
23926
>&#13;The directory to which the Java archive tool should change
23927
(using the
23928
<CODE
23929
CLASS="option"
23930
>-C</CODE
23931
>
23932
option).
23933
</P
23934
></DD
23935
><DT
23936
><A
23937
NAME="cv-JARCOM"
23938
></A
23939
><CODE
23940
CLASS="envar"
23941
>JARCOM</CODE
23942
></DT
23943
><DD
23944
><P
23945
>&#13;The command line used to call the Java archive tool.
23946
</P
23947
></DD
23948
><DT
23949
><A
23950
NAME="cv-JARCOMSTR"
23951
></A
23952
><CODE
23953
CLASS="envar"
23954
>JARCOMSTR</CODE
23955
></DT
23956
><DD
23957
><P
23958
>&#13;The string displayed when the Java archive tool
23959
is called
23960
If this is not set, then <CODE
23961
CLASS="envar"
23962
>$JARCOM</CODE
23963
> (the command line) is displayed.
23964
</P
23965
><PRE
23966
CLASS="programlisting"
23967
>&#13;env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET")
23968
</PRE
23969
></DD
23970
><DT
23971
><A
23972
NAME="cv-JARFLAGS"
23973
></A
23974
><CODE
23975
CLASS="envar"
23976
>JARFLAGS</CODE
23977
></DT
23978
><DD
23979
><P
23980
>&#13;General options passed to the Java archive tool.
23981
By default this is set to
23982
<CODE
23983
CLASS="option"
23984
>cf</CODE
23985
>
23986
to create the necessary
23987
<B
23988
CLASS="command"
23989
>jar</B
23990
>
23991
file.
23992
</P
23993
></DD
23994
><DT
23995
><A
23996
NAME="cv-JARSUFFIX"
23997
></A
23998
><CODE
23999
CLASS="envar"
24000
>JARSUFFIX</CODE
24001
></DT
24002
><DD
24003
><P
24004
>&#13;The suffix for Java archives:
24005
<TT
24006
CLASS="filename"
24007
>.jar</TT
24008
>
24009
by default.
24010
</P
24011
></DD
24012
><DT
24013
><A
24014
NAME="cv-JAVABOOTCLASSPATH"
24015
></A
24016
><CODE
24017
CLASS="envar"
24018
>JAVABOOTCLASSPATH</CODE
24019
></DT
24020
><DD
24021
><P
24022
>&#13;Specifies the list of directories that
24023
will be added to the
24024
<SPAN
24025
CLASS="application"
24026
>javac</SPAN
24027
> command line
24028
via the <CODE
24029
CLASS="option"
24030
>-bootclasspath</CODE
24031
> option.
24032
The individual directory names will be
24033
separated by the operating system's path separate character
24034
(<TT
24035
CLASS="filename"
24036
>:</TT
24037
> on UNIX/Linux/POSIX,
24038
<TT
24039
CLASS="filename"
24040
>;</TT
24041
> on Windows).
24042
</P
24043
></DD
24044
><DT
24045
><A
24046
NAME="cv-JAVAC"
24047
></A
24048
><CODE
24049
CLASS="envar"
24050
>JAVAC</CODE
24051
></DT
24052
><DD
24053
><P
24054
>&#13;The Java compiler.
24055
</P
24056
></DD
24057
><DT
24058
><A
24059
NAME="cv-JAVACCOM"
24060
></A
24061
><CODE
24062
CLASS="envar"
24063
>JAVACCOM</CODE
24064
></DT
24065
><DD
24066
><P
24067
>&#13;The command line used to compile a directory tree containing
24068
Java source files to
24069
corresponding Java class files.
24070
Any options specified in the <A
24071
HREF="#cv-JAVACFLAGS"
24072
><CODE
24073
CLASS="envar"
24074
>$JAVACFLAGS</CODE
24075
></A
24076
> construction variable
24077
are included on this command line.
24078
</P
24079
></DD
24080
><DT
24081
><A
24082
NAME="cv-JAVACCOMSTR"
24083
></A
24084
><CODE
24085
CLASS="envar"
24086
>JAVACCOMSTR</CODE
24087
></DT
24088
><DD
24089
><P
24090
>&#13;The string displayed when compiling
24091
a directory tree of Java source files to
24092
corresponding Java class files.
24093
If this is not set, then <A
24094
HREF="#cv-JAVACCOM"
24095
><CODE
24096
CLASS="envar"
24097
>$JAVACCOM</CODE
24098
></A
24099
> (the command line) is displayed.
24100
</P
24101
><PRE
24102
CLASS="programlisting"
24103
>&#13;env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES")
24104
</PRE
24105
></DD
24106
><DT
24107
><A
24108
NAME="cv-JAVACFLAGS"
24109
></A
24110
><CODE
24111
CLASS="envar"
24112
>JAVACFLAGS</CODE
24113
></DT
24114
><DD
24115
><P
24116
>&#13;General options that are passed to the Java compiler.
24117
</P
24118
></DD
24119
><DT
24120
><A
24121
NAME="cv-JAVACLASSDIR"
24122
></A
24123
><CODE
24124
CLASS="envar"
24125
>JAVACLASSDIR</CODE
24126
></DT
24127
><DD
24128
><P
24129
>&#13;The directory in which Java class files may be found.
24130
This is stripped from the beginning of any Java .class
24131
file names supplied to the
24132
<TT
24133
CLASS="literal"
24134
>JavaH</TT
24135
>
24136
builder.
24137
</P
24138
></DD
24139
><DT
24140
><A
24141
NAME="cv-JAVACLASSPATH"
24142
></A
24143
><CODE
24144
CLASS="envar"
24145
>JAVACLASSPATH</CODE
24146
></DT
24147
><DD
24148
><P
24149
>&#13;Specifies the list of directories that
24150
will be searched for Java
24151
<TT
24152
CLASS="filename"
24153
>.class</TT
24154
> file.
24155
The directories in this list will be added to the
24156
<SPAN
24157
CLASS="application"
24158
>javac</SPAN
24159
> and <SPAN
24160
CLASS="application"
24161
>javah</SPAN
24162
> command lines
24163
via the <CODE
24164
CLASS="option"
24165
>-classpath</CODE
24166
> option.
24167
The individual directory names will be
24168
separated by the operating system's path separate character
24169
(<TT
24170
CLASS="filename"
24171
>:</TT
24172
> on UNIX/Linux/POSIX,
24173
<TT
24174
CLASS="filename"
24175
>;</TT
24176
> on Windows).</P
24177
><P
24178
>Note that this currently just adds the specified
24179
directory via the <CODE
24180
CLASS="option"
24181
>-classpath</CODE
24182
> option.
24183
<SPAN
24184
CLASS="application"
24185
>SCons</SPAN
24186
> does not currently search the
24187
<CODE
24188
CLASS="envar"
24189
>$JAVACLASSPATH</CODE
24190
> directories for dependency
24191
<TT
24192
CLASS="filename"
24193
>.class</TT
24194
> files.
24195
</P
24196
></DD
24197
><DT
24198
><A
24199
NAME="cv-JAVACLASSSUFFIX"
24200
></A
24201
><CODE
24202
CLASS="envar"
24203
>JAVACLASSSUFFIX</CODE
24204
></DT
24205
><DD
24206
><P
24207
>&#13;The suffix for Java class files;
24208
<TT
24209
CLASS="filename"
24210
>.class</TT
24211
>
24212
by default.
24213
</P
24214
></DD
24215
><DT
24216
><A
24217
NAME="cv-JAVAH"
24218
></A
24219
><CODE
24220
CLASS="envar"
24221
>JAVAH</CODE
24222
></DT
24223
><DD
24224
><P
24225
>&#13;The Java generator for C header and stub files.
24226
</P
24227
></DD
24228
><DT
24229
><A
24230
NAME="cv-JAVAHCOM"
24231
></A
24232
><CODE
24233
CLASS="envar"
24234
>JAVAHCOM</CODE
24235
></DT
24236
><DD
24237
><P
24238
>&#13;The command line used to generate C header and stub files
24239
from Java classes.
24240
Any options specified in the <A
24241
HREF="#cv-JAVAHFLAGS"
24242
><CODE
24243
CLASS="envar"
24244
>$JAVAHFLAGS</CODE
24245
></A
24246
> construction variable
24247
are included on this command line.
24248
</P
24249
></DD
24250
><DT
24251
><A
24252
NAME="cv-JAVAHCOMSTR"
24253
></A
24254
><CODE
24255
CLASS="envar"
24256
>JAVAHCOMSTR</CODE
24257
></DT
24258
><DD
24259
><P
24260
>&#13;The string displayed when C header and stub files
24261
are generated from Java classes.
24262
If this is not set, then <A
24263
HREF="#cv-JAVAHCOM"
24264
><CODE
24265
CLASS="envar"
24266
>$JAVAHCOM</CODE
24267
></A
24268
> (the command line) is displayed.
24269
</P
24270
><PRE
24271
CLASS="programlisting"
24272
>&#13;env = Environment(JAVAHCOMSTR = "Generating header/stub file(s) $TARGETS from $SOURCES")
24273
</PRE
24274
></DD
24275
><DT
24276
><A
24277
NAME="cv-JAVAHFLAGS"
24278
></A
24279
><CODE
24280
CLASS="envar"
24281
>JAVAHFLAGS</CODE
24282
></DT
24283
><DD
24284
><P
24285
>&#13;General options passed to the C header and stub file generator
24286
for Java classes.
24287
</P
24288
></DD
24289
><DT
24290
><A
24291
NAME="cv-JAVASOURCEPATH"
24292
></A
24293
><CODE
24294
CLASS="envar"
24295
>JAVASOURCEPATH</CODE
24296
></DT
24297
><DD
24298
><P
24299
>&#13;Specifies the list of directories that
24300
will be searched for input
24301
<TT
24302
CLASS="filename"
24303
>.java</TT
24304
> file.
24305
The directories in this list will be added to the
24306
<SPAN
24307
CLASS="application"
24308
>javac</SPAN
24309
> command line
24310
via the <CODE
24311
CLASS="option"
24312
>-sourcepath</CODE
24313
> option.
24314
The individual directory names will be
24315
separated by the operating system's path separate character
24316
(<TT
24317
CLASS="filename"
24318
>:</TT
24319
> on UNIX/Linux/POSIX,
24320
<TT
24321
CLASS="filename"
24322
>;</TT
24323
> on Windows).</P
24324
><P
24325
>Note that this currently just adds the specified
24326
directory via the <CODE
24327
CLASS="option"
24328
>-sourcepath</CODE
24329
> option.
24330
<SPAN
24331
CLASS="application"
24332
>SCons</SPAN
24333
> does not currently search the
24334
<CODE
24335
CLASS="envar"
24336
>$JAVASOURCEPATH</CODE
24337
> directories for dependency
24338
<TT
24339
CLASS="filename"
24340
>.java</TT
24341
> files.
24342
</P
24343
></DD
24344
><DT
24345
><A
24346
NAME="cv-JAVASUFFIX"
24347
></A
24348
><CODE
24349
CLASS="envar"
24350
>JAVASUFFIX</CODE
24351
></DT
24352
><DD
24353
><P
24354
>&#13;The suffix for Java files;
24355
<TT
24356
CLASS="filename"
24357
>.java</TT
24358
>
24359
by default.
24360
</P
24361
></DD
24362
><DT
24363
><A
24364
NAME="cv-JAVAVERSION"
24365
></A
24366
><CODE
24367
CLASS="envar"
24368
>JAVAVERSION</CODE
24369
></DT
24370
><DD
24371
><P
24372
>&#13;Specifies the Java version being used by the <CODE
24373
CLASS="function"
24374
>Java</CODE
24375
> builder.
24376
This is <SPAN
24377
CLASS="emphasis"
24378
><I
24379
CLASS="emphasis"
24380
>not</I
24381
></SPAN
24382
> currently used to select one
24383
version of the Java compiler vs. another.
24384
Instead, you should set this to specify the version of Java
24385
supported by your <SPAN
24386
CLASS="application"
24387
>javac</SPAN
24388
> compiler.
24389
The default is <TT
24390
CLASS="literal"
24391
>1.4</TT
24392
>.</P
24393
><P
24394
>This is sometimes necessary because
24395
Java 1.5 changed the file names that are created
24396
for nested anonymous inner classes,
24397
which can cause a mismatch with the files
24398
that <SPAN
24399
CLASS="application"
24400
>SCons</SPAN
24401
> expects will be generated by the <SPAN
24402
CLASS="application"
24403
>javac</SPAN
24404
> compiler.
24405
Setting <CODE
24406
CLASS="envar"
24407
>$JAVAVERSION</CODE
24408
> to <TT
24409
CLASS="literal"
24410
>1.5</TT
24411
>
24412
(or <TT
24413
CLASS="literal"
24414
>1.6</TT
24415
>, as appropriate)
24416
can make <SPAN
24417
CLASS="application"
24418
>SCons</SPAN
24419
> realize that a Java 1.5 or 1.6
24420
build is actually up to date.
24421
</P
24422
></DD
24423
><DT
24424
><A
24425
NAME="cv-LATEX"
24426
></A
24427
><CODE
24428
CLASS="envar"
24429
>LATEX</CODE
24430
></DT
24431
><DD
24432
><P
24433
>&#13;The LaTeX structured formatter and typesetter.
24434
</P
24435
></DD
24436
><DT
24437
><A
24438
NAME="cv-LATEXCOM"
24439
></A
24440
><CODE
24441
CLASS="envar"
24442
>LATEXCOM</CODE
24443
></DT
24444
><DD
24445
><P
24446
>&#13;The command line used to call the LaTeX structured formatter and typesetter.
24447
</P
24448
></DD
24449
><DT
24450
><A
24451
NAME="cv-LATEXCOMSTR"
24452
></A
24453
><CODE
24454
CLASS="envar"
24455
>LATEXCOMSTR</CODE
24456
></DT
24457
><DD
24458
><P
24459
>&#13;The string displayed when calling
24460
the LaTeX structured formatter and typesetter.
24461
If this is not set, then <A
24462
HREF="#cv-LATEXCOM"
24463
><CODE
24464
CLASS="envar"
24465
>$LATEXCOM</CODE
24466
></A
24467
> (the command line) is displayed.
24468
</P
24469
><PRE
24470
CLASS="programlisting"
24471
>&#13;env = Environment(LATEXCOMSTR = "Building $TARGET from LaTeX input $SOURCES")
24472
</PRE
24473
></DD
24474
><DT
24475
><A
24476
NAME="cv-LATEXFLAGS"
24477
></A
24478
><CODE
24479
CLASS="envar"
24480
>LATEXFLAGS</CODE
24481
></DT
24482
><DD
24483
><P
24484
>&#13;General options passed to the LaTeX structured formatter and typesetter.
24485
</P
24486
></DD
24487
><DT
24488
><A
24489
NAME="cv-LATEXRETRIES"
24490
></A
24491
><CODE
24492
CLASS="envar"
24493
>LATEXRETRIES</CODE
24494
></DT
24495
><DD
24496
><P
24497
>&#13;The maximum number of times that LaTeX
24498
will be re-run if the
24499
<TT
24500
CLASS="filename"
24501
>.log</TT
24502
>
24503
generated by the <A
24504
HREF="#cv-LATEXCOM"
24505
><CODE
24506
CLASS="envar"
24507
>$LATEXCOM</CODE
24508
></A
24509
> command
24510
indicates that there are undefined references.
24511
The default is to try to resolve undefined references
24512
by re-running LaTeX up to three times.
24513
</P
24514
></DD
24515
><DT
24516
><A
24517
NAME="cv-LATEXSUFFIXES"
24518
></A
24519
><CODE
24520
CLASS="envar"
24521
>LATEXSUFFIXES</CODE
24522
></DT
24523
><DD
24524
><P
24525
>&#13;The list of suffixes of files that will be scanned
24526
for LaTeX implicit dependencies
24527
(<TT
24528
CLASS="literal"
24529
>\include</TT
24530
> or <TT
24531
CLASS="literal"
24532
>\import</TT
24533
> files).
24534
The default list is:
24535
</P
24536
><PRE
24537
CLASS="programlisting"
24538
>&#13;[".tex", ".ltx", ".latex"]
24539
</PRE
24540
></DD
24541
><DT
24542
><A
24543
NAME="cv-LDMODULE"
24544
></A
24545
><CODE
24546
CLASS="envar"
24547
>LDMODULE</CODE
24548
></DT
24549
><DD
24550
><P
24551
>&#13;The linker for building loadable modules.
24552
By default, this is the same as <A
24553
HREF="#cv-SHLINK"
24554
><CODE
24555
CLASS="envar"
24556
>$SHLINK</CODE
24557
></A
24558
>.
24559
</P
24560
></DD
24561
><DT
24562
><A
24563
NAME="cv-LDMODULECOM"
24564
></A
24565
><CODE
24566
CLASS="envar"
24567
>LDMODULECOM</CODE
24568
></DT
24569
><DD
24570
><P
24571
>&#13;The command line for building loadable modules.
24572
On Mac OS X, this uses the <A
24573
HREF="#cv-LDMODULE"
24574
><CODE
24575
CLASS="envar"
24576
>$LDMODULE</CODE
24577
></A
24578
>,
24579
<A
24580
HREF="#cv-LDMODULEFLAGS"
24581
><CODE
24582
CLASS="envar"
24583
>$LDMODULEFLAGS</CODE
24584
></A
24585
> and
24586
<A
24587
HREF="#cv-FRAMEWORKSFLAGS"
24588
><CODE
24589
CLASS="envar"
24590
>$FRAMEWORKSFLAGS</CODE
24591
></A
24592
> variables.
24593
On other systems, this is the same as <A
24594
HREF="#cv-SHLINK"
24595
><CODE
24596
CLASS="envar"
24597
>$SHLINK</CODE
24598
></A
24599
>.
24600
</P
24601
></DD
24602
><DT
24603
><A
24604
NAME="cv-LDMODULECOMSTR"
24605
></A
24606
><CODE
24607
CLASS="envar"
24608
>LDMODULECOMSTR</CODE
24609
></DT
24610
><DD
24611
><P
24612
>&#13;The string displayed when building loadable modules.
24613
If this is not set, then <A
24614
HREF="#cv-LDMODULECOM"
24615
><CODE
24616
CLASS="envar"
24617
>$LDMODULECOM</CODE
24618
></A
24619
> (the command line) is displayed.
24620
</P
24621
></DD
24622
><DT
24623
><A
24624
NAME="cv-LDMODULEFLAGS"
24625
></A
24626
><CODE
24627
CLASS="envar"
24628
>LDMODULEFLAGS</CODE
24629
></DT
24630
><DD
24631
><P
24632
>&#13;General user options passed to the linker for building loadable modules.
24633
</P
24634
></DD
24635
><DT
24636
><A
24637
NAME="cv-LDMODULEPREFIX"
24638
></A
24639
><CODE
24640
CLASS="envar"
24641
>LDMODULEPREFIX</CODE
24642
></DT
24643
><DD
24644
><P
24645
>&#13;The prefix used for loadable module file names.
24646
On Mac OS X, this is null;
24647
on other systems, this is
24648
the same as <A
24649
HREF="#cv-SHLIBPREFIX"
24650
><CODE
24651
CLASS="envar"
24652
>$SHLIBPREFIX</CODE
24653
></A
24654
>.
24655
</P
24656
></DD
24657
><DT
24658
><A
24659
NAME="cv-LDMODULESUFFIX"
24660
></A
24661
><CODE
24662
CLASS="envar"
24663
>LDMODULESUFFIX</CODE
24664
></DT
24665
><DD
24666
><P
24667
>&#13;The suffix used for loadable module file names.
24668
On Mac OS X, this is null;
24669
on other systems, this is
24670
the same as $SHLIBSUFFIX.
24671
</P
24672
></DD
24673
><DT
24674
><A
24675
NAME="cv-LEX"
24676
></A
24677
><CODE
24678
CLASS="envar"
24679
>LEX</CODE
24680
></DT
24681
><DD
24682
><P
24683
>&#13;The lexical analyzer generator.
24684
</P
24685
></DD
24686
><DT
24687
><A
24688
NAME="cv-LEXCOM"
24689
></A
24690
><CODE
24691
CLASS="envar"
24692
>LEXCOM</CODE
24693
></DT
24694
><DD
24695
><P
24696
>&#13;The command line used to call the lexical analyzer generator
24697
to generate a source file.
24698
</P
24699
></DD
24700
><DT
24701
><A
24702
NAME="cv-LEXCOMSTR"
24703
></A
24704
><CODE
24705
CLASS="envar"
24706
>LEXCOMSTR</CODE
24707
></DT
24708
><DD
24709
><P
24710
>&#13;The string displayed when generating a source file
24711
using the lexical analyzer generator.
24712
If this is not set, then <A
24713
HREF="#cv-LEXCOM"
24714
><CODE
24715
CLASS="envar"
24716
>$LEXCOM</CODE
24717
></A
24718
> (the command line) is displayed.
24719
</P
24720
><PRE
24721
CLASS="programlisting"
24722
>&#13;env = Environment(LEXCOMSTR = "Lex'ing $TARGET from $SOURCES")
24723
</PRE
24724
></DD
24725
><DT
24726
><A
24727
NAME="cv-LEXFLAGS"
24728
></A
24729
><CODE
24730
CLASS="envar"
24731
>LEXFLAGS</CODE
24732
></DT
24733
><DD
24734
><P
24735
>&#13;General options passed to the lexical analyzer generator.
24736
</P
24737
></DD
24738
><DT
24739
><A
24740
NAME="cv-_LIBDIRFLAGS"
24741
></A
24742
><CODE
24743
CLASS="envar"
24744
>_LIBDIRFLAGS</CODE
24745
></DT
24746
><DD
24747
><P
24748
>&#13;An automatically-generated construction variable
24749
containing the linker command-line options
24750
for specifying directories to be searched for library.
24751
The value of <CODE
24752
CLASS="envar"
24753
>$_LIBDIRFLAGS</CODE
24754
> is created
24755
by appending <CODE
24756
CLASS="envar"
24757
>$LIBDIRPREFIX</CODE
24758
> and <CODE
24759
CLASS="envar"
24760
>$LIBDIRSUFFIX</CODE
24761
>
24762
to the beginning and end
24763
of each directory in <CODE
24764
CLASS="envar"
24765
>$LIBPATH</CODE
24766
>.
24767
</P
24768
></DD
24769
><DT
24770
><A
24771
NAME="cv-LIBDIRPREFIX"
24772
></A
24773
><CODE
24774
CLASS="envar"
24775
>LIBDIRPREFIX</CODE
24776
></DT
24777
><DD
24778
><P
24779
>&#13;The prefix used to specify a library directory on the linker command line.
24780
This will be appended to the beginning of each directory
24781
in the <CODE
24782
CLASS="envar"
24783
>$LIBPATH</CODE
24784
> construction variable
24785
when the <CODE
24786
CLASS="envar"
24787
>$_LIBDIRFLAGS</CODE
24788
> variable is automatically generated.
24789
</P
24790
></DD
24791
><DT
24792
><A
24793
NAME="cv-LIBDIRSUFFIX"
24794
></A
24795
><CODE
24796
CLASS="envar"
24797
>LIBDIRSUFFIX</CODE
24798
></DT
24799
><DD
24800
><P
24801
>&#13;The suffix used to specify a library directory on the linker command line.
24802
This will be appended to the end of each directory
24803
in the <CODE
24804
CLASS="envar"
24805
>$LIBPATH</CODE
24806
> construction variable
24807
when the <CODE
24808
CLASS="envar"
24809
>$_LIBDIRFLAGS</CODE
24810
> variable is automatically generated.
24811
</P
24812
></DD
24813
><DT
24814
><A
24815
NAME="cv-_LIBFLAGS"
24816
></A
24817
><CODE
24818
CLASS="envar"
24819
>_LIBFLAGS</CODE
24820
></DT
24821
><DD
24822
><P
24823
>&#13;An automatically-generated construction variable
24824
containing the linker command-line options
24825
for specifying libraries to be linked with the resulting target.
24826
The value of <CODE
24827
CLASS="envar"
24828
>$_LIBFLAGS</CODE
24829
> is created
24830
by appending <CODE
24831
CLASS="envar"
24832
>$LIBLINKPREFIX</CODE
24833
> and <CODE
24834
CLASS="envar"
24835
>$LIBLINKSUFFIX</CODE
24836
>
24837
to the beginning and end
24838
of each filename in <CODE
24839
CLASS="envar"
24840
>$LIBS</CODE
24841
>.
24842
</P
24843
></DD
24844
><DT
24845
><A
24846
NAME="cv-LIBLINKPREFIX"
24847
></A
24848
><CODE
24849
CLASS="envar"
24850
>LIBLINKPREFIX</CODE
24851
></DT
24852
><DD
24853
><P
24854
>&#13;The prefix used to specify a library to link on the linker command line.
24855
This will be appended to the beginning of each library
24856
in the <CODE
24857
CLASS="envar"
24858
>$LIBS</CODE
24859
> construction variable
24860
when the <CODE
24861
CLASS="envar"
24862
>$_LIBFLAGS</CODE
24863
> variable is automatically generated.
24864
</P
24865
></DD
24866
><DT
24867
><A
24868
NAME="cv-LIBLINKSUFFIX"
24869
></A
24870
><CODE
24871
CLASS="envar"
24872
>LIBLINKSUFFIX</CODE
24873
></DT
24874
><DD
24875
><P
24876
>&#13;The suffix used to specify a library to link on the linker command line.
24877
This will be appended to the end of each library
24878
in the <CODE
24879
CLASS="envar"
24880
>$LIBS</CODE
24881
> construction variable
24882
when the <CODE
24883
CLASS="envar"
24884
>$_LIBFLAGS</CODE
24885
> variable is automatically generated.
24886
</P
24887
></DD
24888
><DT
24889
><A
24890
NAME="cv-LIBPATH"
24891
></A
24892
><CODE
24893
CLASS="envar"
24894
>LIBPATH</CODE
24895
></DT
24896
><DD
24897
><P
24898
>&#13;The list of directories that will be searched for libraries.
24899
The implicit dependency scanner will search these
24900
directories for include files. Don't explicitly put include directory
24901
arguments in <CODE
24902
CLASS="envar"
24903
>$LINKFLAGS</CODE
24904
> or <CODE
24905
CLASS="envar"
24906
>$SHLINKFLAGS</CODE
24907
>
24908
because the result will be non-portable
24909
and the directories will not be searched by the dependency scanner. Note:
24910
directory names in LIBPATH will be looked-up relative to the SConscript
24911
directory when they are used in a command. To force
24912
<SPAN
24913
CLASS="application"
24914
>scons</SPAN
24915
>
24916
to look-up a directory relative to the root of the source tree use #:
24917
</P
24918
><PRE
24919
CLASS="programlisting"
24920
>&#13;env = Environment(LIBPATH='#/libs')
24921
</PRE
24922
><P
24923
>&#13;The directory look-up can also be forced using the
24924
<CODE
24925
CLASS="function"
24926
>Dir</CODE
24927
>()
24928
function:
24929
</P
24930
><PRE
24931
CLASS="programlisting"
24932
>&#13;libs = Dir('libs')
24933
env = Environment(LIBPATH=libs)
24934
</PRE
24935
><P
24936
>&#13;The directory list will be added to command lines
24937
through the automatically-generated
24938
<CODE
24939
CLASS="envar"
24940
>$_LIBDIRFLAGS</CODE
24941
>
24942
construction variable,
24943
which is constructed by
24944
appending the values of the
24945
<CODE
24946
CLASS="envar"
24947
>$LIBDIRPREFIX</CODE
24948
> and <CODE
24949
CLASS="envar"
24950
>$LIBDIRSUFFIX</CODE
24951
>
24952
construction variables
24953
to the beginning and end
24954
of each directory in <CODE
24955
CLASS="envar"
24956
>$LIBPATH</CODE
24957
>.
24958
Any command lines you define that need
24959
the LIBPATH directory list should
24960
include <CODE
24961
CLASS="envar"
24962
>$_LIBDIRFLAGS</CODE
24963
>:
24964
</P
24965
><PRE
24966
CLASS="programlisting"
24967
>&#13;env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE")
24968
</PRE
24969
></DD
24970
><DT
24971
><A
24972
NAME="cv-LIBPREFIX"
24973
></A
24974
><CODE
24975
CLASS="envar"
24976
>LIBPREFIX</CODE
24977
></DT
24978
><DD
24979
><P
24980
>&#13;The prefix used for (static) library file names.
24981
A default value is set for each platform
24982
(posix, win32, os2, etc.),
24983
but the value is overridden by individual tools
24984
(ar, mslib, sgiar, sunar, tlib, etc.)
24985
to reflect the names of the libraries they create.
24986
</P
24987
></DD
24988
><DT
24989
><A
24990
NAME="cv-LIBPREFIXES"
24991
></A
24992
><CODE
24993
CLASS="envar"
24994
>LIBPREFIXES</CODE
24995
></DT
24996
><DD
24997
><P
24998
>&#13;A list of all legal prefixes for library file names.
24999
When searching for library dependencies,
25000
SCons will look for files with these prefixes,
25001
the base library name,
25002
and suffixes in the <CODE
25003
CLASS="envar"
25004
>$LIBSUFFIXES</CODE
25005
> list.
25006
</P
25007
></DD
25008
><DT
25009
><A
25010
NAME="cv-LIBS"
25011
></A
25012
><CODE
25013
CLASS="envar"
25014
>LIBS</CODE
25015
></DT
25016
><DD
25017
><P
25018
>&#13;A list of one or more libraries
25019
that will be linked with
25020
any executable programs
25021
created by this environment.</P
25022
><P
25023
>The library list will be added to command lines
25024
through the automatically-generated
25025
<CODE
25026
CLASS="envar"
25027
>$_LIBFLAGS</CODE
25028
>
25029
construction variable,
25030
which is constructed by
25031
appending the values of the
25032
<CODE
25033
CLASS="envar"
25034
>$LIBLINKPREFIX</CODE
25035
> and <CODE
25036
CLASS="envar"
25037
>$LIBLINKSUFFIX</CODE
25038
>
25039
construction variables
25040
to the beginning and end
25041
of each filename in <CODE
25042
CLASS="envar"
25043
>$LIBS</CODE
25044
>.
25045
Any command lines you define that need
25046
the LIBS library list should
25047
include <CODE
25048
CLASS="envar"
25049
>$_LIBFLAGS</CODE
25050
>:
25051
</P
25052
><PRE
25053
CLASS="programlisting"
25054
>&#13;env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE")
25055
</PRE
25056
><P
25057
>&#13;If you add a
25058
File
25059
object to the
25060
<CODE
25061
CLASS="envar"
25062
>$LIBS</CODE
25063
>
25064
list, the name of that file will be added to
25065
<CODE
25066
CLASS="envar"
25067
>$_LIBFLAGS</CODE
25068
>,
25069
and thus the link line, as is, without
25070
<CODE
25071
CLASS="envar"
25072
>$LIBLINKPREFIX</CODE
25073
>
25074
or
25075
<CODE
25076
CLASS="envar"
25077
>$LIBLINKSUFFIX</CODE
25078
>.
25079
For example:
25080
</P
25081
><PRE
25082
CLASS="programlisting"
25083
>&#13;env.Append(LIBS=File('/tmp/mylib.so'))
25084
</PRE
25085
><P
25086
>&#13;In all cases, scons will add dependencies from the executable program to
25087
all the libraries in this list.
25088
</P
25089
></DD
25090
><DT
25091
><A
25092
NAME="cv-LIBSUFFIX"
25093
></A
25094
><CODE
25095
CLASS="envar"
25096
>LIBSUFFIX</CODE
25097
></DT
25098
><DD
25099
><P
25100
>&#13;The suffix used for (static) library file names.
25101
A default value is set for each platform
25102
(posix, win32, os2, etc.),
25103
but the value is overridden by individual tools
25104
(ar, mslib, sgiar, sunar, tlib, etc.)
25105
to reflect the names of the libraries they create.
25106
</P
25107
></DD
25108
><DT
25109
><A
25110
NAME="cv-LIBSUFFIXES"
25111
></A
25112
><CODE
25113
CLASS="envar"
25114
>LIBSUFFIXES</CODE
25115
></DT
25116
><DD
25117
><P
25118
>&#13;A list of all legal suffixes for library file names.
25119
When searching for library dependencies,
25120
SCons will look for files with prefixes, in the <CODE
25121
CLASS="envar"
25122
>$LIBPREFIXES</CODE
25123
> list,
25124
the base library name,
25125
and these suffixes.
25126
</P
25127
></DD
25128
><DT
25129
><A
25130
NAME="cv-LICENSE"
25131
></A
25132
><CODE
25133
CLASS="envar"
25134
>LICENSE</CODE
25135
></DT
25136
><DD
25137
><P
25138
>&#13;The abbreviated name of the license under which
25139
this project is released (gpl, lpgl, bsd etc.).
25140
See http://www.opensource.org/licenses/alphabetical
25141
for a list of license names.
25142
</P
25143
></DD
25144
><DT
25145
><A
25146
NAME="cv-LINK"
25147
></A
25148
><CODE
25149
CLASS="envar"
25150
>LINK</CODE
25151
></DT
25152
><DD
25153
><P
25154
>&#13;The linker.
25155
</P
25156
></DD
25157
><DT
25158
><A
25159
NAME="cv-LINKCOM"
25160
></A
25161
><CODE
25162
CLASS="envar"
25163
>LINKCOM</CODE
25164
></DT
25165
><DD
25166
><P
25167
>&#13;The command line used to link object files into an executable.
25168
</P
25169
></DD
25170
><DT
25171
><A
25172
NAME="cv-LINKCOMSTR"
25173
></A
25174
><CODE
25175
CLASS="envar"
25176
>LINKCOMSTR</CODE
25177
></DT
25178
><DD
25179
><P
25180
>&#13;The string displayed when object files
25181
are linked into an executable.
25182
If this is not set, then <A
25183
HREF="#cv-LINKCOM"
25184
><CODE
25185
CLASS="envar"
25186
>$LINKCOM</CODE
25187
></A
25188
> (the command line) is displayed.
25189
</P
25190
><PRE
25191
CLASS="programlisting"
25192
>&#13;env = Environment(LINKCOMSTR = "Linking $TARGET")
25193
</PRE
25194
></DD
25195
><DT
25196
><A
25197
NAME="cv-LINKFLAGS"
25198
></A
25199
><CODE
25200
CLASS="envar"
25201
>LINKFLAGS</CODE
25202
></DT
25203
><DD
25204
><P
25205
>&#13;General user options passed to the linker.
25206
Note that this variable should
25207
<SPAN
25208
CLASS="emphasis"
25209
><I
25210
CLASS="emphasis"
25211
>not</I
25212
></SPAN
25213
>
25214
contain
25215
<CODE
25216
CLASS="option"
25217
>-l</CODE
25218
>
25219
(or similar) options for linking with the libraries listed in <A
25220
HREF="#cv-LIBS"
25221
><CODE
25222
CLASS="envar"
25223
>$LIBS</CODE
25224
></A
25225
>,
25226
nor
25227
<CODE
25228
CLASS="option"
25229
>-L</CODE
25230
>
25231
(or similar) library search path options
25232
that scons generates automatically from <A
25233
HREF="#cv-LIBPATH"
25234
><CODE
25235
CLASS="envar"
25236
>$LIBPATH</CODE
25237
></A
25238
>.
25239
See
25240
<A
25241
HREF="#cv-_LIBFLAGS"
25242
><CODE
25243
CLASS="envar"
25244
>$_LIBFLAGS</CODE
25245
></A
25246
>
25247
above,
25248
for the variable that expands to library-link options,
25249
and
25250
<A
25251
HREF="#cv-_LIBDIRFLAGS"
25252
><CODE
25253
CLASS="envar"
25254
>$_LIBDIRFLAGS</CODE
25255
></A
25256
>
25257
above,
25258
for the variable that expands to library search path options.
25259
</P
25260
></DD
25261
><DT
25262
><A
25263
NAME="cv-M4"
25264
></A
25265
><CODE
25266
CLASS="envar"
25267
>M4</CODE
25268
></DT
25269
><DD
25270
><P
25271
>&#13;The M4 macro preprocessor.
25272
</P
25273
></DD
25274
><DT
25275
><A
25276
NAME="cv-M4COM"
25277
></A
25278
><CODE
25279
CLASS="envar"
25280
>M4COM</CODE
25281
></DT
25282
><DD
25283
><P
25284
>&#13;The command line used to pass files through the M4 macro preprocessor.
25285
</P
25286
></DD
25287
><DT
25288
><A
25289
NAME="cv-M4COMSTR"
25290
></A
25291
><CODE
25292
CLASS="envar"
25293
>M4COMSTR</CODE
25294
></DT
25295
><DD
25296
><P
25297
>&#13;The string displayed when
25298
a file is passed through the M4 macro preprocessor.
25299
If this is not set, then <A
25300
HREF="#cv-M4COM"
25301
><CODE
25302
CLASS="envar"
25303
>$M4COM</CODE
25304
></A
25305
> (the command line) is displayed.
25306
</P
25307
></DD
25308
><DT
25309
><A
25310
NAME="cv-M4FLAGS"
25311
></A
25312
><CODE
25313
CLASS="envar"
25314
>M4FLAGS</CODE
25315
></DT
25316
><DD
25317
><P
25318
>&#13;General options passed to the M4 macro preprocessor.
25319
</P
25320
></DD
25321
><DT
25322
><A
25323
NAME="cv-MAKEINDEX"
25324
></A
25325
><CODE
25326
CLASS="envar"
25327
>MAKEINDEX</CODE
25328
></DT
25329
><DD
25330
><P
25331
>&#13;The makeindex generator for the TeX formatter and typesetter and the
25332
LaTeX structured formatter and typesetter.
25333
</P
25334
></DD
25335
><DT
25336
><A
25337
NAME="cv-MAKEINDEXCOM"
25338
></A
25339
><CODE
25340
CLASS="envar"
25341
>MAKEINDEXCOM</CODE
25342
></DT
25343
><DD
25344
><P
25345
>&#13;The command line used to call the makeindex generator for the
25346
TeX formatter and typesetter and the LaTeX structured formatter and
25347
typesetter.
25348
</P
25349
></DD
25350
><DT
25351
><A
25352
NAME="cv-MAKEINDEXCOMSTR"
25353
></A
25354
><CODE
25355
CLASS="envar"
25356
>MAKEINDEXCOMSTR</CODE
25357
></DT
25358
><DD
25359
><P
25360
>&#13;The string displayed when calling the makeindex generator for the
25361
TeX formatter and typesetter
25362
and the LaTeX structured formatter and typesetter.
25363
If this is not set, then <A
25364
HREF="#cv-MAKEINDEXCOM"
25365
><CODE
25366
CLASS="envar"
25367
>$MAKEINDEXCOM</CODE
25368
></A
25369
> (the command line) is displayed.
25370
</P
25371
></DD
25372
><DT
25373
><A
25374
NAME="cv-MAKEINDEXFLAGS"
25375
></A
25376
><CODE
25377
CLASS="envar"
25378
>MAKEINDEXFLAGS</CODE
25379
></DT
25380
><DD
25381
><P
25382
>&#13;General options passed to the makeindex generator for the TeX formatter
25383
and typesetter and the LaTeX structured formatter and typesetter.
25384
</P
25385
></DD
25386
><DT
25387
><A
25388
NAME="cv-MAXLINELENGTH"
25389
></A
25390
><CODE
25391
CLASS="envar"
25392
>MAXLINELENGTH</CODE
25393
></DT
25394
><DD
25395
><P
25396
>&#13;The maximum number of characters allowed on an external command line.
25397
On Win32 systems,
25398
link lines longer than this many characters
25399
are linked via a temporary file name.
25400
</P
25401
></DD
25402
><DT
25403
><A
25404
NAME="cv-MIDL"
25405
></A
25406
><CODE
25407
CLASS="envar"
25408
>MIDL</CODE
25409
></DT
25410
><DD
25411
><P
25412
>&#13;The Microsoft IDL compiler.
25413
</P
25414
></DD
25415
><DT
25416
><A
25417
NAME="cv-MIDLCOM"
25418
></A
25419
><CODE
25420
CLASS="envar"
25421
>MIDLCOM</CODE
25422
></DT
25423
><DD
25424
><P
25425
>&#13;The command line used to pass files to the Microsoft IDL compiler.
25426
</P
25427
></DD
25428
><DT
25429
><A
25430
NAME="cv-MIDLCOMSTR"
25431
></A
25432
><CODE
25433
CLASS="envar"
25434
>MIDLCOMSTR</CODE
25435
></DT
25436
><DD
25437
><P
25438
>&#13;The string displayed when
25439
the Microsoft IDL copmiler is called.
25440
If this is not set, then <A
25441
HREF="#cv-MIDLCOM"
25442
><CODE
25443
CLASS="envar"
25444
>$MIDLCOM</CODE
25445
></A
25446
> (the command line) is displayed.
25447
</P
25448
></DD
25449
><DT
25450
><A
25451
NAME="cv-MIDLFLAGS"
25452
></A
25453
><CODE
25454
CLASS="envar"
25455
>MIDLFLAGS</CODE
25456
></DT
25457
><DD
25458
><P
25459
>&#13;General options passed to the Microsoft IDL compiler.
25460
</P
25461
></DD
25462
><DT
25463
><A
25464
NAME="cv-MSVS"
25465
></A
25466
><CODE
25467
CLASS="envar"
25468
>MSVS</CODE
25469
></DT
25470
><DD
25471
><P
25472
>&#13;When the Microsoft Visual Studio tools are initialized, they set up
25473
this dictionary with the following keys:</P
25474
><P
25475
><CODE
25476
CLASS="envar"
25477
>VERSION</CODE
25478
>:
25479
the version of MSVS being used (can be set via
25480
MSVS_VERSION)</P
25481
><P
25482
><CODE
25483
CLASS="envar"
25484
>VERSIONS</CODE
25485
>:
25486
the available versions of MSVS installed</P
25487
><P
25488
><CODE
25489
CLASS="envar"
25490
>VCINSTALLDIR</CODE
25491
>:
25492
installed directory of Visual C++</P
25493
><P
25494
><CODE
25495
CLASS="envar"
25496
>VSINSTALLDIR</CODE
25497
>:
25498
installed directory of Visual Studio</P
25499
><P
25500
><CODE
25501
CLASS="envar"
25502
>FRAMEWORKDIR</CODE
25503
>:
25504
installed directory of the .NET framework</P
25505
><P
25506
><CODE
25507
CLASS="envar"
25508
>FRAMEWORKVERSIONS</CODE
25509
>:
25510
list of installed versions of the .NET framework, sorted latest to oldest.</P
25511
><P
25512
><CODE
25513
CLASS="envar"
25514
>FRAMEWORKVERSION</CODE
25515
>:
25516
latest installed version of the .NET framework</P
25517
><P
25518
><CODE
25519
CLASS="envar"
25520
>FRAMEWORKSDKDIR</CODE
25521
>:
25522
installed location of the .NET SDK.</P
25523
><P
25524
><CODE
25525
CLASS="envar"
25526
>PLATFORMSDKDIR</CODE
25527
>:
25528
installed location of the Platform SDK.</P
25529
><P
25530
><CODE
25531
CLASS="envar"
25532
>PLATFORMSDK_MODULES</CODE
25533
>:
25534
dictionary of installed Platform SDK modules,
25535
where the dictionary keys are keywords for the various modules, and
25536
the values are 2-tuples where the first is the release date, and the
25537
second is the version number.</P
25538
><P
25539
>If a value isn't set, it wasn't available in the registry.
25540
</P
25541
></DD
25542
><DT
25543
><A
25544
NAME="cv-MSVS_IGNORE_IDE_PATHS"
25545
></A
25546
><CODE
25547
CLASS="envar"
25548
>MSVS_IGNORE_IDE_PATHS</CODE
25549
></DT
25550
><DD
25551
><P
25552
>&#13;Tells the MS Visual Studio tools to use minimal INCLUDE, LIB, and PATH settings,
25553
instead of the settings from the IDE.</P
25554
><P
25555
>For Visual Studio, SCons will (by default) automatically determine
25556
where MSVS is installed, and use the LIB, INCLUDE, and PATH variables
25557
set by the IDE.  You can override this behavior by setting these
25558
variables after Environment initialization, or by setting
25559
<CODE
25560
CLASS="envar"
25561
>MSVS_IGNORE_IDE_PATHS = 1</CODE
25562
>
25563
in the Environment initialization.
25564
Specifying this will not leave these unset, but will set them to a
25565
minimal set of paths needed to run the tools successfully.</P
25566
><P
25567
>For VS6, the mininimal set is:
25568
</P
25569
><PRE
25570
CLASS="programlisting"
25571
>&#13;   INCLUDE:'&#60;VSDir&#62;\VC98\ATL\include;&#60;VSDir&#62;\VC98\MFC\include;&#60;VSDir&#62;\VC98\include'
25572
   LIB:'&#60;VSDir&#62;\VC98\MFC\lib;&#60;VSDir&#62;\VC98\lib'
25573
   PATH:'&#60;VSDir&#62;\Common\MSDev98\bin;&#60;VSDir&#62;\VC98\bin'
25574
</PRE
25575
><P
25576
>&#13;For VS7, it is:
25577
</P
25578
><PRE
25579
CLASS="programlisting"
25580
>&#13;   INCLUDE:'&#60;VSDir&#62;\Vc7\atlmfc\include;&#60;VSDir&#62;\Vc7\include'
25581
   LIB:'&#60;VSDir&#62;\Vc7\atlmfc\lib;&#60;VSDir&#62;\Vc7\lib'
25582
   PATH:'&#60;VSDir&#62;\Common7\Tools\bin;&#60;VSDir&#62;\Common7\Tools;&#60;VSDir&#62;\Vc7\bin'
25583
</PRE
25584
><P
25585
>&#13;Where '&#60;VSDir&#62;' is the installed location of Visual Studio.
25586
</P
25587
></DD
25588
><DT
25589
><A
25590
NAME="cv-MSVS_PROJECT_BASE_PATH"
25591
></A
25592
><CODE
25593
CLASS="envar"
25594
>MSVS_PROJECT_BASE_PATH</CODE
25595
></DT
25596
><DD
25597
><P
25598
>&#13;The string
25599
placed in a generated Microsoft Visual Studio solution file
25600
as the value of the
25601
<TT
25602
CLASS="literal"
25603
>SccProjectFilePathRelativizedFromConnection0</TT
25604
>
25605
and
25606
<TT
25607
CLASS="literal"
25608
>SccProjectFilePathRelativizedFromConnection1</TT
25609
>
25610
attributes of the
25611
<TT
25612
CLASS="literal"
25613
>GlobalSection(SourceCodeControl)</TT
25614
>
25615
section.
25616
There is no default value.
25617
</P
25618
></DD
25619
><DT
25620
><A
25621
NAME="cv-MSVS_PROJECT_GUID"
25622
></A
25623
><CODE
25624
CLASS="envar"
25625
>MSVS_PROJECT_GUID</CODE
25626
></DT
25627
><DD
25628
><P
25629
>&#13;The string
25630
placed in a generated Microsoft Visual Studio project file
25631
as the value of the
25632
<TT
25633
CLASS="literal"
25634
>ProjectGUID</TT
25635
>
25636
attribute.
25637
The string is also placed in the
25638
<TT
25639
CLASS="literal"
25640
>SolutionUniqueID</TT
25641
>
25642
attribute of the
25643
<TT
25644
CLASS="literal"
25645
>GlobalSection(SourceCodeControl)</TT
25646
>
25647
section of the Microsoft Visual Studio solution file.
25648
There is no default value.
25649
</P
25650
></DD
25651
><DT
25652
><A
25653
NAME="cv-MSVS_SCC_AUX_PATH"
25654
></A
25655
><CODE
25656
CLASS="envar"
25657
>MSVS_SCC_AUX_PATH</CODE
25658
></DT
25659
><DD
25660
><P
25661
>&#13;The path name
25662
placed in a generated Microsoft Visual Studio project file
25663
as the value of the
25664
<TT
25665
CLASS="literal"
25666
>SccAuxPath</TT
25667
>
25668
attribute
25669
if the
25670
<CODE
25671
CLASS="envar"
25672
>MSVS_SCC_PROVIDER</CODE
25673
>
25674
construction variable is also set.
25675
There is no default value.
25676
</P
25677
></DD
25678
><DT
25679
><A
25680
NAME="cv-MSVS_SCC_LOCAL_PATH"
25681
></A
25682
><CODE
25683
CLASS="envar"
25684
>MSVS_SCC_LOCAL_PATH</CODE
25685
></DT
25686
><DD
25687
><P
25688
>&#13;The path name
25689
placed in a generated Microsoft Visual Studio project file
25690
as the value of the
25691
<TT
25692
CLASS="literal"
25693
>SccLocalPath</TT
25694
>
25695
attribute
25696
if the
25697
<CODE
25698
CLASS="envar"
25699
>MSVS_SCC_PROVIDER</CODE
25700
>
25701
construction variable is also set.
25702
The path name is also placed in the
25703
<TT
25704
CLASS="literal"
25705
>SccLocalPath0</TT
25706
>
25707
and
25708
<TT
25709
CLASS="literal"
25710
>SccLocalPath1</TT
25711
>
25712
attributes of the
25713
<TT
25714
CLASS="literal"
25715
>GlobalSection(SourceCodeControl)</TT
25716
>
25717
section of the Microsoft Visual Studio solution file.
25718
There is no default value.
25719
</P
25720
></DD
25721
><DT
25722
><A
25723
NAME="cv-MSVS_SCC_PROJECT_NAME"
25724
></A
25725
><CODE
25726
CLASS="envar"
25727
>MSVS_SCC_PROJECT_NAME</CODE
25728
></DT
25729
><DD
25730
><P
25731
>&#13;The project name
25732
placed in a generated Microsoft Visual Studio project file
25733
as the value of the
25734
<TT
25735
CLASS="literal"
25736
>SccProjectName</TT
25737
>
25738
attribute.
25739
There is no default value.
25740
</P
25741
></DD
25742
><DT
25743
><A
25744
NAME="cv-MSVS_SCC_PROVIDER"
25745
></A
25746
><CODE
25747
CLASS="envar"
25748
>MSVS_SCC_PROVIDER</CODE
25749
></DT
25750
><DD
25751
><P
25752
>&#13;The string
25753
placed in a generated Microsoft Visual Studio project file
25754
as the value of the
25755
<TT
25756
CLASS="literal"
25757
>SccProvider</TT
25758
>
25759
attribute.
25760
The string is also placed in the
25761
<TT
25762
CLASS="literal"
25763
>SccProvider1</TT
25764
>
25765
attribute of the
25766
<TT
25767
CLASS="literal"
25768
>GlobalSection(SourceCodeControl)</TT
25769
>
25770
section of the Microsoft Visual Studio solution file.
25771
There is no default value.
25772
</P
25773
></DD
25774
><DT
25775
><A
25776
NAME="cv-MSVS_USE_MFC_DIRS"
25777
></A
25778
><CODE
25779
CLASS="envar"
25780
>MSVS_USE_MFC_DIRS</CODE
25781
></DT
25782
><DD
25783
><P
25784
>&#13;Tells the MS Visual Studio tool(s) to use
25785
the MFC directories in its default paths
25786
for compiling and linking.
25787
The <CODE
25788
CLASS="envar"
25789
>$MSVS_USE_MFC_DIRS</CODE
25790
> variable has no effect if the
25791
<CODE
25792
CLASS="envar"
25793
>INCLUDE</CODE
25794
>
25795
or
25796
<CODE
25797
CLASS="envar"
25798
>LIB</CODE
25799
>
25800
environment variables are set explictly.</P
25801
><P
25802
>Under Visual Studio version 6,
25803
setting
25804
<CODE
25805
CLASS="envar"
25806
>$MSVS_USE_MFC_DIRS</CODE
25807
>
25808
to a non-zero value
25809
adds the
25810
<TT
25811
CLASS="filename"
25812
>ATL\include</TT
25813
>
25814
and
25815
<TT
25816
CLASS="filename"
25817
>MFC\include</TT
25818
>
25819
directories to
25820
the default
25821
<CODE
25822
CLASS="envar"
25823
>INCLUDE</CODE
25824
>
25825
external environment variable,
25826
and adds the
25827
<TT
25828
CLASS="filename"
25829
>MFC\lib</TT
25830
>
25831
directory to
25832
the default
25833
<CODE
25834
CLASS="envar"
25835
>LIB</CODE
25836
>
25837
external environment variable.</P
25838
><P
25839
>Under Visual Studio version 7,
25840
setting
25841
<CODE
25842
CLASS="envar"
25843
>$MSVS_USE_MFC_DIRS</CODE
25844
>
25845
to a non-zero value
25846
adds the
25847
<TT
25848
CLASS="filename"
25849
>atlmfc\include</TT
25850
>
25851
directory to the default
25852
<CODE
25853
CLASS="envar"
25854
>INCLUDE</CODE
25855
>
25856
external environment variable,
25857
and adds the
25858
<TT
25859
CLASS="filename"
25860
>atlmfc\lib</TT
25861
>
25862
directory to the default
25863
<CODE
25864
CLASS="envar"
25865
>LIB</CODE
25866
>
25867
external environment variable.</P
25868
><P
25869
>Under Visual Studio version 8,
25870
setting
25871
<CODE
25872
CLASS="envar"
25873
>$MSVS_USE_MFC_DIRS</CODE
25874
>
25875
to a non-zero value will,
25876
by default,
25877
add the
25878
<TT
25879
CLASS="filename"
25880
>atlmfc\include</TT
25881
>
25882
directory to the default
25883
<CODE
25884
CLASS="envar"
25885
>INCLUDE</CODE
25886
>
25887
external environment variable,
25888
and the
25889
<TT
25890
CLASS="filename"
25891
>atlmfc\lib</TT
25892
>
25893
directory to the default
25894
<CODE
25895
CLASS="envar"
25896
>LIB</CODE
25897
>
25898
external environment variable.
25899
If, however, the
25900
<CODE
25901
CLASS="envar"
25902
>['MSVS']['PLATFORMSDKDIR']</CODE
25903
>
25904
variable is set,
25905
then the
25906
<TT
25907
CLASS="filename"
25908
>mfc</TT
25909
>
25910
and the
25911
<TT
25912
CLASS="filename"
25913
>atl</TT
25914
>
25915
subdirectories of the
25916
<CODE
25917
CLASS="envar"
25918
>PLATFORMSDKDIR</CODE
25919
>
25920
are added to the default value of the
25921
<CODE
25922
CLASS="envar"
25923
>INCLUDE</CODE
25924
>
25925
external environment variable,
25926
and the default value of the
25927
<CODE
25928
CLASS="envar"
25929
>LIB</CODE
25930
>
25931
external environment variable is left untouched.
25932
</P
25933
></DD
25934
><DT
25935
><A
25936
NAME="cv-MSVS_VERSION"
25937
></A
25938
><CODE
25939
CLASS="envar"
25940
>MSVS_VERSION</CODE
25941
></DT
25942
><DD
25943
><P
25944
>&#13;Sets the preferred version of MSVS to use.</P
25945
><P
25946
>SCons will (by default) select the latest version of MSVS
25947
installed on your machine.
25948
So, if you have version 6 and version 7 (MSVS .NET) installed,
25949
it will prefer version 7.
25950
You can override this by
25951
specifying the
25952
<CODE
25953
CLASS="envar"
25954
>MSVS_VERSION</CODE
25955
>
25956
variable in the Environment initialization, setting it to the
25957
appropriate version ('6.0' or '7.0', for example).
25958
If the given version isn't installed, tool initialization will fail.
25959
</P
25960
></DD
25961
><DT
25962
><A
25963
NAME="cv-MSVSBUILDCOM"
25964
></A
25965
><CODE
25966
CLASS="envar"
25967
>MSVSBUILDCOM</CODE
25968
></DT
25969
><DD
25970
><P
25971
>&#13;The build command line placed in
25972
a generated Microsoft Visual Studio project file.
25973
The default is to have Visual Studio invoke SCons with any specified
25974
build targets.
25975
</P
25976
></DD
25977
><DT
25978
><A
25979
NAME="cv-MSVSCLEANCOM"
25980
></A
25981
><CODE
25982
CLASS="envar"
25983
>MSVSCLEANCOM</CODE
25984
></DT
25985
><DD
25986
><P
25987
>&#13;The clean command line placed in
25988
a generated Microsoft Visual Studio project file.
25989
The default is to have Visual Studio invoke SCons with the -c option
25990
to remove any specified targets.
25991
</P
25992
></DD
25993
><DT
25994
><A
25995
NAME="cv-MSVSENCODING"
25996
></A
25997
><CODE
25998
CLASS="envar"
25999
>MSVSENCODING</CODE
26000
></DT
26001
><DD
26002
><P
26003
>&#13;The encoding string placed in
26004
a generated Microsoft Visual Studio project file.
26005
The default is encoding
26006
<TT
26007
CLASS="literal"
26008
>Windows-1252</TT
26009
>.
26010
</P
26011
></DD
26012
><DT
26013
><A
26014
NAME="cv-MSVSPROJECTCOM"
26015
></A
26016
><CODE
26017
CLASS="envar"
26018
>MSVSPROJECTCOM</CODE
26019
></DT
26020
><DD
26021
><P
26022
>&#13;The action used to generate Microsoft Visual Studio project files.
26023
</P
26024
></DD
26025
><DT
26026
><A
26027
NAME="cv-MSVSPROJECTSUFFIX"
26028
></A
26029
><CODE
26030
CLASS="envar"
26031
>MSVSPROJECTSUFFIX</CODE
26032
></DT
26033
><DD
26034
><P
26035
>&#13;The suffix used for Microsoft Visual Studio project (DSP) files.
26036
The default value is
26037
<TT
26038
CLASS="filename"
26039
>.vcproj</TT
26040
>
26041
when using Visual Studio version 7.x (.NET)
26042
or later version,
26043
and
26044
<TT
26045
CLASS="filename"
26046
>.dsp</TT
26047
>
26048
when using earlier versions of Visual Studio.
26049
</P
26050
></DD
26051
><DT
26052
><A
26053
NAME="cv-MSVSREBUILDCOM"
26054
></A
26055
><CODE
26056
CLASS="envar"
26057
>MSVSREBUILDCOM</CODE
26058
></DT
26059
><DD
26060
><P
26061
>&#13;The rebuild command line placed in
26062
a generated Microsoft Visual Studio project file.
26063
The default is to have Visual Studio invoke SCons with any specified
26064
rebuild targets.
26065
</P
26066
></DD
26067
><DT
26068
><A
26069
NAME="cv-MSVSSCONS"
26070
></A
26071
><CODE
26072
CLASS="envar"
26073
>MSVSSCONS</CODE
26074
></DT
26075
><DD
26076
><P
26077
>&#13;The SCons used in generated Microsoft Visual Studio project files.
26078
The default is the version of SCons being
26079
used to generate the project file.
26080
</P
26081
></DD
26082
><DT
26083
><A
26084
NAME="cv-MSVSSCONSCOM"
26085
></A
26086
><CODE
26087
CLASS="envar"
26088
>MSVSSCONSCOM</CODE
26089
></DT
26090
><DD
26091
><P
26092
>&#13;The default SCons command used in generated Microsoft Visual Studio
26093
project files.
26094
</P
26095
></DD
26096
><DT
26097
><A
26098
NAME="cv-MSVSSCONSCRIPT"
26099
></A
26100
><CODE
26101
CLASS="envar"
26102
>MSVSSCONSCRIPT</CODE
26103
></DT
26104
><DD
26105
><P
26106
>&#13;The sconscript file
26107
(that is,
26108
<TT
26109
CLASS="filename"
26110
>SConstruct</TT
26111
>
26112
or
26113
<TT
26114
CLASS="filename"
26115
>SConscript</TT
26116
>
26117
file)
26118
that will be invoked by Visual Studio
26119
project files
26120
(through the
26121
<A
26122
HREF="#cv-MSVSSCONSCOM"
26123
><CODE
26124
CLASS="envar"
26125
>$MSVSSCONSCOM</CODE
26126
></A
26127
>
26128
variable).
26129
The default is the same sconscript file
26130
that contains the call to
26131
<CODE
26132
CLASS="function"
26133
>MSVSProject</CODE
26134
>
26135
to build the project file.
26136
</P
26137
></DD
26138
><DT
26139
><A
26140
NAME="cv-MSVSSCONSFLAGS"
26141
></A
26142
><CODE
26143
CLASS="envar"
26144
>MSVSSCONSFLAGS</CODE
26145
></DT
26146
><DD
26147
><P
26148
>&#13;The SCons flags used in generated Microsoft Visual Studio
26149
project files.
26150
</P
26151
></DD
26152
><DT
26153
><A
26154
NAME="cv-MSVSSOLUTIONCOM"
26155
></A
26156
><CODE
26157
CLASS="envar"
26158
>MSVSSOLUTIONCOM</CODE
26159
></DT
26160
><DD
26161
><P
26162
>&#13;The action used to generate Microsoft Visual Studio solution files.
26163
</P
26164
></DD
26165
><DT
26166
><A
26167
NAME="cv-MSVSSOLUTIONSUFFIX"
26168
></A
26169
><CODE
26170
CLASS="envar"
26171
>MSVSSOLUTIONSUFFIX</CODE
26172
></DT
26173
><DD
26174
><P
26175
>&#13;The suffix used for Microsoft Visual Studio solution (DSW) files.
26176
The default value is
26177
<TT
26178
CLASS="filename"
26179
>.sln</TT
26180
>
26181
when using Visual Studio version 7.x (.NET),
26182
and
26183
<TT
26184
CLASS="filename"
26185
>.dsw</TT
26186
>
26187
when using earlier versions of Visual Studio.
26188
</P
26189
></DD
26190
><DT
26191
><A
26192
NAME="cv-MWCW_VERSION"
26193
></A
26194
><CODE
26195
CLASS="envar"
26196
>MWCW_VERSION</CODE
26197
></DT
26198
><DD
26199
><P
26200
>&#13;The version number of the MetroWerks CodeWarrior C compiler
26201
to be used.
26202
</P
26203
></DD
26204
><DT
26205
><A
26206
NAME="cv-MWCW_VERSIONS"
26207
></A
26208
><CODE
26209
CLASS="envar"
26210
>MWCW_VERSIONS</CODE
26211
></DT
26212
><DD
26213
><P
26214
>&#13;A list of installed versions of the MetroWerks CodeWarrior C compiler
26215
on this system.
26216
</P
26217
></DD
26218
><DT
26219
><A
26220
NAME="cv-NAME"
26221
></A
26222
><CODE
26223
CLASS="envar"
26224
>NAME</CODE
26225
></DT
26226
><DD
26227
><P
26228
>&#13;Specfies the name of the project to package.
26229
</P
26230
></DD
26231
><DT
26232
><A
26233
NAME="cv-no_import_lib"
26234
></A
26235
><CODE
26236
CLASS="envar"
26237
>no_import_lib</CODE
26238
></DT
26239
><DD
26240
><P
26241
>&#13;When set to non-zero,
26242
suppresses creation of a corresponding Windows static import lib by the
26243
<TT
26244
CLASS="literal"
26245
>SharedLibrary</TT
26246
>
26247
builder when used with
26248
MinGW, Microsoft Visual Studio or Metrowerks.
26249
This also suppresses creation
26250
of an export (.exp) file
26251
when using Microsoft Visual Studio.
26252
</P
26253
></DD
26254
><DT
26255
><A
26256
NAME="cv-OBJPREFIX"
26257
></A
26258
><CODE
26259
CLASS="envar"
26260
>OBJPREFIX</CODE
26261
></DT
26262
><DD
26263
><P
26264
>&#13;The prefix used for (static) object file names.
26265
</P
26266
></DD
26267
><DT
26268
><A
26269
NAME="cv-OBJSUFFIX"
26270
></A
26271
><CODE
26272
CLASS="envar"
26273
>OBJSUFFIX</CODE
26274
></DT
26275
><DD
26276
><P
26277
>&#13;The suffix used for (static) object file names.
26278
</P
26279
></DD
26280
><DT
26281
><A
26282
NAME="cv-P4"
26283
></A
26284
><CODE
26285
CLASS="envar"
26286
>P4</CODE
26287
></DT
26288
><DD
26289
><P
26290
>&#13;The Perforce executable.
26291
</P
26292
></DD
26293
><DT
26294
><A
26295
NAME="cv-P4COM"
26296
></A
26297
><CODE
26298
CLASS="envar"
26299
>P4COM</CODE
26300
></DT
26301
><DD
26302
><P
26303
>&#13;The command line used to
26304
fetch source files from Perforce.
26305
</P
26306
></DD
26307
><DT
26308
><A
26309
NAME="cv-P4COMSTR"
26310
></A
26311
><CODE
26312
CLASS="envar"
26313
>P4COMSTR</CODE
26314
></DT
26315
><DD
26316
><P
26317
>&#13;The string displayed when
26318
fetching a source file from Perforce.
26319
If this is not set, then <A
26320
HREF="#cv-P4COM"
26321
><CODE
26322
CLASS="envar"
26323
>$P4COM</CODE
26324
></A
26325
> (the command line) is displayed.
26326
</P
26327
></DD
26328
><DT
26329
><A
26330
NAME="cv-P4FLAGS"
26331
></A
26332
><CODE
26333
CLASS="envar"
26334
>P4FLAGS</CODE
26335
></DT
26336
><DD
26337
><P
26338
>&#13;General options that are passed to Perforce.
26339
</P
26340
></DD
26341
><DT
26342
><A
26343
NAME="cv-PACKAGEROOT"
26344
></A
26345
><CODE
26346
CLASS="envar"
26347
>PACKAGEROOT</CODE
26348
></DT
26349
><DD
26350
><P
26351
>&#13;Specifies the directory where all files in resulting archive will be
26352
placed if applicable.  The default value is "$NAME-$VERSION".
26353
</P
26354
></DD
26355
><DT
26356
><A
26357
NAME="cv-PACKAGETYPE"
26358
></A
26359
><CODE
26360
CLASS="envar"
26361
>PACKAGETYPE</CODE
26362
></DT
26363
><DD
26364
><P
26365
>&#13;Selects the package type to build.  Currently these are available:</P
26366
><P
26367
> * msi - Microsoft Installer
26368
 * rpm - Redhat Package Manger
26369
 * ipkg - Itsy Package Management System
26370
 * tarbz2 - compressed tar
26371
 * targz - compressed tar
26372
 * zip - zip file
26373
 * src_tarbz2 - compressed tar source
26374
 * src_targz - compressed tar source
26375
 * src_zip - zip file source</P
26376
><P
26377
>This may be overridden with the "package_type" command line option.
26378
</P
26379
></DD
26380
><DT
26381
><A
26382
NAME="cv-PACKAGEVERSION"
26383
></A
26384
><CODE
26385
CLASS="envar"
26386
>PACKAGEVERSION</CODE
26387
></DT
26388
><DD
26389
><P
26390
>&#13;The version of the package (not the underlying project).
26391
This is currently only used by the rpm packager
26392
and should reflect changes in the packaging,
26393
not the underlying project code itself.
26394
</P
26395
></DD
26396
><DT
26397
><A
26398
NAME="cv-PCH"
26399
></A
26400
><CODE
26401
CLASS="envar"
26402
>PCH</CODE
26403
></DT
26404
><DD
26405
><P
26406
>&#13;The Microsoft Visual C++ precompiled header that will be used when compiling
26407
object files. This variable is ignored by tools other than Microsoft Visual C++.
26408
When this variable is
26409
defined SCons will add options to the compiler command line to
26410
cause it to use the precompiled header, and will also set up the
26411
dependencies for the PCH file.
26412
Example:
26413
</P
26414
><PRE
26415
CLASS="programlisting"
26416
>&#13;env['PCH'] = 'StdAfx.pch'
26417
</PRE
26418
></DD
26419
><DT
26420
><A
26421
NAME="cv-PCHCOM"
26422
></A
26423
><CODE
26424
CLASS="envar"
26425
>PCHCOM</CODE
26426
></DT
26427
><DD
26428
><P
26429
>&#13;The command line used by the
26430
<CODE
26431
CLASS="function"
26432
>PCH</CODE
26433
>
26434
builder to generated a precompiled header.
26435
</P
26436
></DD
26437
><DT
26438
><A
26439
NAME="cv-PCHCOMSTR"
26440
></A
26441
><CODE
26442
CLASS="envar"
26443
>PCHCOMSTR</CODE
26444
></DT
26445
><DD
26446
><P
26447
>&#13;The string displayed when generating a precompiled header.
26448
If this is not set, then <A
26449
HREF="#cv-PCHCOM"
26450
><CODE
26451
CLASS="envar"
26452
>$PCHCOM</CODE
26453
></A
26454
> (the command line) is displayed.
26455
</P
26456
></DD
26457
><DT
26458
><A
26459
NAME="cv-PCHPDBFLAGS"
26460
></A
26461
><CODE
26462
CLASS="envar"
26463
>PCHPDBFLAGS</CODE
26464
></DT
26465
><DD
26466
><P
26467
>&#13;A construction variable that, when expanded,
26468
adds the <TT
26469
CLASS="literal"
26470
>/yD</TT
26471
> flag to the command line
26472
only if the <CODE
26473
CLASS="envar"
26474
>$PDB</CODE
26475
> construction variable is set.
26476
</P
26477
></DD
26478
><DT
26479
><A
26480
NAME="cv-PCHSTOP"
26481
></A
26482
><CODE
26483
CLASS="envar"
26484
>PCHSTOP</CODE
26485
></DT
26486
><DD
26487
><P
26488
>&#13;This variable specifies how much of a source file is precompiled. This
26489
variable is ignored by tools other than Microsoft Visual C++, or when
26490
the PCH variable is not being used. When this variable is define it
26491
must be a string that is the name of the header that
26492
is included at the end of the precompiled portion of the source files, or
26493
the empty string if the "#pragma hrdstop" construct is being used:
26494
</P
26495
><PRE
26496
CLASS="programlisting"
26497
>&#13;env['PCHSTOP'] = 'StdAfx.h'
26498
</PRE
26499
></DD
26500
><DT
26501
><A
26502
NAME="cv-PDB"
26503
></A
26504
><CODE
26505
CLASS="envar"
26506
>PDB</CODE
26507
></DT
26508
><DD
26509
><P
26510
>&#13;The Microsoft Visual C++ PDB file that will store debugging information for
26511
object files, shared libraries, and programs. This variable is ignored by
26512
tools other than Microsoft Visual C++.
26513
When this variable is
26514
defined SCons will add options to the compiler and linker command line to
26515
cause them to generate external debugging information, and will also set up the
26516
dependencies for the PDB file.
26517
Example:
26518
</P
26519
><PRE
26520
CLASS="programlisting"
26521
>&#13;env['PDB'] = 'hello.pdb'
26522
</PRE
26523
><P
26524
>&#13;The Visual C++ compiler switch that SCons uses by default
26525
to generate PDB information is <CODE
26526
CLASS="option"
26527
>/Z7</CODE
26528
>.
26529
This works correctly with parallel (<CODE
26530
CLASS="option"
26531
>-j</CODE
26532
>) builds
26533
because it embeds the debug information in the intermediate object files,
26534
as opposed to sharing a single PDB file between multiple object files.
26535
This is also the only way to get debug information
26536
embedded into a static library.
26537
Using the <CODE
26538
CLASS="option"
26539
>/Zi</CODE
26540
> instead may yield improved
26541
link-time performance,
26542
although parallel builds will no longer work.
26543
You can generate PDB files with the <CODE
26544
CLASS="option"
26545
>/Zi</CODE
26546
>
26547
switch by overriding the default <A
26548
HREF="#cv-CCPDBFLAGS"
26549
><CODE
26550
CLASS="envar"
26551
>$CCPDBFLAGS</CODE
26552
></A
26553
> variable;
26554
see the entry for that variable for specific examples.
26555
</P
26556
></DD
26557
><DT
26558
><A
26559
NAME="cv-PDFCOM"
26560
></A
26561
><CODE
26562
CLASS="envar"
26563
>PDFCOM</CODE
26564
></DT
26565
><DD
26566
><P
26567
>&#13;A deprecated synonym for <A
26568
HREF="#cv-DVIPDFCOM"
26569
><CODE
26570
CLASS="envar"
26571
>$DVIPDFCOM</CODE
26572
></A
26573
>.
26574
</P
26575
></DD
26576
><DT
26577
><A
26578
NAME="cv-PDFLATEX"
26579
></A
26580
><CODE
26581
CLASS="envar"
26582
>PDFLATEX</CODE
26583
></DT
26584
><DD
26585
><P
26586
>&#13;The <SPAN
26587
CLASS="application"
26588
>pdflatex</SPAN
26589
> utility.
26590
</P
26591
></DD
26592
><DT
26593
><A
26594
NAME="cv-PDFLATEXCOM"
26595
></A
26596
><CODE
26597
CLASS="envar"
26598
>PDFLATEXCOM</CODE
26599
></DT
26600
><DD
26601
><P
26602
>&#13;The command line used to call the <SPAN
26603
CLASS="application"
26604
>pdflatex</SPAN
26605
> utility.
26606
</P
26607
></DD
26608
><DT
26609
><A
26610
NAME="cv-PDFLATEXCOMSTR"
26611
></A
26612
><CODE
26613
CLASS="envar"
26614
>PDFLATEXCOMSTR</CODE
26615
></DT
26616
><DD
26617
><P
26618
>&#13;The string displayed when calling the <SPAN
26619
CLASS="application"
26620
>pdflatex</SPAN
26621
> utility.
26622
If this is not set, then <A
26623
HREF="#cv-PDFLATEXCOM"
26624
><CODE
26625
CLASS="envar"
26626
>$PDFLATEXCOM</CODE
26627
></A
26628
> (the command line) is displayed.
26629
</P
26630
><PRE
26631
CLASS="programlisting"
26632
>&#13;env = Environment(PDFLATEX;COMSTR = "Building $TARGET from LaTeX input $SOURCES")
26633
</PRE
26634
></DD
26635
><DT
26636
><A
26637
NAME="cv-PDFLATEXFLAGS"
26638
></A
26639
><CODE
26640
CLASS="envar"
26641
>PDFLATEXFLAGS</CODE
26642
></DT
26643
><DD
26644
><P
26645
>&#13;General options passed to the <SPAN
26646
CLASS="application"
26647
>pdflatex</SPAN
26648
> utility.
26649
</P
26650
></DD
26651
><DT
26652
><A
26653
NAME="cv-PDFPREFIX"
26654
></A
26655
><CODE
26656
CLASS="envar"
26657
>PDFPREFIX</CODE
26658
></DT
26659
><DD
26660
><P
26661
>&#13;The prefix used for PDF file names.
26662
</P
26663
></DD
26664
><DT
26665
><A
26666
NAME="cv-PDFSUFFIX"
26667
></A
26668
><CODE
26669
CLASS="envar"
26670
>PDFSUFFIX</CODE
26671
></DT
26672
><DD
26673
><P
26674
>&#13;The suffix used for PDF file names.
26675
</P
26676
></DD
26677
><DT
26678
><A
26679
NAME="cv-PDFTEX"
26680
></A
26681
><CODE
26682
CLASS="envar"
26683
>PDFTEX</CODE
26684
></DT
26685
><DD
26686
><P
26687
>&#13;The <SPAN
26688
CLASS="application"
26689
>pdftex</SPAN
26690
> utility.
26691
</P
26692
></DD
26693
><DT
26694
><A
26695
NAME="cv-PDFTEXCOM"
26696
></A
26697
><CODE
26698
CLASS="envar"
26699
>PDFTEXCOM</CODE
26700
></DT
26701
><DD
26702
><P
26703
>&#13;The command line used to call the <SPAN
26704
CLASS="application"
26705
>pdftex</SPAN
26706
> utility.
26707
</P
26708
></DD
26709
><DT
26710
><A
26711
NAME="cv-PDFTEXCOMSTR"
26712
></A
26713
><CODE
26714
CLASS="envar"
26715
>PDFTEXCOMSTR</CODE
26716
></DT
26717
><DD
26718
><P
26719
>&#13;The string displayed when calling the <SPAN
26720
CLASS="application"
26721
>pdftex</SPAN
26722
> utility.
26723
If this is not set, then <A
26724
HREF="#cv-PDFTEXCOM"
26725
><CODE
26726
CLASS="envar"
26727
>$PDFTEXCOM</CODE
26728
></A
26729
> (the command line) is displayed.
26730
</P
26731
><PRE
26732
CLASS="programlisting"
26733
>&#13;env = Environment(PDFTEXCOMSTR = "Building $TARGET from TeX input $SOURCES")
26734
</PRE
26735
></DD
26736
><DT
26737
><A
26738
NAME="cv-PDFTEXFLAGS"
26739
></A
26740
><CODE
26741
CLASS="envar"
26742
>PDFTEXFLAGS</CODE
26743
></DT
26744
><DD
26745
><P
26746
>&#13;General options passed to the <SPAN
26747
CLASS="application"
26748
>pdftex</SPAN
26749
> utility.
26750
</P
26751
></DD
26752
><DT
26753
><A
26754
NAME="cv-PKGCHK"
26755
></A
26756
><CODE
26757
CLASS="envar"
26758
>PKGCHK</CODE
26759
></DT
26760
><DD
26761
><P
26762
>&#13;On Solaris systems,
26763
the package-checking program that will
26764
be used (along with <CODE
26765
CLASS="envar"
26766
>$PKGINFO</CODE
26767
>)
26768
to look for installed versions of
26769
the Sun PRO C++ compiler.
26770
The default is
26771
<TT
26772
CLASS="filename"
26773
>/usr/sbin/pgkchk</TT
26774
>.
26775
</P
26776
></DD
26777
><DT
26778
><A
26779
NAME="cv-PKGINFO"
26780
></A
26781
><CODE
26782
CLASS="envar"
26783
>PKGINFO</CODE
26784
></DT
26785
><DD
26786
><P
26787
>&#13;On Solaris systems,
26788
the package information program that will
26789
be used (along with <CODE
26790
CLASS="envar"
26791
>$PKGCHK</CODE
26792
>)
26793
to look for installed versions of
26794
the Sun PRO C++ compiler.
26795
The default is
26796
<TT
26797
CLASS="filename"
26798
>pkginfo</TT
26799
>.
26800
</P
26801
></DD
26802
><DT
26803
><A
26804
NAME="cv-PLATFORM"
26805
></A
26806
><CODE
26807
CLASS="envar"
26808
>PLATFORM</CODE
26809
></DT
26810
><DD
26811
><P
26812
>&#13;The name of the platform used to create the Environment.  If no platform is
26813
specified when the Environment is created,
26814
<SPAN
26815
CLASS="application"
26816
>scons</SPAN
26817
>
26818
autodetects the platform.
26819
</P
26820
><PRE
26821
CLASS="programlisting"
26822
>&#13;env = Environment(tools = [])
26823
if env['PLATFORM'] == 'cygwin':
26824
    Tool('mingw')(env)
26825
else:
26826
    Tool('msvc')(env)
26827
</PRE
26828
></DD
26829
><DT
26830
><A
26831
NAME="cv-PRINT_CMD_LINE_FUNC"
26832
></A
26833
><CODE
26834
CLASS="envar"
26835
>PRINT_CMD_LINE_FUNC</CODE
26836
></DT
26837
><DD
26838
><P
26839
>&#13;A Python function used to print the command lines as they are executed
26840
(assuming command printing is not disabled by the
26841
<CODE
26842
CLASS="option"
26843
>-q</CODE
26844
>
26845
or
26846
<CODE
26847
CLASS="option"
26848
>-s</CODE
26849
>
26850
options or their equivalents).
26851
The function should take four arguments:
26852
<CODE
26853
CLASS="varname"
26854
>s</CODE
26855
>,
26856
the command being executed (a string),
26857
<CODE
26858
CLASS="varname"
26859
>target</CODE
26860
>,
26861
the target being built (file node, list, or string name(s)),
26862
<CODE
26863
CLASS="varname"
26864
>source</CODE
26865
>,
26866
the source(s) used (file node, list, or string name(s)), and
26867
<CODE
26868
CLASS="varname"
26869
>env</CODE
26870
>,
26871
the environment being used.</P
26872
><P
26873
>The function must do the printing itself.  The default implementation,
26874
used if this variable is not set or is None, is:
26875
</P
26876
><PRE
26877
CLASS="programlisting"
26878
>&#13;def print_cmd_line(s, target, source, env):
26879
  sys.stdout.write(s + "\n")
26880
</PRE
26881
><P
26882
>&#13;Here's an example of a more interesting function:
26883
</P
26884
><PRE
26885
CLASS="programlisting"
26886
>&#13;def print_cmd_line(s, target, source, env):
26887
   sys.stdout.write("Building %s -&#62; %s...\n" %
26888
    (' and '.join([str(x) for x in source]),
26889
     ' and '.join([str(x) for x in target])))
26890
env=Environment(PRINT_CMD_LINE_FUNC=print_cmd_line)
26891
env.Program('foo', 'foo.c')
26892
</PRE
26893
><P
26894
>&#13;This just prints "Building <CODE
26895
CLASS="varname"
26896
>targetname</CODE
26897
> from <CODE
26898
CLASS="varname"
26899
>sourcename</CODE
26900
>..." instead
26901
of the actual commands.
26902
Such a function could also log the actual commands to a log file,
26903
for example.
26904
</P
26905
></DD
26906
><DT
26907
><A
26908
NAME="cv-PROGPREFIX"
26909
></A
26910
><CODE
26911
CLASS="envar"
26912
>PROGPREFIX</CODE
26913
></DT
26914
><DD
26915
><P
26916
>&#13;The prefix used for executable file names.
26917
</P
26918
></DD
26919
><DT
26920
><A
26921
NAME="cv-PROGSUFFIX"
26922
></A
26923
><CODE
26924
CLASS="envar"
26925
>PROGSUFFIX</CODE
26926
></DT
26927
><DD
26928
><P
26929
>&#13;The suffix used for executable file names.
26930
</P
26931
></DD
26932
><DT
26933
><A
26934
NAME="cv-PSCOM"
26935
></A
26936
><CODE
26937
CLASS="envar"
26938
>PSCOM</CODE
26939
></DT
26940
><DD
26941
><P
26942
>&#13;The command line used to convert TeX DVI files into a PostScript file.
26943
</P
26944
></DD
26945
><DT
26946
><A
26947
NAME="cv-PSCOMSTR"
26948
></A
26949
><CODE
26950
CLASS="envar"
26951
>PSCOMSTR</CODE
26952
></DT
26953
><DD
26954
><P
26955
>&#13;The string displayed when a TeX DVI file
26956
is converted into a PostScript file.
26957
If this is not set, then <A
26958
HREF="#cv-PSCOM"
26959
><CODE
26960
CLASS="envar"
26961
>$PSCOM</CODE
26962
></A
26963
> (the command line) is displayed.
26964
</P
26965
></DD
26966
><DT
26967
><A
26968
NAME="cv-PSPREFIX"
26969
></A
26970
><CODE
26971
CLASS="envar"
26972
>PSPREFIX</CODE
26973
></DT
26974
><DD
26975
><P
26976
>&#13;The prefix used for PostScript file names.
26977
</P
26978
></DD
26979
><DT
26980
><A
26981
NAME="cv-PSSUFFIX"
26982
></A
26983
><CODE
26984
CLASS="envar"
26985
>PSSUFFIX</CODE
26986
></DT
26987
><DD
26988
><P
26989
>&#13;The prefix used for PostScript file names.
26990
</P
26991
></DD
26992
><DT
26993
><A
26994
NAME="cv-QT_AUTOSCAN"
26995
></A
26996
><CODE
26997
CLASS="envar"
26998
>QT_AUTOSCAN</CODE
26999
></DT
27000
><DD
27001
><P
27002
>&#13;Turn off scanning for mocable files. Use the Moc Builder to explicitely
27003
specify files to run moc on.
27004
</P
27005
></DD
27006
><DT
27007
><A
27008
NAME="cv-QT_BINPATH"
27009
></A
27010
><CODE
27011
CLASS="envar"
27012
>QT_BINPATH</CODE
27013
></DT
27014
><DD
27015
><P
27016
>&#13;The path where the qt binaries are installed.
27017
The default value is '<A
27018
HREF="#cv-QTDIR"
27019
><CODE
27020
CLASS="envar"
27021
>$QTDIR</CODE
27022
></A
27023
>/bin'.
27024
</P
27025
></DD
27026
><DT
27027
><A
27028
NAME="cv-QT_CPPPATH"
27029
></A
27030
><CODE
27031
CLASS="envar"
27032
>QT_CPPPATH</CODE
27033
></DT
27034
><DD
27035
><P
27036
>&#13;The path where the qt header files are installed.
27037
The default value is '<A
27038
HREF="#cv-QTDIR"
27039
><CODE
27040
CLASS="envar"
27041
>$QTDIR</CODE
27042
></A
27043
>/include'.
27044
Note: If you set this variable to None,
27045
the tool won't change the <A
27046
HREF="#cv-CPPPATH"
27047
><CODE
27048
CLASS="envar"
27049
>$CPPPATH</CODE
27050
></A
27051
>
27052
construction variable.
27053
</P
27054
></DD
27055
><DT
27056
><A
27057
NAME="cv-QT_DEBUG"
27058
></A
27059
><CODE
27060
CLASS="envar"
27061
>QT_DEBUG</CODE
27062
></DT
27063
><DD
27064
><P
27065
>&#13;Prints lots of debugging information while scanning for moc files.
27066
</P
27067
></DD
27068
><DT
27069
><A
27070
NAME="cv-QT_LIB"
27071
></A
27072
><CODE
27073
CLASS="envar"
27074
>QT_LIB</CODE
27075
></DT
27076
><DD
27077
><P
27078
>&#13;Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set
27079
this variable to None, the tool won't change the <A
27080
HREF="#cv-LIBS"
27081
><CODE
27082
CLASS="envar"
27083
>$LIBS</CODE
27084
></A
27085
> variable.
27086
</P
27087
></DD
27088
><DT
27089
><A
27090
NAME="cv-QT_LIBPATH"
27091
></A
27092
><CODE
27093
CLASS="envar"
27094
>QT_LIBPATH</CODE
27095
></DT
27096
><DD
27097
><P
27098
>&#13;The path where the qt libraries are installed.
27099
The default value is '<A
27100
HREF="#cv-QTDIR"
27101
><CODE
27102
CLASS="envar"
27103
>$QTDIR</CODE
27104
></A
27105
>/lib'.
27106
Note: If you set this variable to None,
27107
the tool won't change the <A
27108
HREF="#cv-LIBPATH"
27109
><CODE
27110
CLASS="envar"
27111
>$LIBPATH</CODE
27112
></A
27113
>
27114
construction variable.
27115
</P
27116
></DD
27117
><DT
27118
><A
27119
NAME="cv-QT_MOC"
27120
></A
27121
><CODE
27122
CLASS="envar"
27123
>QT_MOC</CODE
27124
></DT
27125
><DD
27126
><P
27127
>&#13;Default value is '<A
27128
HREF="#cv-QT_BINPATH"
27129
><CODE
27130
CLASS="envar"
27131
>$QT_BINPATH</CODE
27132
></A
27133
>/moc'.
27134
</P
27135
></DD
27136
><DT
27137
><A
27138
NAME="cv-QT_MOCCXXPREFIX"
27139
></A
27140
><CODE
27141
CLASS="envar"
27142
>QT_MOCCXXPREFIX</CODE
27143
></DT
27144
><DD
27145
><P
27146
>&#13;Default value is ''. Prefix for moc output files, when source is a cxx file.
27147
</P
27148
></DD
27149
><DT
27150
><A
27151
NAME="cv-QT_MOCCXXSUFFIX"
27152
></A
27153
><CODE
27154
CLASS="envar"
27155
>QT_MOCCXXSUFFIX</CODE
27156
></DT
27157
><DD
27158
><P
27159
>&#13;Default value is '.moc'. Suffix for moc output files, when source is a cxx
27160
file.
27161
</P
27162
></DD
27163
><DT
27164
><A
27165
NAME="cv-QT_MOCFROMCXXCOM"
27166
></A
27167
><CODE
27168
CLASS="envar"
27169
>QT_MOCFROMCXXCOM</CODE
27170
></DT
27171
><DD
27172
><P
27173
>&#13;Command to generate a moc file from a cpp file.
27174
</P
27175
></DD
27176
><DT
27177
><A
27178
NAME="cv-QT_MOCFROMCXXCOMSTR"
27179
></A
27180
><CODE
27181
CLASS="envar"
27182
>QT_MOCFROMCXXCOMSTR</CODE
27183
></DT
27184
><DD
27185
><P
27186
>&#13;The string displayed when generating a moc file from a cpp file.
27187
If this is not set, then <A
27188
HREF="#cv-QT_MOCFROMCXXCOM"
27189
><CODE
27190
CLASS="envar"
27191
>$QT_MOCFROMCXXCOM</CODE
27192
></A
27193
> (the command line) is displayed.
27194
</P
27195
></DD
27196
><DT
27197
><A
27198
NAME="cv-QT_MOCFROMCXXFLAGS"
27199
></A
27200
><CODE
27201
CLASS="envar"
27202
>QT_MOCFROMCXXFLAGS</CODE
27203
></DT
27204
><DD
27205
><P
27206
>&#13;Default value is '-i'. These flags are passed to moc, when moccing a
27207
C++ file.
27208
</P
27209
></DD
27210
><DT
27211
><A
27212
NAME="cv-QT_MOCFROMHCOM"
27213
></A
27214
><CODE
27215
CLASS="envar"
27216
>QT_MOCFROMHCOM</CODE
27217
></DT
27218
><DD
27219
><P
27220
>&#13;Command to generate a moc file from a header.
27221
</P
27222
></DD
27223
><DT
27224
><A
27225
NAME="cv-QT_MOCFROMHCOMSTR"
27226
></A
27227
><CODE
27228
CLASS="envar"
27229
>QT_MOCFROMHCOMSTR</CODE
27230
></DT
27231
><DD
27232
><P
27233
>&#13;The string displayed when generating a moc file from a cpp file.
27234
If this is not set, then <A
27235
HREF="#cv-QT_MOCFROMHCOM"
27236
><CODE
27237
CLASS="envar"
27238
>$QT_MOCFROMHCOM</CODE
27239
></A
27240
> (the command line) is displayed.
27241
</P
27242
></DD
27243
><DT
27244
><A
27245
NAME="cv-QT_MOCFROMHFLAGS"
27246
></A
27247
><CODE
27248
CLASS="envar"
27249
>QT_MOCFROMHFLAGS</CODE
27250
></DT
27251
><DD
27252
><P
27253
>&#13;Default value is ''. These flags are passed to moc, when moccing a header
27254
file.
27255
</P
27256
></DD
27257
><DT
27258
><A
27259
NAME="cv-QT_MOCHPREFIX"
27260
></A
27261
><CODE
27262
CLASS="envar"
27263
>QT_MOCHPREFIX</CODE
27264
></DT
27265
><DD
27266
><P
27267
>&#13;Default value is 'moc_'. Prefix for moc output files, when source is a header.
27268
</P
27269
></DD
27270
><DT
27271
><A
27272
NAME="cv-QT_MOCHSUFFIX"
27273
></A
27274
><CODE
27275
CLASS="envar"
27276
>QT_MOCHSUFFIX</CODE
27277
></DT
27278
><DD
27279
><P
27280
>&#13;Default value is '<A
27281
HREF="#cv-CXXFILESUFFIX"
27282
><CODE
27283
CLASS="envar"
27284
>$CXXFILESUFFIX</CODE
27285
></A
27286
>'. Suffix for moc output files, when source is
27287
a header.
27288
</P
27289
></DD
27290
><DT
27291
><A
27292
NAME="cv-QT_UIC"
27293
></A
27294
><CODE
27295
CLASS="envar"
27296
>QT_UIC</CODE
27297
></DT
27298
><DD
27299
><P
27300
>&#13;Default value is '<A
27301
HREF="#cv-QT_BINPATH"
27302
><CODE
27303
CLASS="envar"
27304
>$QT_BINPATH</CODE
27305
></A
27306
>/uic'.
27307
</P
27308
></DD
27309
><DT
27310
><A
27311
NAME="cv-QT_UICCOM"
27312
></A
27313
><CODE
27314
CLASS="envar"
27315
>QT_UICCOM</CODE
27316
></DT
27317
><DD
27318
><P
27319
>&#13;Command to generate header files from .ui files.
27320
</P
27321
></DD
27322
><DT
27323
><A
27324
NAME="cv-QT_UICCOMSTR"
27325
></A
27326
><CODE
27327
CLASS="envar"
27328
>QT_UICCOMSTR</CODE
27329
></DT
27330
><DD
27331
><P
27332
>&#13;The string displayed when generating header files from .ui files.
27333
If this is not set, then <A
27334
HREF="#cv-QT_UICCOM"
27335
><CODE
27336
CLASS="envar"
27337
>$QT_UICCOM</CODE
27338
></A
27339
> (the command line) is displayed.
27340
</P
27341
></DD
27342
><DT
27343
><A
27344
NAME="cv-QT_UICDECLFLAGS"
27345
></A
27346
><CODE
27347
CLASS="envar"
27348
>QT_UICDECLFLAGS</CODE
27349
></DT
27350
><DD
27351
><P
27352
>&#13;Default value is ''. These flags are passed to uic, when creating a a h
27353
file from a .ui file.
27354
</P
27355
></DD
27356
><DT
27357
><A
27358
NAME="cv-QT_UICDECLPREFIX"
27359
></A
27360
><CODE
27361
CLASS="envar"
27362
>QT_UICDECLPREFIX</CODE
27363
></DT
27364
><DD
27365
><P
27366
>&#13;Default value is ''. Prefix for uic generated header files.
27367
</P
27368
></DD
27369
><DT
27370
><A
27371
NAME="cv-QT_UICDECLSUFFIX"
27372
></A
27373
><CODE
27374
CLASS="envar"
27375
>QT_UICDECLSUFFIX</CODE
27376
></DT
27377
><DD
27378
><P
27379
>&#13;Default value is '.h'. Suffix for uic generated header files.
27380
</P
27381
></DD
27382
><DT
27383
><A
27384
NAME="cv-QT_UICIMPLFLAGS"
27385
></A
27386
><CODE
27387
CLASS="envar"
27388
>QT_UICIMPLFLAGS</CODE
27389
></DT
27390
><DD
27391
><P
27392
>&#13;Default value is ''. These flags are passed to uic, when creating a cxx
27393
file from a .ui file.
27394
</P
27395
></DD
27396
><DT
27397
><A
27398
NAME="cv-QT_UICIMPLPREFIX"
27399
></A
27400
><CODE
27401
CLASS="envar"
27402
>QT_UICIMPLPREFIX</CODE
27403
></DT
27404
><DD
27405
><P
27406
>&#13;Default value is 'uic_'. Prefix for uic generated implementation files.
27407
</P
27408
></DD
27409
><DT
27410
><A
27411
NAME="cv-QT_UICIMPLSUFFIX"
27412
></A
27413
><CODE
27414
CLASS="envar"
27415
>QT_UICIMPLSUFFIX</CODE
27416
></DT
27417
><DD
27418
><P
27419
>&#13;Default value is '<A
27420
HREF="#cv-CXXFILESUFFIX"
27421
><CODE
27422
CLASS="envar"
27423
>$CXXFILESUFFIX</CODE
27424
></A
27425
>'. Suffix for uic generated implementation
27426
files.
27427
</P
27428
></DD
27429
><DT
27430
><A
27431
NAME="cv-QT_UISUFFIX"
27432
></A
27433
><CODE
27434
CLASS="envar"
27435
>QT_UISUFFIX</CODE
27436
></DT
27437
><DD
27438
><P
27439
>&#13;Default value is '.ui'. Suffix of designer input files.
27440
</P
27441
></DD
27442
><DT
27443
><A
27444
NAME="cv-QTDIR"
27445
></A
27446
><CODE
27447
CLASS="envar"
27448
>QTDIR</CODE
27449
></DT
27450
><DD
27451
><P
27452
>&#13;The qt tool tries to take this from os.environ.
27453
It also initializes all QT_*
27454
construction variables listed below.
27455
(Note that all paths are constructed
27456
with python's os.path.join() method,
27457
but are listed here with the '/' separator
27458
for easier reading.)
27459
In addition, the construction environment
27460
variables <A
27461
HREF="#cv-CPPPATH"
27462
><CODE
27463
CLASS="envar"
27464
>$CPPPATH</CODE
27465
></A
27466
>,
27467
<A
27468
HREF="#cv-LIBPATH"
27469
><CODE
27470
CLASS="envar"
27471
>$LIBPATH</CODE
27472
></A
27473
> and
27474
<A
27475
HREF="#cv-LIBS"
27476
><CODE
27477
CLASS="envar"
27478
>$LIBS</CODE
27479
></A
27480
> may be modified
27481
and the variables
27482
PROGEMITTER, SHLIBEMITTER and LIBEMITTER
27483
are modified. Because the build-performance is affected when using this tool,
27484
you have to explicitly specify it at Environment creation:
27485
</P
27486
><PRE
27487
CLASS="programlisting"
27488
>&#13;Environment(tools=['default','qt'])
27489
</PRE
27490
><P
27491
>&#13;The qt tool supports the following operations:</P
27492
><P
27493
><SPAN
27494
CLASS="emphasis"
27495
><I
27496
CLASS="emphasis"
27497
>Automatic moc file generation from header files.</I
27498
></SPAN
27499
>
27500
You do not have to specify moc files explicitly, the tool does it for you.
27501
However, there are a few preconditions to do so: Your header file must have
27502
the same filebase as your implementation file and must stay in the same
27503
directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You
27504
can turn off automatic moc file generation by setting QT_AUTOSCAN to 0.
27505
See also the corresponding builder method
27506
.B Moc()</P
27507
><P
27508
><SPAN
27509
CLASS="emphasis"
27510
><I
27511
CLASS="emphasis"
27512
>Automatic moc file generation from cxx files.</I
27513
></SPAN
27514
>
27515
As stated in the qt documentation, include the moc file at the end of
27516
the cxx file. Note that you have to include the file, which is generated
27517
by the transformation ${QT_MOCCXXPREFIX}&#60;basename&#62;${QT_MOCCXXSUFFIX}, by default
27518
&#60;basename&#62;.moc. A warning is generated after building the moc file, if you
27519
do not include the correct file. If you are using VariantDir, you may
27520
need to specify duplicate=1. You can turn off automatic moc file generation
27521
by setting QT_AUTOSCAN to 0. See also the corresponding
27522
<CODE
27523
CLASS="function"
27524
>Moc</CODE
27525
>
27526
builder method.</P
27527
><P
27528
><SPAN
27529
CLASS="emphasis"
27530
><I
27531
CLASS="emphasis"
27532
>Automatic handling of .ui files.</I
27533
></SPAN
27534
>
27535
The implementation files generated from .ui files are handled much the same
27536
as yacc or lex files. Each .ui file given as a source of Program, Library or
27537
SharedLibrary will generate three files, the declaration file, the
27538
implementation file and a moc file. Because there are also generated headers,
27539
you may need to specify duplicate=1 in calls to VariantDir.
27540
See also the corresponding
27541
<CODE
27542
CLASS="function"
27543
>Uic</CODE
27544
>
27545
builder method.
27546
</P
27547
></DD
27548
><DT
27549
><A
27550
NAME="cv-RANLIB"
27551
></A
27552
><CODE
27553
CLASS="envar"
27554
>RANLIB</CODE
27555
></DT
27556
><DD
27557
><P
27558
>&#13;The archive indexer.
27559
</P
27560
></DD
27561
><DT
27562
><A
27563
NAME="cv-RANLIBCOM"
27564
></A
27565
><CODE
27566
CLASS="envar"
27567
>RANLIBCOM</CODE
27568
></DT
27569
><DD
27570
><P
27571
>&#13;The command line used to index a static library archive.
27572
</P
27573
></DD
27574
><DT
27575
><A
27576
NAME="cv-RANLIBCOMSTR"
27577
></A
27578
><CODE
27579
CLASS="envar"
27580
>RANLIBCOMSTR</CODE
27581
></DT
27582
><DD
27583
><P
27584
>&#13;The string displayed when a static library archive is indexed.
27585
If this is not set, then <A
27586
HREF="#cv-RANLIBCOM"
27587
><CODE
27588
CLASS="envar"
27589
>$RANLIBCOM</CODE
27590
></A
27591
> (the command line) is displayed.
27592
</P
27593
><PRE
27594
CLASS="programlisting"
27595
>&#13;env = Environment(RANLIBCOMSTR = "Indexing $TARGET")
27596
</PRE
27597
></DD
27598
><DT
27599
><A
27600
NAME="cv-RANLIBFLAGS"
27601
></A
27602
><CODE
27603
CLASS="envar"
27604
>RANLIBFLAGS</CODE
27605
></DT
27606
><DD
27607
><P
27608
>&#13;General options passed to the archive indexer.
27609
</P
27610
></DD
27611
><DT
27612
><A
27613
NAME="cv-RC"
27614
></A
27615
><CODE
27616
CLASS="envar"
27617
>RC</CODE
27618
></DT
27619
><DD
27620
><P
27621
>&#13;The resource compiler used to build
27622
a Microsoft Visual C++ resource file.
27623
</P
27624
></DD
27625
><DT
27626
><A
27627
NAME="cv-RCCOM"
27628
></A
27629
><CODE
27630
CLASS="envar"
27631
>RCCOM</CODE
27632
></DT
27633
><DD
27634
><P
27635
>&#13;The command line used to build
27636
a Microsoft Visual C++ resource file.
27637
</P
27638
></DD
27639
><DT
27640
><A
27641
NAME="cv-RCCOMSTR"
27642
></A
27643
><CODE
27644
CLASS="envar"
27645
>RCCOMSTR</CODE
27646
></DT
27647
><DD
27648
><P
27649
>&#13;The string displayed when invoking the resource compiler
27650
to build a Microsoft Visual C++ resource file.
27651
If this is not set, then <A
27652
HREF="#cv-RCCOM"
27653
><CODE
27654
CLASS="envar"
27655
>$RCCOM</CODE
27656
></A
27657
> (the command line) is displayed.
27658
</P
27659
></DD
27660
><DT
27661
><A
27662
NAME="cv-RCFLAGS"
27663
></A
27664
><CODE
27665
CLASS="envar"
27666
>RCFLAGS</CODE
27667
></DT
27668
><DD
27669
><P
27670
>&#13;The flags passed to the resource compiler by the RES builder.
27671
</P
27672
></DD
27673
><DT
27674
><A
27675
NAME="cv-RCINCFLAGS"
27676
></A
27677
><CODE
27678
CLASS="envar"
27679
>RCINCFLAGS</CODE
27680
></DT
27681
><DD
27682
><P
27683
>&#13;An automatically-generated construction variable
27684
containing the command-line options
27685
for specifying directories to be searched
27686
by the resource compiler.
27687
The value of <CODE
27688
CLASS="envar"
27689
>$RCINCFLAGS</CODE
27690
> is created
27691
by appending <CODE
27692
CLASS="envar"
27693
>$RCINCPREFIX</CODE
27694
> and <CODE
27695
CLASS="envar"
27696
>$RCINCSUFFIX</CODE
27697
>
27698
to the beginning and end
27699
of each directory in <CODE
27700
CLASS="envar"
27701
>$CPPPATH</CODE
27702
>.
27703
</P
27704
></DD
27705
><DT
27706
><A
27707
NAME="cv-RCINCPREFIX"
27708
></A
27709
><CODE
27710
CLASS="envar"
27711
>RCINCPREFIX</CODE
27712
></DT
27713
><DD
27714
><P
27715
>&#13;The prefix (flag) used to specify an include directory
27716
on the resource compiler command line.
27717
This will be appended to the beginning of each directory
27718
in the <CODE
27719
CLASS="envar"
27720
>$CPPPATH</CODE
27721
> construction variable
27722
when the <CODE
27723
CLASS="envar"
27724
>$RCINCFLAGS</CODE
27725
> variable is expanded.
27726
</P
27727
></DD
27728
><DT
27729
><A
27730
NAME="cv-RCINCSUFFIX"
27731
></A
27732
><CODE
27733
CLASS="envar"
27734
>RCINCSUFFIX</CODE
27735
></DT
27736
><DD
27737
><P
27738
>&#13;The suffix used to specify an include directory
27739
on the resource compiler command line.
27740
This will be appended to the end of each directory
27741
in the <CODE
27742
CLASS="envar"
27743
>$CPPPATH</CODE
27744
> construction variable
27745
when the <CODE
27746
CLASS="envar"
27747
>$RCINCFLAGS</CODE
27748
> variable is expanded.
27749
</P
27750
></DD
27751
><DT
27752
><A
27753
NAME="cv-RCS"
27754
></A
27755
><CODE
27756
CLASS="envar"
27757
>RCS</CODE
27758
></DT
27759
><DD
27760
><P
27761
>&#13;The RCS executable.
27762
Note that this variable is not actually used
27763
for the command to fetch source files from RCS;
27764
see the
27765
<A
27766
HREF="#cv-RCS_CO"
27767
><CODE
27768
CLASS="envar"
27769
>$RCS_CO</CODE
27770
></A
27771
>
27772
construction variable, below.
27773
</P
27774
></DD
27775
><DT
27776
><A
27777
NAME="cv-RCS_CO"
27778
></A
27779
><CODE
27780
CLASS="envar"
27781
>RCS_CO</CODE
27782
></DT
27783
><DD
27784
><P
27785
>&#13;The RCS "checkout" executable,
27786
used to fetch source files from RCS.
27787
</P
27788
></DD
27789
><DT
27790
><A
27791
NAME="cv-RCS_COCOM"
27792
></A
27793
><CODE
27794
CLASS="envar"
27795
>RCS_COCOM</CODE
27796
></DT
27797
><DD
27798
><P
27799
>&#13;The command line used to
27800
fetch (checkout) source files from RCS.
27801
</P
27802
></DD
27803
><DT
27804
><A
27805
NAME="cv-RCS_COCOMSTR"
27806
></A
27807
><CODE
27808
CLASS="envar"
27809
>RCS_COCOMSTR</CODE
27810
></DT
27811
><DD
27812
><P
27813
>&#13;The string displayed when fetching
27814
a source file from RCS.
27815
If this is not set, then <A
27816
HREF="#cv-RCS_COCOM"
27817
><CODE
27818
CLASS="envar"
27819
>$RCS_COCOM</CODE
27820
></A
27821
>
27822
(the command line) is displayed.
27823
</P
27824
></DD
27825
><DT
27826
><A
27827
NAME="cv-RCS_COFLAGS"
27828
></A
27829
><CODE
27830
CLASS="envar"
27831
>RCS_COFLAGS</CODE
27832
></DT
27833
><DD
27834
><P
27835
>&#13;Options that are passed to the <A
27836
HREF="#cv-RCS_CO"
27837
><CODE
27838
CLASS="envar"
27839
>$RCS_CO</CODE
27840
></A
27841
> command.
27842
</P
27843
></DD
27844
><DT
27845
><A
27846
NAME="cv-RDirs"
27847
></A
27848
><CODE
27849
CLASS="envar"
27850
>RDirs</CODE
27851
></DT
27852
><DD
27853
><P
27854
>&#13;A function that converts a string into a list of Dir instances by
27855
searching the repositories.
27856
</P
27857
></DD
27858
><DT
27859
><A
27860
NAME="cv-REGSVR"
27861
></A
27862
><CODE
27863
CLASS="envar"
27864
>REGSVR</CODE
27865
></DT
27866
><DD
27867
><P
27868
>&#13;The program used on Windows systems
27869
to register a newly-built DLL library
27870
whenever the <CODE
27871
CLASS="function"
27872
>SharedLibrary</CODE
27873
> builder
27874
is passed a keyword argument of <TT
27875
CLASS="literal"
27876
>register=1</TT
27877
>.
27878
</P
27879
></DD
27880
><DT
27881
><A
27882
NAME="cv-REGSVRCOM"
27883
></A
27884
><CODE
27885
CLASS="envar"
27886
>REGSVRCOM</CODE
27887
></DT
27888
><DD
27889
><P
27890
>&#13;The command line used on Windows systems
27891
to register a newly-built DLL library
27892
whenever the <CODE
27893
CLASS="function"
27894
>SharedLibrary</CODE
27895
> builder
27896
is passed a keyword argument of <TT
27897
CLASS="literal"
27898
>register=1</TT
27899
>.
27900
</P
27901
></DD
27902
><DT
27903
><A
27904
NAME="cv-REGSVRCOMSTR"
27905
></A
27906
><CODE
27907
CLASS="envar"
27908
>REGSVRCOMSTR</CODE
27909
></DT
27910
><DD
27911
><P
27912
>&#13;The string displayed when registering a newly-built DLL file.
27913
If this is not set, then <A
27914
HREF="#cv-REGSVRCOM"
27915
><CODE
27916
CLASS="envar"
27917
>$REGSVRCOM</CODE
27918
></A
27919
> (the command line) is displayed.
27920
</P
27921
></DD
27922
><DT
27923
><A
27924
NAME="cv-REGSVRFLAGS"
27925
></A
27926
><CODE
27927
CLASS="envar"
27928
>REGSVRFLAGS</CODE
27929
></DT
27930
><DD
27931
><P
27932
>&#13;Flags passed to the DLL registration program
27933
on Windows systems when a newly-built DLL library is registered.
27934
By default,
27935
this includes the <CODE
27936
CLASS="option"
27937
>/s</CODE
27938
>
27939
that prevents dialog boxes from popping up
27940
and requiring user attention.
27941
</P
27942
></DD
27943
><DT
27944
><A
27945
NAME="cv-RMIC"
27946
></A
27947
><CODE
27948
CLASS="envar"
27949
>RMIC</CODE
27950
></DT
27951
><DD
27952
><P
27953
>&#13;The Java RMI stub compiler.
27954
</P
27955
></DD
27956
><DT
27957
><A
27958
NAME="cv-RMICCOM"
27959
></A
27960
><CODE
27961
CLASS="envar"
27962
>RMICCOM</CODE
27963
></DT
27964
><DD
27965
><P
27966
>&#13;The command line used to compile stub
27967
and skeleton class files
27968
from Java classes that contain RMI implementations.
27969
Any options specified in the <A
27970
HREF="#cv-RMICFLAGS"
27971
><CODE
27972
CLASS="envar"
27973
>$RMICFLAGS</CODE
27974
></A
27975
> construction variable
27976
are included on this command line.
27977
</P
27978
></DD
27979
><DT
27980
><A
27981
NAME="cv-RMICCOMSTR"
27982
></A
27983
><CODE
27984
CLASS="envar"
27985
>RMICCOMSTR</CODE
27986
></DT
27987
><DD
27988
><P
27989
>&#13;The string displayed when compiling
27990
stub and skeleton class files
27991
from Java classes that contain RMI implementations.
27992
If this is not set, then <A
27993
HREF="#cv-RMICCOM"
27994
><CODE
27995
CLASS="envar"
27996
>$RMICCOM</CODE
27997
></A
27998
> (the command line) is displayed.
27999
</P
28000
><PRE
28001
CLASS="programlisting"
28002
>&#13;env = Environment(RMICCOMSTR = "Generating stub/skeleton class files $TARGETS from $SOURCES")
28003
</PRE
28004
></DD
28005
><DT
28006
><A
28007
NAME="cv-RMICFLAGS"
28008
></A
28009
><CODE
28010
CLASS="envar"
28011
>RMICFLAGS</CODE
28012
></DT
28013
><DD
28014
><P
28015
>&#13;General options passed to the Java RMI stub compiler.
28016
</P
28017
></DD
28018
><DT
28019
><A
28020
NAME="cv-_RPATH"
28021
></A
28022
><CODE
28023
CLASS="envar"
28024
>_RPATH</CODE
28025
></DT
28026
><DD
28027
><P
28028
>&#13;An automatically-generated construction variable
28029
containing the rpath flags to be used when linking
28030
a program with shared libraries.
28031
The value of <CODE
28032
CLASS="envar"
28033
>$_RPATH</CODE
28034
> is created
28035
by appending <CODE
28036
CLASS="envar"
28037
>$RPATHPREFIX</CODE
28038
> and <CODE
28039
CLASS="envar"
28040
>$RPATHSUFFIX</CODE
28041
>
28042
to the beginning and end
28043
of each directory in <CODE
28044
CLASS="envar"
28045
>$RPATH</CODE
28046
>.
28047
</P
28048
></DD
28049
><DT
28050
><A
28051
NAME="cv-RPATH"
28052
></A
28053
><CODE
28054
CLASS="envar"
28055
>RPATH</CODE
28056
></DT
28057
><DD
28058
><P
28059
>&#13;A list of paths to search for shared libraries when running programs.
28060
Currently only used in the GNU (gnulink),
28061
IRIX (sgilink) and Sun (sunlink) linkers.
28062
Ignored on platforms and toolchains that don't support it.
28063
Note that the paths added to RPATH
28064
are not transformed by
28065
<SPAN
28066
CLASS="application"
28067
>scons</SPAN
28068
>
28069
in any way:  if you want an absolute
28070
path, you must make it absolute yourself.
28071
</P
28072
></DD
28073
><DT
28074
><A
28075
NAME="cv-RPATHPREFIX"
28076
></A
28077
><CODE
28078
CLASS="envar"
28079
>RPATHPREFIX</CODE
28080
></DT
28081
><DD
28082
><P
28083
>&#13;The prefix used to specify a directory to be searched for
28084
shared libraries when running programs.
28085
This will be appended to the beginning of each directory
28086
in the <CODE
28087
CLASS="envar"
28088
>$RPATH</CODE
28089
> construction variable
28090
when the <CODE
28091
CLASS="envar"
28092
>$_RPATH</CODE
28093
> variable is automatically generated.
28094
</P
28095
></DD
28096
><DT
28097
><A
28098
NAME="cv-RPATHSUFFIX"
28099
></A
28100
><CODE
28101
CLASS="envar"
28102
>RPATHSUFFIX</CODE
28103
></DT
28104
><DD
28105
><P
28106
>&#13;The suffix used to specify a directory to be searched for
28107
shared libraries when running programs.
28108
This will be appended to the end of each directory
28109
in the <CODE
28110
CLASS="envar"
28111
>$RPATH</CODE
28112
> construction variable
28113
when the <CODE
28114
CLASS="envar"
28115
>$_RPATH</CODE
28116
> variable is automatically generated.
28117
</P
28118
></DD
28119
><DT
28120
><A
28121
NAME="cv-RPCGEN"
28122
></A
28123
><CODE
28124
CLASS="envar"
28125
>RPCGEN</CODE
28126
></DT
28127
><DD
28128
><P
28129
>&#13;The RPC protocol compiler.
28130
</P
28131
></DD
28132
><DT
28133
><A
28134
NAME="cv-RPCGENCLIENTFLAGS"
28135
></A
28136
><CODE
28137
CLASS="envar"
28138
>RPCGENCLIENTFLAGS</CODE
28139
></DT
28140
><DD
28141
><P
28142
>&#13;Options passed to the RPC protocol compiler
28143
when generating client side stubs.
28144
These are in addition to any flags specified in the
28145
<A
28146
HREF="#cv-RPCGENFLAGS"
28147
><CODE
28148
CLASS="envar"
28149
>$RPCGENFLAGS</CODE
28150
></A
28151
>
28152
construction variable.
28153
</P
28154
></DD
28155
><DT
28156
><A
28157
NAME="cv-RPCGENFLAGS"
28158
></A
28159
><CODE
28160
CLASS="envar"
28161
>RPCGENFLAGS</CODE
28162
></DT
28163
><DD
28164
><P
28165
>&#13;General options passed to the RPC protocol compiler.
28166
</P
28167
></DD
28168
><DT
28169
><A
28170
NAME="cv-RPCGENHEADERFLAGS"
28171
></A
28172
><CODE
28173
CLASS="envar"
28174
>RPCGENHEADERFLAGS</CODE
28175
></DT
28176
><DD
28177
><P
28178
>&#13;Options passed to the RPC protocol compiler
28179
when generating a header file.
28180
These are in addition to any flags specified in the
28181
<A
28182
HREF="#cv-RPCGENFLAGS"
28183
><CODE
28184
CLASS="envar"
28185
>$RPCGENFLAGS</CODE
28186
></A
28187
>
28188
construction variable.
28189
</P
28190
></DD
28191
><DT
28192
><A
28193
NAME="cv-RPCGENSERVICEFLAGS"
28194
></A
28195
><CODE
28196
CLASS="envar"
28197
>RPCGENSERVICEFLAGS</CODE
28198
></DT
28199
><DD
28200
><P
28201
>&#13;Options passed to the RPC protocol compiler
28202
when generating server side stubs.
28203
These are in addition to any flags specified in the
28204
<A
28205
HREF="#cv-RPCGENFLAGS"
28206
><CODE
28207
CLASS="envar"
28208
>$RPCGENFLAGS</CODE
28209
></A
28210
>
28211
construction variable.
28212
</P
28213
></DD
28214
><DT
28215
><A
28216
NAME="cv-RPCGENXDRFLAGS"
28217
></A
28218
><CODE
28219
CLASS="envar"
28220
>RPCGENXDRFLAGS</CODE
28221
></DT
28222
><DD
28223
><P
28224
>&#13;Options passed to the RPC protocol compiler
28225
when generating XDR routines.
28226
These are in addition to any flags specified in the
28227
<A
28228
HREF="#cv-RPCGENFLAGS"
28229
><CODE
28230
CLASS="envar"
28231
>$RPCGENFLAGS</CODE
28232
></A
28233
>
28234
construction variable.
28235
</P
28236
></DD
28237
><DT
28238
><A
28239
NAME="cv-SCANNERS"
28240
></A
28241
><CODE
28242
CLASS="envar"
28243
>SCANNERS</CODE
28244
></DT
28245
><DD
28246
><P
28247
>&#13;A list of the available implicit dependency scanners.
28248
New file scanners may be added by
28249
appending to this list,
28250
although the more flexible approach
28251
is to associate scanners
28252
with a specific Builder.
28253
See the sections "Builder Objects"
28254
and "Scanner Objects,"
28255
below, for more information.
28256
</P
28257
></DD
28258
><DT
28259
><A
28260
NAME="cv-SCCS"
28261
></A
28262
><CODE
28263
CLASS="envar"
28264
>SCCS</CODE
28265
></DT
28266
><DD
28267
><P
28268
>&#13;The SCCS executable.
28269
</P
28270
></DD
28271
><DT
28272
><A
28273
NAME="cv-SCCSCOM"
28274
></A
28275
><CODE
28276
CLASS="envar"
28277
>SCCSCOM</CODE
28278
></DT
28279
><DD
28280
><P
28281
>&#13;The command line used to
28282
fetch source files from SCCS.
28283
</P
28284
></DD
28285
><DT
28286
><A
28287
NAME="cv-SCCSCOMSTR"
28288
></A
28289
><CODE
28290
CLASS="envar"
28291
>SCCSCOMSTR</CODE
28292
></DT
28293
><DD
28294
><P
28295
>&#13;The string displayed when fetching
28296
a source file from a CVS repository.
28297
If this is not set, then <A
28298
HREF="#cv-SCCSCOM"
28299
><CODE
28300
CLASS="envar"
28301
>$SCCSCOM</CODE
28302
></A
28303
>
28304
(the command line) is displayed.
28305
</P
28306
></DD
28307
><DT
28308
><A
28309
NAME="cv-SCCSFLAGS"
28310
></A
28311
><CODE
28312
CLASS="envar"
28313
>SCCSFLAGS</CODE
28314
></DT
28315
><DD
28316
><P
28317
>&#13;General options that are passed to SCCS.
28318
</P
28319
></DD
28320
><DT
28321
><A
28322
NAME="cv-SCCSGETFLAGS"
28323
></A
28324
><CODE
28325
CLASS="envar"
28326
>SCCSGETFLAGS</CODE
28327
></DT
28328
><DD
28329
><P
28330
>&#13;Options that are passed specifically to the SCCS "get" subcommand.
28331
This can be set, for example, to
28332
<CODE
28333
CLASS="option"
28334
>-e</CODE
28335
>
28336
to check out editable files from SCCS.
28337
</P
28338
></DD
28339
><DT
28340
><A
28341
NAME="cv-SCONS_HOME"
28342
></A
28343
><CODE
28344
CLASS="envar"
28345
>SCONS_HOME</CODE
28346
></DT
28347
><DD
28348
><P
28349
>&#13;The (optional) path to the SCons library directory,
28350
initialized from the external environment.
28351
If set, this is used to construct a shorter and more
28352
efficient search path in the
28353
<A
28354
HREF="#cv-MSVSSCONS"
28355
><CODE
28356
CLASS="envar"
28357
>$MSVSSCONS</CODE
28358
></A
28359
>
28360
command line executed
28361
from Microsoft Visual Studio project files.
28362
</P
28363
></DD
28364
><DT
28365
><A
28366
NAME="cv-SHCC"
28367
></A
28368
><CODE
28369
CLASS="envar"
28370
>SHCC</CODE
28371
></DT
28372
><DD
28373
><P
28374
>&#13;The C compiler used for generating shared-library objects.
28375
</P
28376
></DD
28377
><DT
28378
><A
28379
NAME="cv-SHCCCOM"
28380
></A
28381
><CODE
28382
CLASS="envar"
28383
>SHCCCOM</CODE
28384
></DT
28385
><DD
28386
><P
28387
>&#13;The command line used to compile a C source file
28388
to a shared-library object file.
28389
Any options specified in the <A
28390
HREF="#cv-SHCFLAGS"
28391
><CODE
28392
CLASS="envar"
28393
>$SHCFLAGS</CODE
28394
></A
28395
>,
28396
<A
28397
HREF="#cv-SHCCFLAGS"
28398
><CODE
28399
CLASS="envar"
28400
>$SHCCFLAGS</CODE
28401
></A
28402
> and
28403
<A
28404
HREF="#cv-CPPFLAGS"
28405
><CODE
28406
CLASS="envar"
28407
>$CPPFLAGS</CODE
28408
></A
28409
> construction variables
28410
are included on this command line.
28411
</P
28412
></DD
28413
><DT
28414
><A
28415
NAME="cv-SHCCCOMSTR"
28416
></A
28417
><CODE
28418
CLASS="envar"
28419
>SHCCCOMSTR</CODE
28420
></DT
28421
><DD
28422
><P
28423
>&#13;The string displayed when a C source file
28424
is compiled to a shared object file.
28425
If this is not set, then <A
28426
HREF="#cv-SHCCCOM"
28427
><CODE
28428
CLASS="envar"
28429
>$SHCCCOM</CODE
28430
></A
28431
> (the command line) is displayed.
28432
</P
28433
><PRE
28434
CLASS="programlisting"
28435
>&#13;env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET")
28436
</PRE
28437
></DD
28438
><DT
28439
><A
28440
NAME="cv-SHCCFLAGS"
28441
></A
28442
><CODE
28443
CLASS="envar"
28444
>SHCCFLAGS</CODE
28445
></DT
28446
><DD
28447
><P
28448
>&#13;Options that are passed to the C and C++ compilers
28449
to generate shared-library objects.
28450
</P
28451
></DD
28452
><DT
28453
><A
28454
NAME="cv-SHCFLAGS"
28455
></A
28456
><CODE
28457
CLASS="envar"
28458
>SHCFLAGS</CODE
28459
></DT
28460
><DD
28461
><P
28462
>&#13;Options that are passed to the C compiler (only; not C++)
28463
to generate shared-library objects.
28464
</P
28465
></DD
28466
><DT
28467
><A
28468
NAME="cv-SHCXX"
28469
></A
28470
><CODE
28471
CLASS="envar"
28472
>SHCXX</CODE
28473
></DT
28474
><DD
28475
><P
28476
>&#13;The C++ compiler used for generating shared-library objects.
28477
</P
28478
></DD
28479
><DT
28480
><A
28481
NAME="cv-SHCXXCOM"
28482
></A
28483
><CODE
28484
CLASS="envar"
28485
>SHCXXCOM</CODE
28486
></DT
28487
><DD
28488
><P
28489
>&#13;The command line used to compile a C++ source file
28490
to a shared-library object file.
28491
Any options specified in the <A
28492
HREF="#cv-SHCXXFLAGS"
28493
><CODE
28494
CLASS="envar"
28495
>$SHCXXFLAGS</CODE
28496
></A
28497
> and
28498
<A
28499
HREF="#cv-CPPFLAGS"
28500
><CODE
28501
CLASS="envar"
28502
>$CPPFLAGS</CODE
28503
></A
28504
> construction variables
28505
are included on this command line.
28506
</P
28507
></DD
28508
><DT
28509
><A
28510
NAME="cv-SHCXXCOMSTR"
28511
></A
28512
><CODE
28513
CLASS="envar"
28514
>SHCXXCOMSTR</CODE
28515
></DT
28516
><DD
28517
><P
28518
>&#13;The string displayed when a C++ source file
28519
is compiled to a shared object file.
28520
If this is not set, then <A
28521
HREF="#cv-SHCXXCOM"
28522
><CODE
28523
CLASS="envar"
28524
>$SHCXXCOM</CODE
28525
></A
28526
> (the command line) is displayed.
28527
</P
28528
><PRE
28529
CLASS="programlisting"
28530
>&#13;env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET")
28531
</PRE
28532
></DD
28533
><DT
28534
><A
28535
NAME="cv-SHCXXFLAGS"
28536
></A
28537
><CODE
28538
CLASS="envar"
28539
>SHCXXFLAGS</CODE
28540
></DT
28541
><DD
28542
><P
28543
>&#13;Options that are passed to the C++ compiler
28544
to generate shared-library objects.
28545
</P
28546
></DD
28547
><DT
28548
><A
28549
NAME="cv-SHELL"
28550
></A
28551
><CODE
28552
CLASS="envar"
28553
>SHELL</CODE
28554
></DT
28555
><DD
28556
><P
28557
>&#13;A string naming the shell program that will be passed to the
28558
<CODE
28559
CLASS="envar"
28560
>$SPAWN</CODE
28561
>
28562
function.
28563
See the
28564
<CODE
28565
CLASS="envar"
28566
>$SPAWN</CODE
28567
>
28568
construction variable for more information.
28569
</P
28570
></DD
28571
><DT
28572
><A
28573
NAME="cv-SHF77"
28574
></A
28575
><CODE
28576
CLASS="envar"
28577
>SHF77</CODE
28578
></DT
28579
><DD
28580
><P
28581
>&#13;The Fortran 77 compiler used for generating shared-library objects.
28582
You should normally set the <A
28583
HREF="#cv-SHFORTRAN"
28584
><CODE
28585
CLASS="envar"
28586
>$SHFORTRAN</CODE
28587
></A
28588
> variable,
28589
which specifies the default Fortran compiler
28590
for all Fortran versions.
28591
You only need to set <A
28592
HREF="#cv-SHF77"
28593
><CODE
28594
CLASS="envar"
28595
>$SHF77</CODE
28596
></A
28597
> if you need to use a specific compiler
28598
or compiler version for Fortran 77 files.
28599
</P
28600
></DD
28601
><DT
28602
><A
28603
NAME="cv-SHF77COM"
28604
></A
28605
><CODE
28606
CLASS="envar"
28607
>SHF77COM</CODE
28608
></DT
28609
><DD
28610
><P
28611
>&#13;The command line used to compile a Fortran 77 source file
28612
to a shared-library object file.
28613
You only need to set <A
28614
HREF="#cv-SHF77COM"
28615
><CODE
28616
CLASS="envar"
28617
>$SHF77COM</CODE
28618
></A
28619
> if you need to use a specific
28620
command line for Fortran 77 files.
28621
You should normally set the <A
28622
HREF="#cv-SHFORTRANCOM"
28623
><CODE
28624
CLASS="envar"
28625
>$SHFORTRANCOM</CODE
28626
></A
28627
> variable,
28628
which specifies the default command line
28629
for all Fortran versions.
28630
</P
28631
></DD
28632
><DT
28633
><A
28634
NAME="cv-SHF77COMSTR"
28635
></A
28636
><CODE
28637
CLASS="envar"
28638
>SHF77COMSTR</CODE
28639
></DT
28640
><DD
28641
><P
28642
>&#13;The string displayed when a Fortran 77 source file
28643
is compiled to a shared-library object file.
28644
If this is not set, then <A
28645
HREF="#cv-SHF77COM"
28646
><CODE
28647
CLASS="envar"
28648
>$SHF77COM</CODE
28649
></A
28650
> or <A
28651
HREF="#cv-SHFORTRANCOM"
28652
><CODE
28653
CLASS="envar"
28654
>$SHFORTRANCOM</CODE
28655
></A
28656
>
28657
(the command line) is displayed.
28658
</P
28659
></DD
28660
><DT
28661
><A
28662
NAME="cv-SHF77FLAGS"
28663
></A
28664
><CODE
28665
CLASS="envar"
28666
>SHF77FLAGS</CODE
28667
></DT
28668
><DD
28669
><P
28670
>&#13;Options that are passed to the Fortran 77 compiler
28671
to generated shared-library objects.
28672
You only need to set <A
28673
HREF="#cv-SHF77FLAGS"
28674
><CODE
28675
CLASS="envar"
28676
>$SHF77FLAGS</CODE
28677
></A
28678
> if you need to define specific
28679
user options for Fortran 77 files.
28680
You should normally set the <A
28681
HREF="#cv-SHFORTRANFLAGS"
28682
><CODE
28683
CLASS="envar"
28684
>$SHFORTRANFLAGS</CODE
28685
></A
28686
> variable,
28687
which specifies the user-specified options
28688
passed to the default Fortran compiler
28689
for all Fortran versions.
28690
</P
28691
></DD
28692
><DT
28693
><A
28694
NAME="cv-SHF77PPCOM"
28695
></A
28696
><CODE
28697
CLASS="envar"
28698
>SHF77PPCOM</CODE
28699
></DT
28700
><DD
28701
><P
28702
>&#13;The command line used to compile a Fortran 77 source file to a
28703
shared-library object file
28704
after first running the file through the C preprocessor.
28705
Any options specified in the <A
28706
HREF="#cv-SHF77FLAGS"
28707
><CODE
28708
CLASS="envar"
28709
>$SHF77FLAGS</CODE
28710
></A
28711
> and <A
28712
HREF="#cv-CPPFLAGS"
28713
><CODE
28714
CLASS="envar"
28715
>$CPPFLAGS</CODE
28716
></A
28717
> construction variables
28718
are included on this command line.
28719
You only need to set <A
28720
HREF="#cv-SHF77PPCOM"
28721
><CODE
28722
CLASS="envar"
28723
>$SHF77PPCOM</CODE
28724
></A
28725
> if you need to use a specific
28726
C-preprocessor command line for Fortran 77 files.
28727
You should normally set the <A
28728
HREF="#cv-SHFORTRANPPCOM"
28729
><CODE
28730
CLASS="envar"
28731
>$SHFORTRANPPCOM</CODE
28732
></A
28733
> variable,
28734
which specifies the default C-preprocessor command line
28735
for all Fortran versions.
28736
</P
28737
></DD
28738
><DT
28739
><A
28740
NAME="cv-SHF77PPCOMSTR"
28741
></A
28742
><CODE
28743
CLASS="envar"
28744
>SHF77PPCOMSTR</CODE
28745
></DT
28746
><DD
28747
><P
28748
>&#13;The string displayed when a Fortran 77 source file
28749
is compiled to a shared-library object file
28750
after first running the file through the C preprocessor.
28751
If this is not set, then <A
28752
HREF="#cv-SHF77PPCOM"
28753
><CODE
28754
CLASS="envar"
28755
>$SHF77PPCOM</CODE
28756
></A
28757
> or <A
28758
HREF="#cv-SHFORTRANPPCOM"
28759
><CODE
28760
CLASS="envar"
28761
>$SHFORTRANPPCOM</CODE
28762
></A
28763
>
28764
(the command line) is displayed.
28765
</P
28766
></DD
28767
><DT
28768
><A
28769
NAME="cv-SHF90"
28770
></A
28771
><CODE
28772
CLASS="envar"
28773
>SHF90</CODE
28774
></DT
28775
><DD
28776
><P
28777
>&#13;The Fortran 90 compiler used for generating shared-library objects.
28778
You should normally set the <A
28779
HREF="#cv-SHFORTRAN"
28780
><CODE
28781
CLASS="envar"
28782
>$SHFORTRAN</CODE
28783
></A
28784
> variable,
28785
which specifies the default Fortran compiler
28786
for all Fortran versions.
28787
You only need to set <A
28788
HREF="#cv-SHF90"
28789
><CODE
28790
CLASS="envar"
28791
>$SHF90</CODE
28792
></A
28793
> if you need to use a specific compiler
28794
or compiler version for Fortran 90 files.
28795
</P
28796
></DD
28797
><DT
28798
><A
28799
NAME="cv-SHF90COM"
28800
></A
28801
><CODE
28802
CLASS="envar"
28803
>SHF90COM</CODE
28804
></DT
28805
><DD
28806
><P
28807
>&#13;The command line used to compile a Fortran 90 source file
28808
to a shared-library object file.
28809
You only need to set <A
28810
HREF="#cv-SHF90COM"
28811
><CODE
28812
CLASS="envar"
28813
>$SHF90COM</CODE
28814
></A
28815
> if you need to use a specific
28816
command line for Fortran 90 files.
28817
You should normally set the <A
28818
HREF="#cv-SHFORTRANCOM"
28819
><CODE
28820
CLASS="envar"
28821
>$SHFORTRANCOM</CODE
28822
></A
28823
> variable,
28824
which specifies the default command line
28825
for all Fortran versions.
28826
</P
28827
></DD
28828
><DT
28829
><A
28830
NAME="cv-SHF90COMSTR"
28831
></A
28832
><CODE
28833
CLASS="envar"
28834
>SHF90COMSTR</CODE
28835
></DT
28836
><DD
28837
><P
28838
>&#13;The string displayed when a Fortran 90 source file
28839
is compiled to a shared-library object file.
28840
If this is not set, then <A
28841
HREF="#cv-SHF90COM"
28842
><CODE
28843
CLASS="envar"
28844
>$SHF90COM</CODE
28845
></A
28846
> or <A
28847
HREF="#cv-SHFORTRANCOM"
28848
><CODE
28849
CLASS="envar"
28850
>$SHFORTRANCOM</CODE
28851
></A
28852
>
28853
(the command line) is displayed.
28854
</P
28855
></DD
28856
><DT
28857
><A
28858
NAME="cv-SHF90FLAGS"
28859
></A
28860
><CODE
28861
CLASS="envar"
28862
>SHF90FLAGS</CODE
28863
></DT
28864
><DD
28865
><P
28866
>&#13;Options that are passed to the Fortran 90 compiler
28867
to generated shared-library objects.
28868
You only need to set <A
28869
HREF="#cv-SHF90FLAGS"
28870
><CODE
28871
CLASS="envar"
28872
>$SHF90FLAGS</CODE
28873
></A
28874
> if you need to define specific
28875
user options for Fortran 90 files.
28876
You should normally set the <A
28877
HREF="#cv-SHFORTRANFLAGS"
28878
><CODE
28879
CLASS="envar"
28880
>$SHFORTRANFLAGS</CODE
28881
></A
28882
> variable,
28883
which specifies the user-specified options
28884
passed to the default Fortran compiler
28885
for all Fortran versions.
28886
</P
28887
></DD
28888
><DT
28889
><A
28890
NAME="cv-SHF90PPCOM"
28891
></A
28892
><CODE
28893
CLASS="envar"
28894
>SHF90PPCOM</CODE
28895
></DT
28896
><DD
28897
><P
28898
>&#13;The command line used to compile a Fortran 90 source file to a
28899
shared-library object file
28900
after first running the file through the C preprocessor.
28901
Any options specified in the <A
28902
HREF="#cv-SHF90FLAGS"
28903
><CODE
28904
CLASS="envar"
28905
>$SHF90FLAGS</CODE
28906
></A
28907
> and <A
28908
HREF="#cv-CPPFLAGS"
28909
><CODE
28910
CLASS="envar"
28911
>$CPPFLAGS</CODE
28912
></A
28913
> construction variables
28914
are included on this command line.
28915
You only need to set <A
28916
HREF="#cv-SHF90PPCOM"
28917
><CODE
28918
CLASS="envar"
28919
>$SHF90PPCOM</CODE
28920
></A
28921
> if you need to use a specific
28922
C-preprocessor command line for Fortran 90 files.
28923
You should normally set the <A
28924
HREF="#cv-SHFORTRANPPCOM"
28925
><CODE
28926
CLASS="envar"
28927
>$SHFORTRANPPCOM</CODE
28928
></A
28929
> variable,
28930
which specifies the default C-preprocessor command line
28931
for all Fortran versions.
28932
</P
28933
></DD
28934
><DT
28935
><A
28936
NAME="cv-SHF90PPCOMSTR"
28937
></A
28938
><CODE
28939
CLASS="envar"
28940
>SHF90PPCOMSTR</CODE
28941
></DT
28942
><DD
28943
><P
28944
>&#13;The string displayed when a Fortran 90 source file
28945
is compiled to a shared-library object file
28946
after first running the file through the C preprocessor.
28947
If this is not set, then <A
28948
HREF="#cv-SHF90PPCOM"
28949
><CODE
28950
CLASS="envar"
28951
>$SHF90PPCOM</CODE
28952
></A
28953
> or <A
28954
HREF="#cv-SHFORTRANPPCOM"
28955
><CODE
28956
CLASS="envar"
28957
>$SHFORTRANPPCOM</CODE
28958
></A
28959
>
28960
(the command line) is displayed.
28961
</P
28962
></DD
28963
><DT
28964
><A
28965
NAME="cv-SHF95"
28966
></A
28967
><CODE
28968
CLASS="envar"
28969
>SHF95</CODE
28970
></DT
28971
><DD
28972
><P
28973
>&#13;The Fortran 95 compiler used for generating shared-library objects.
28974
You should normally set the <A
28975
HREF="#cv-SHFORTRAN"
28976
><CODE
28977
CLASS="envar"
28978
>$SHFORTRAN</CODE
28979
></A
28980
> variable,
28981
which specifies the default Fortran compiler
28982
for all Fortran versions.
28983
You only need to set <A
28984
HREF="#cv-SHF95"
28985
><CODE
28986
CLASS="envar"
28987
>$SHF95</CODE
28988
></A
28989
> if you need to use a specific compiler
28990
or compiler version for Fortran 95 files.
28991
</P
28992
></DD
28993
><DT
28994
><A
28995
NAME="cv-SHF95COM"
28996
></A
28997
><CODE
28998
CLASS="envar"
28999
>SHF95COM</CODE
29000
></DT
29001
><DD
29002
><P
29003
>&#13;The command line used to compile a Fortran 95 source file
29004
to a shared-library object file.
29005
You only need to set <A
29006
HREF="#cv-SHF95COM"
29007
><CODE
29008
CLASS="envar"
29009
>$SHF95COM</CODE
29010
></A
29011
> if you need to use a specific
29012
command line for Fortran 95 files.
29013
You should normally set the <A
29014
HREF="#cv-SHFORTRANCOM"
29015
><CODE
29016
CLASS="envar"
29017
>$SHFORTRANCOM</CODE
29018
></A
29019
> variable,
29020
which specifies the default command line
29021
for all Fortran versions.
29022
</P
29023
></DD
29024
><DT
29025
><A
29026
NAME="cv-SHF95COMSTR"
29027
></A
29028
><CODE
29029
CLASS="envar"
29030
>SHF95COMSTR</CODE
29031
></DT
29032
><DD
29033
><P
29034
>&#13;The string displayed when a Fortran 95 source file
29035
is compiled to a shared-library object file.
29036
If this is not set, then <A
29037
HREF="#cv-SHF95COM"
29038
><CODE
29039
CLASS="envar"
29040
>$SHF95COM</CODE
29041
></A
29042
> or <A
29043
HREF="#cv-SHFORTRANCOM"
29044
><CODE
29045
CLASS="envar"
29046
>$SHFORTRANCOM</CODE
29047
></A
29048
>
29049
(the command line) is displayed.
29050
</P
29051
></DD
29052
><DT
29053
><A
29054
NAME="cv-SHF95FLAGS"
29055
></A
29056
><CODE
29057
CLASS="envar"
29058
>SHF95FLAGS</CODE
29059
></DT
29060
><DD
29061
><P
29062
>&#13;Options that are passed to the Fortran 95 compiler
29063
to generated shared-library objects.
29064
You only need to set <A
29065
HREF="#cv-SHF95FLAGS"
29066
><CODE
29067
CLASS="envar"
29068
>$SHF95FLAGS</CODE
29069
></A
29070
> if you need to define specific
29071
user options for Fortran 95 files.
29072
You should normally set the <A
29073
HREF="#cv-SHFORTRANFLAGS"
29074
><CODE
29075
CLASS="envar"
29076
>$SHFORTRANFLAGS</CODE
29077
></A
29078
> variable,
29079
which specifies the user-specified options
29080
passed to the default Fortran compiler
29081
for all Fortran versions.
29082
</P
29083
></DD
29084
><DT
29085
><A
29086
NAME="cv-SHF95PPCOM"
29087
></A
29088
><CODE
29089
CLASS="envar"
29090
>SHF95PPCOM</CODE
29091
></DT
29092
><DD
29093
><P
29094
>&#13;The command line used to compile a Fortran 95 source file to a
29095
shared-library object file
29096
after first running the file through the C preprocessor.
29097
Any options specified in the <A
29098
HREF="#cv-SHF95FLAGS"
29099
><CODE
29100
CLASS="envar"
29101
>$SHF95FLAGS</CODE
29102
></A
29103
> and <A
29104
HREF="#cv-CPPFLAGS"
29105
><CODE
29106
CLASS="envar"
29107
>$CPPFLAGS</CODE
29108
></A
29109
> construction variables
29110
are included on this command line.
29111
You only need to set <A
29112
HREF="#cv-SHF95PPCOM"
29113
><CODE
29114
CLASS="envar"
29115
>$SHF95PPCOM</CODE
29116
></A
29117
> if you need to use a specific
29118
C-preprocessor command line for Fortran 95 files.
29119
You should normally set the <A
29120
HREF="#cv-SHFORTRANPPCOM"
29121
><CODE
29122
CLASS="envar"
29123
>$SHFORTRANPPCOM</CODE
29124
></A
29125
> variable,
29126
which specifies the default C-preprocessor command line
29127
for all Fortran versions.
29128
</P
29129
></DD
29130
><DT
29131
><A
29132
NAME="cv-SHF95PPCOMSTR"
29133
></A
29134
><CODE
29135
CLASS="envar"
29136
>SHF95PPCOMSTR</CODE
29137
></DT
29138
><DD
29139
><P
29140
>&#13;The string displayed when a Fortran 95 source file
29141
is compiled to a shared-library object file
29142
after first running the file through the C preprocessor.
29143
If this is not set, then <A
29144
HREF="#cv-SHF95PPCOM"
29145
><CODE
29146
CLASS="envar"
29147
>$SHF95PPCOM</CODE
29148
></A
29149
> or <A
29150
HREF="#cv-SHFORTRANPPCOM"
29151
><CODE
29152
CLASS="envar"
29153
>$SHFORTRANPPCOM</CODE
29154
></A
29155
>
29156
(the command line) is displayed.
29157
</P
29158
></DD
29159
><DT
29160
><A
29161
NAME="cv-SHFORTRAN"
29162
></A
29163
><CODE
29164
CLASS="envar"
29165
>SHFORTRAN</CODE
29166
></DT
29167
><DD
29168
><P
29169
>&#13;The default Fortran compiler used for generating shared-library objects.
29170
</P
29171
></DD
29172
><DT
29173
><A
29174
NAME="cv-SHFORTRANCOM"
29175
></A
29176
><CODE
29177
CLASS="envar"
29178
>SHFORTRANCOM</CODE
29179
></DT
29180
><DD
29181
><P
29182
>&#13;The command line used to compile a Fortran source file
29183
to a shared-library object file.
29184
</P
29185
></DD
29186
><DT
29187
><A
29188
NAME="cv-SHFORTRANCOMSTR"
29189
></A
29190
><CODE
29191
CLASS="envar"
29192
>SHFORTRANCOMSTR</CODE
29193
></DT
29194
><DD
29195
><P
29196
>&#13;The string displayed when a Fortran source file
29197
is compiled to a shared-library object file.
29198
If this is not set, then <A
29199
HREF="#cv-SHFORTRANCOM"
29200
><CODE
29201
CLASS="envar"
29202
>$SHFORTRANCOM</CODE
29203
></A
29204
>
29205
(the command line) is displayed.
29206
</P
29207
></DD
29208
><DT
29209
><A
29210
NAME="cv-SHFORTRANFLAGS"
29211
></A
29212
><CODE
29213
CLASS="envar"
29214
>SHFORTRANFLAGS</CODE
29215
></DT
29216
><DD
29217
><P
29218
>&#13;Options that are passed to the Fortran compiler
29219
to generate shared-library objects.
29220
</P
29221
></DD
29222
><DT
29223
><A
29224
NAME="cv-SHFORTRANPPCOM"
29225
></A
29226
><CODE
29227
CLASS="envar"
29228
>SHFORTRANPPCOM</CODE
29229
></DT
29230
><DD
29231
><P
29232
>&#13;The command line used to compile a Fortran source file to a
29233
shared-library object file
29234
after first running the file through the C preprocessor.
29235
Any options specified
29236
in the <A
29237
HREF="#cv-SHFORTRANFLAGS"
29238
><CODE
29239
CLASS="envar"
29240
>$SHFORTRANFLAGS</CODE
29241
></A
29242
> and
29243
<A
29244
HREF="#cv-CPPFLAGS"
29245
><CODE
29246
CLASS="envar"
29247
>$CPPFLAGS</CODE
29248
></A
29249
> construction variables
29250
are included on this command line.
29251
</P
29252
></DD
29253
><DT
29254
><A
29255
NAME="cv-SHFORTRANPPCOMSTR"
29256
></A
29257
><CODE
29258
CLASS="envar"
29259
>SHFORTRANPPCOMSTR</CODE
29260
></DT
29261
><DD
29262
><P
29263
>&#13;The string displayed when a Fortran source file
29264
is compiled to a shared-library object file
29265
after first running the file throught the C preprocessor.
29266
If this is not set, then <A
29267
HREF="#cv-SHFORTRANPPCOM"
29268
><CODE
29269
CLASS="envar"
29270
>$SHFORTRANPPCOM</CODE
29271
></A
29272
>
29273
(the command line) is displayed.
29274
</P
29275
></DD
29276
><DT
29277
><A
29278
NAME="cv-SHLIBPREFIX"
29279
></A
29280
><CODE
29281
CLASS="envar"
29282
>SHLIBPREFIX</CODE
29283
></DT
29284
><DD
29285
><P
29286
>&#13;The prefix used for shared library file names.
29287
</P
29288
></DD
29289
><DT
29290
><A
29291
NAME="cv-SHLIBSUFFIX"
29292
></A
29293
><CODE
29294
CLASS="envar"
29295
>SHLIBSUFFIX</CODE
29296
></DT
29297
><DD
29298
><P
29299
>&#13;The suffix used for shared library file names.
29300
</P
29301
></DD
29302
><DT
29303
><A
29304
NAME="cv-SHLINK"
29305
></A
29306
><CODE
29307
CLASS="envar"
29308
>SHLINK</CODE
29309
></DT
29310
><DD
29311
><P
29312
>&#13;The linker for programs that use shared libraries.
29313
</P
29314
></DD
29315
><DT
29316
><A
29317
NAME="cv-SHLINKCOM"
29318
></A
29319
><CODE
29320
CLASS="envar"
29321
>SHLINKCOM</CODE
29322
></DT
29323
><DD
29324
><P
29325
>&#13;The command line used to link programs using shared libaries.
29326
</P
29327
></DD
29328
><DT
29329
><A
29330
NAME="cv-SHLINKCOMSTR"
29331
></A
29332
><CODE
29333
CLASS="envar"
29334
>SHLINKCOMSTR</CODE
29335
></DT
29336
><DD
29337
><P
29338
>&#13;The string displayed when programs using shared libraries are linked.
29339
If this is not set, then <A
29340
HREF="#cv-SHLINKCOM"
29341
><CODE
29342
CLASS="envar"
29343
>$SHLINKCOM</CODE
29344
></A
29345
> (the command line) is displayed.
29346
</P
29347
><PRE
29348
CLASS="programlisting"
29349
>&#13;env = Environment(SHLINKCOMSTR = "Linking shared $TARGET")
29350
</PRE
29351
></DD
29352
><DT
29353
><A
29354
NAME="cv-SHLINKFLAGS"
29355
></A
29356
><CODE
29357
CLASS="envar"
29358
>SHLINKFLAGS</CODE
29359
></DT
29360
><DD
29361
><P
29362
>&#13;General user options passed to the linker for programs using shared libraries.
29363
Note that this variable should
29364
<SPAN
29365
CLASS="emphasis"
29366
><I
29367
CLASS="emphasis"
29368
>not</I
29369
></SPAN
29370
>
29371
contain
29372
<CODE
29373
CLASS="option"
29374
>-l</CODE
29375
>
29376
(or similar) options for linking with the libraries listed in <A
29377
HREF="#cv-LIBS"
29378
><CODE
29379
CLASS="envar"
29380
>$LIBS</CODE
29381
></A
29382
>,
29383
nor
29384
<CODE
29385
CLASS="option"
29386
>-L</CODE
29387
>
29388
(or similar) include search path options
29389
that scons generates automatically from <A
29390
HREF="#cv-LIBPATH"
29391
><CODE
29392
CLASS="envar"
29393
>$LIBPATH</CODE
29394
></A
29395
>.
29396
See
29397
<A
29398
HREF="#cv-_LIBFLAGS"
29399
><CODE
29400
CLASS="envar"
29401
>$_LIBFLAGS</CODE
29402
></A
29403
>
29404
above,
29405
for the variable that expands to library-link options,
29406
and
29407
<A
29408
HREF="#cv-_LIBDIRFLAGS"
29409
><CODE
29410
CLASS="envar"
29411
>$_LIBDIRFLAGS</CODE
29412
></A
29413
>
29414
above,
29415
for the variable that expands to library search path options.
29416
</P
29417
></DD
29418
><DT
29419
><A
29420
NAME="cv-SHOBJPREFIX"
29421
></A
29422
><CODE
29423
CLASS="envar"
29424
>SHOBJPREFIX</CODE
29425
></DT
29426
><DD
29427
><P
29428
>&#13;The prefix used for shared object file names.
29429
</P
29430
></DD
29431
><DT
29432
><A
29433
NAME="cv-SHOBJSUFFIX"
29434
></A
29435
><CODE
29436
CLASS="envar"
29437
>SHOBJSUFFIX</CODE
29438
></DT
29439
><DD
29440
><P
29441
>&#13;The suffix used for shared object file names.
29442
</P
29443
></DD
29444
><DT
29445
><A
29446
NAME="cv-SOURCE"
29447
></A
29448
><CODE
29449
CLASS="envar"
29450
>SOURCE</CODE
29451
></DT
29452
><DD
29453
><P
29454
>&#13;A reserved variable name
29455
that may not be set or used in a construction environment.
29456
(See "Variable Substitution," below.)
29457
</P
29458
></DD
29459
><DT
29460
><A
29461
NAME="cv-SOURCE_URL"
29462
></A
29463
><CODE
29464
CLASS="envar"
29465
>SOURCE_URL</CODE
29466
></DT
29467
><DD
29468
><P
29469
>&#13;The URL
29470
(web address)
29471
of the location from which the project was retrieved.
29472
This is used to fill in the
29473
<TT
29474
CLASS="literal"
29475
>Source:</TT
29476
>
29477
field in the controlling information for Ipkg and RPM packages.
29478
</P
29479
></DD
29480
><DT
29481
><A
29482
NAME="cv-SOURCES"
29483
></A
29484
><CODE
29485
CLASS="envar"
29486
>SOURCES</CODE
29487
></DT
29488
><DD
29489
><P
29490
>&#13;A reserved variable name
29491
that may not be set or used in a construction environment.
29492
(See "Variable Substitution," below.)
29493
</P
29494
></DD
29495
><DT
29496
><A
29497
NAME="cv-SPAWN"
29498
></A
29499
><CODE
29500
CLASS="envar"
29501
>SPAWN</CODE
29502
></DT
29503
><DD
29504
><P
29505
>&#13;A command interpreter function that will be called to execute command line
29506
strings. The function must expect the following arguments:
29507
</P
29508
><PRE
29509
CLASS="programlisting"
29510
>&#13;def spawn(shell, escape, cmd, args, env):
29511
</PRE
29512
><P
29513
>&#13;<CODE
29514
CLASS="varname"
29515
>sh</CODE
29516
>
29517
is a string naming the shell program to use.
29518
<CODE
29519
CLASS="varname"
29520
>escape</CODE
29521
>
29522
is a function that can be called to escape shell special characters in
29523
the command line.
29524
<CODE
29525
CLASS="varname"
29526
>cmd</CODE
29527
>
29528
is the path to the command to be executed.
29529
<CODE
29530
CLASS="varname"
29531
>args</CODE
29532
>
29533
is the arguments to the command.
29534
<CODE
29535
CLASS="varname"
29536
>env</CODE
29537
>
29538
is a dictionary of the environment variables
29539
in which the command should be executed.
29540
</P
29541
></DD
29542
><DT
29543
><A
29544
NAME="cv-SUMMARY"
29545
></A
29546
><CODE
29547
CLASS="envar"
29548
>SUMMARY</CODE
29549
></DT
29550
><DD
29551
><P
29552
>&#13;A short summary of what the project is about.
29553
This is used to fill in the
29554
<TT
29555
CLASS="literal"
29556
>Summary:</TT
29557
>
29558
field in the controlling information for Ipkg and RPM packages,
29559
and as the
29560
<TT
29561
CLASS="literal"
29562
>Description:</TT
29563
>
29564
field in MSI packages.
29565
</P
29566
></DD
29567
><DT
29568
><A
29569
NAME="cv-SWIG"
29570
></A
29571
><CODE
29572
CLASS="envar"
29573
>SWIG</CODE
29574
></DT
29575
><DD
29576
><P
29577
>&#13;The scripting language wrapper and interface generator.
29578
</P
29579
></DD
29580
><DT
29581
><A
29582
NAME="cv-SWIGCFILESUFFIX"
29583
></A
29584
><CODE
29585
CLASS="envar"
29586
>SWIGCFILESUFFIX</CODE
29587
></DT
29588
><DD
29589
><P
29590
>&#13;The suffix that will be used for intermediate C
29591
source files generated by
29592
the scripting language wrapper and interface generator.
29593
The default value is
29594
<TT
29595
CLASS="filename"
29596
>_wrap</TT
29597
><A
29598
HREF="#cv-CFILESUFFIX"
29599
><CODE
29600
CLASS="envar"
29601
>$CFILESUFFIX</CODE
29602
></A
29603
>.
29604
By default, this value is used whenever the
29605
<CODE
29606
CLASS="option"
29607
>-c++</CODE
29608
>
29609
option is
29610
<SPAN
29611
CLASS="emphasis"
29612
><I
29613
CLASS="emphasis"
29614
>not</I
29615
></SPAN
29616
>
29617
specified as part of the
29618
<A
29619
HREF="#cv-SWIGFLAGS"
29620
><CODE
29621
CLASS="envar"
29622
>$SWIGFLAGS</CODE
29623
></A
29624
>
29625
construction variable.
29626
</P
29627
></DD
29628
><DT
29629
><A
29630
NAME="cv-SWIGCOM"
29631
></A
29632
><CODE
29633
CLASS="envar"
29634
>SWIGCOM</CODE
29635
></DT
29636
><DD
29637
><P
29638
>&#13;The command line used to call
29639
the scripting language wrapper and interface generator.
29640
</P
29641
></DD
29642
><DT
29643
><A
29644
NAME="cv-SWIGCOMSTR"
29645
></A
29646
><CODE
29647
CLASS="envar"
29648
>SWIGCOMSTR</CODE
29649
></DT
29650
><DD
29651
><P
29652
>&#13;The string displayed when calling
29653
the scripting language wrapper and interface generator.
29654
If this is not set, then <A
29655
HREF="#cv-SWIGCOM"
29656
><CODE
29657
CLASS="envar"
29658
>$SWIGCOM</CODE
29659
></A
29660
> (the command line) is displayed.
29661
</P
29662
></DD
29663
><DT
29664
><A
29665
NAME="cv-SWIGCXXFILESUFFIX"
29666
></A
29667
><CODE
29668
CLASS="envar"
29669
>SWIGCXXFILESUFFIX</CODE
29670
></DT
29671
><DD
29672
><P
29673
>&#13;The suffix that will be used for intermediate C++
29674
source files generated by
29675
the scripting language wrapper and interface generator.
29676
The default value is
29677
<TT
29678
CLASS="filename"
29679
>_wrap</TT
29680
><A
29681
HREF="#cv-CFILESUFFIX"
29682
><CODE
29683
CLASS="envar"
29684
>$CFILESUFFIX</CODE
29685
></A
29686
>.
29687
By default, this value is used whenever the
29688
<TT
29689
CLASS="filename"
29690
>-c++</TT
29691
>
29692
option is specified as part of the
29693
<A
29694
HREF="#cv-SWIGFLAGS"
29695
><CODE
29696
CLASS="envar"
29697
>$SWIGFLAGS</CODE
29698
></A
29699
>
29700
construction variable.
29701
</P
29702
></DD
29703
><DT
29704
><A
29705
NAME="cv-SWIGFLAGS"
29706
></A
29707
><CODE
29708
CLASS="envar"
29709
>SWIGFLAGS</CODE
29710
></DT
29711
><DD
29712
><P
29713
>&#13;General options passed to
29714
the scripting language wrapper and interface generator.
29715
This is where you should set
29716
<CODE
29717
CLASS="option"
29718
>-python</CODE
29719
>,
29720
<CODE
29721
CLASS="option"
29722
>-perl5</CODE
29723
>,
29724
<CODE
29725
CLASS="option"
29726
>-tcl</CODE
29727
>,
29728
or whatever other options you want to specify to SWIG.
29729
If you set the
29730
<CODE
29731
CLASS="option"
29732
>-c++</CODE
29733
>
29734
option in this variable,
29735
<SPAN
29736
CLASS="application"
29737
>scons</SPAN
29738
>
29739
will, by default,
29740
generate a C++ intermediate source file
29741
with the extension that is specified as the
29742
<A
29743
HREF="#cv-CXXFILESUFFIX"
29744
><CODE
29745
CLASS="envar"
29746
>$CXXFILESUFFIX</CODE
29747
></A
29748
>
29749
variable.
29750
</P
29751
></DD
29752
><DT
29753
><A
29754
NAME="cv-_SWIGINCFLAGS"
29755
></A
29756
><CODE
29757
CLASS="envar"
29758
>_SWIGINCFLAGS</CODE
29759
></DT
29760
><DD
29761
><P
29762
>&#13;An automatically-generated construction variable
29763
containing the SWIG command-line options
29764
for specifying directories to be searched for included files.
29765
The value of <CODE
29766
CLASS="envar"
29767
>$_SWIGINCFLAGS</CODE
29768
> is created
29769
by appending <CODE
29770
CLASS="envar"
29771
>$SWIGINCPREFIX</CODE
29772
> and <CODE
29773
CLASS="envar"
29774
>$SWIGINCSUFFIX</CODE
29775
>
29776
to the beginning and end
29777
of each directory in <CODE
29778
CLASS="envar"
29779
>$SWIGPATH</CODE
29780
>.
29781
</P
29782
></DD
29783
><DT
29784
><A
29785
NAME="cv-SWIGINCPREFIX"
29786
></A
29787
><CODE
29788
CLASS="envar"
29789
>SWIGINCPREFIX</CODE
29790
></DT
29791
><DD
29792
><P
29793
>&#13;The prefix used to specify an include directory on the SWIG command line.
29794
This will be appended to the beginning of each directory
29795
in the <CODE
29796
CLASS="envar"
29797
>$SWIGPATH</CODE
29798
> construction variable
29799
when the <CODE
29800
CLASS="envar"
29801
>$_SWIGINCFLAGS</CODE
29802
> variable is automatically generated.
29803
</P
29804
></DD
29805
><DT
29806
><A
29807
NAME="cv-SWIGINCSUFFIX"
29808
></A
29809
><CODE
29810
CLASS="envar"
29811
>SWIGINCSUFFIX</CODE
29812
></DT
29813
><DD
29814
><P
29815
>&#13;The suffix used to specify an include directory on the SWIG command line.
29816
This will be appended to the end of each directory
29817
in the <CODE
29818
CLASS="envar"
29819
>$SWIGPATH</CODE
29820
> construction variable
29821
when the <CODE
29822
CLASS="envar"
29823
>$_SWIGINCFLAGS</CODE
29824
> variable is automatically generated.
29825
</P
29826
></DD
29827
><DT
29828
><A
29829
NAME="cv-SWIGOUTDIR"
29830
></A
29831
><CODE
29832
CLASS="envar"
29833
>SWIGOUTDIR</CODE
29834
></DT
29835
><DD
29836
><P
29837
>&#13;Specifies the output directory in which
29838
the scripting language wrapper and interface generator
29839
should place generated language-specific files.
29840
This will be used by SCons to identify
29841
the files that will be generated by the <SPAN
29842
CLASS="application"
29843
>swig</SPAN
29844
> call,
29845
and translated into the
29846
<TT
29847
CLASS="literal"
29848
>swig -outdir</TT
29849
> option on the command line.
29850
</P
29851
></DD
29852
><DT
29853
><A
29854
NAME="cv-SWIGPATH"
29855
></A
29856
><CODE
29857
CLASS="envar"
29858
>SWIGPATH</CODE
29859
></DT
29860
><DD
29861
><P
29862
>&#13;The list of directories that the scripting language wrapper
29863
and interface generate will search for included files.
29864
The SWIG implicit dependency scanner will search these
29865
directories for include files.
29866
The default is to use the same path
29867
specified as <CODE
29868
CLASS="envar"
29869
>$CPPPATH</CODE
29870
>.</P
29871
><P
29872
>Don't explicitly put include directory
29873
arguments in SWIGFLAGS;
29874
the result will be non-portable
29875
and the directories will not be searched by the dependency scanner.
29876
Note: directory names in SWIGPATH will be looked-up relative to the SConscript
29877
directory when they are used in a command.
29878
To force
29879
<SPAN
29880
CLASS="application"
29881
>scons</SPAN
29882
>
29883
to look-up a directory relative to the root of the source tree use #:
29884
</P
29885
><PRE
29886
CLASS="programlisting"
29887
>&#13;env = Environment(SWIGPATH='#/include')
29888
</PRE
29889
><P
29890
>&#13;The directory look-up can also be forced using the
29891
<CODE
29892
CLASS="function"
29893
>Dir</CODE
29894
>()
29895
function:
29896
</P
29897
><PRE
29898
CLASS="programlisting"
29899
>&#13;include = Dir('include')
29900
env = Environment(SWIGPATH=include)
29901
</PRE
29902
><P
29903
>&#13;The directory list will be added to command lines
29904
through the automatically-generated
29905
<CODE
29906
CLASS="envar"
29907
>$_SWIGINCFLAGS</CODE
29908
>
29909
construction variable,
29910
which is constructed by
29911
appending the values of the
29912
<CODE
29913
CLASS="envar"
29914
>$SWIGINCPREFIX</CODE
29915
> and <CODE
29916
CLASS="envar"
29917
>$SWIGINCSUFFIX</CODE
29918
>
29919
construction variables
29920
to the beginning and end
29921
of each directory in <CODE
29922
CLASS="envar"
29923
>$SWIGPATH</CODE
29924
>.
29925
Any command lines you define that need
29926
the SWIGPATH directory list should
29927
include <CODE
29928
CLASS="envar"
29929
>$_SWIGINCFLAGS</CODE
29930
>:
29931
</P
29932
><PRE
29933
CLASS="programlisting"
29934
>&#13;env = Environment(SWIGCOM="my_swig -o $TARGET $_SWIGINCFLAGS $SORUCES")
29935
</PRE
29936
></DD
29937
><DT
29938
><A
29939
NAME="cv-TAR"
29940
></A
29941
><CODE
29942
CLASS="envar"
29943
>TAR</CODE
29944
></DT
29945
><DD
29946
><P
29947
>&#13;The tar archiver.
29948
</P
29949
></DD
29950
><DT
29951
><A
29952
NAME="cv-TARCOM"
29953
></A
29954
><CODE
29955
CLASS="envar"
29956
>TARCOM</CODE
29957
></DT
29958
><DD
29959
><P
29960
>&#13;The command line used to call the tar archiver.
29961
</P
29962
></DD
29963
><DT
29964
><A
29965
NAME="cv-TARCOMSTR"
29966
></A
29967
><CODE
29968
CLASS="envar"
29969
>TARCOMSTR</CODE
29970
></DT
29971
><DD
29972
><P
29973
>&#13;The string displayed when archiving files
29974
using the tar archiver.
29975
If this is not set, then <A
29976
HREF="#cv-TARCOM"
29977
><CODE
29978
CLASS="envar"
29979
>$TARCOM</CODE
29980
></A
29981
> (the command line) is displayed.
29982
</P
29983
><PRE
29984
CLASS="programlisting"
29985
>&#13;env = Environment(TARCOMSTR = "Archiving $TARGET")
29986
</PRE
29987
></DD
29988
><DT
29989
><A
29990
NAME="cv-TARFLAGS"
29991
></A
29992
><CODE
29993
CLASS="envar"
29994
>TARFLAGS</CODE
29995
></DT
29996
><DD
29997
><P
29998
>&#13;General options passed to the tar archiver.
29999
</P
30000
></DD
30001
><DT
30002
><A
30003
NAME="cv-TARGET"
30004
></A
30005
><CODE
30006
CLASS="envar"
30007
>TARGET</CODE
30008
></DT
30009
><DD
30010
><P
30011
>&#13;A reserved variable name
30012
that may not be set or used in a construction environment.
30013
(See "Variable Substitution," below.)
30014
</P
30015
></DD
30016
><DT
30017
><A
30018
NAME="cv-TARGETS"
30019
></A
30020
><CODE
30021
CLASS="envar"
30022
>TARGETS</CODE
30023
></DT
30024
><DD
30025
><P
30026
>&#13;A reserved variable name
30027
that may not be set or used in a construction environment.
30028
(See "Variable Substitution," below.)
30029
</P
30030
></DD
30031
><DT
30032
><A
30033
NAME="cv-TARSUFFIX"
30034
></A
30035
><CODE
30036
CLASS="envar"
30037
>TARSUFFIX</CODE
30038
></DT
30039
><DD
30040
><P
30041
>&#13;The suffix used for tar file names.
30042
</P
30043
></DD
30044
><DT
30045
><A
30046
NAME="cv-TEMPFILEPREFIX"
30047
></A
30048
><CODE
30049
CLASS="envar"
30050
>TEMPFILEPREFIX</CODE
30051
></DT
30052
><DD
30053
><P
30054
>&#13;The prefix for a temporary file used
30055
to execute lines longer than $MAXLINELENGTH.
30056
The default is '@'.
30057
This may be set for toolchains that use other values,
30058
such as '-@' for the diab compiler
30059
or '-via' for ARM toolchain.
30060
</P
30061
></DD
30062
><DT
30063
><A
30064
NAME="cv-TEX"
30065
></A
30066
><CODE
30067
CLASS="envar"
30068
>TEX</CODE
30069
></DT
30070
><DD
30071
><P
30072
>&#13;The TeX formatter and typesetter.
30073
</P
30074
></DD
30075
><DT
30076
><A
30077
NAME="cv-TEXCOM"
30078
></A
30079
><CODE
30080
CLASS="envar"
30081
>TEXCOM</CODE
30082
></DT
30083
><DD
30084
><P
30085
>&#13;The command line used to call the TeX formatter and typesetter.
30086
</P
30087
></DD
30088
><DT
30089
><A
30090
NAME="cv-TEXCOMSTR"
30091
></A
30092
><CODE
30093
CLASS="envar"
30094
>TEXCOMSTR</CODE
30095
></DT
30096
><DD
30097
><P
30098
>&#13;The string displayed when calling
30099
the TeX formatter and typesetter.
30100
If this is not set, then <A
30101
HREF="#cv-TEXCOM"
30102
><CODE
30103
CLASS="envar"
30104
>$TEXCOM</CODE
30105
></A
30106
> (the command line) is displayed.
30107
</P
30108
><PRE
30109
CLASS="programlisting"
30110
>&#13;env = Environment(TEXCOMSTR = "Building $TARGET from TeX input $SOURCES")
30111
</PRE
30112
></DD
30113
><DT
30114
><A
30115
NAME="cv-TEXFLAGS"
30116
></A
30117
><CODE
30118
CLASS="envar"
30119
>TEXFLAGS</CODE
30120
></DT
30121
><DD
30122
><P
30123
>&#13;General options passed to the TeX formatter and typesetter.
30124
</P
30125
></DD
30126
><DT
30127
><A
30128
NAME="cv-TEXINPUTS"
30129
></A
30130
><CODE
30131
CLASS="envar"
30132
>TEXINPUTS</CODE
30133
></DT
30134
><DD
30135
><P
30136
>&#13;List of directories that the LaTeX programm will search
30137
for include directories.
30138
The LaTeX implicit dependency scanner will search these
30139
directories for \include and \import files.
30140
</P
30141
></DD
30142
><DT
30143
><A
30144
NAME="cv-TOOLS"
30145
></A
30146
><CODE
30147
CLASS="envar"
30148
>TOOLS</CODE
30149
></DT
30150
><DD
30151
><P
30152
>&#13;A list of the names of the Tool specifications
30153
that are part of this construction environment.
30154
</P
30155
></DD
30156
><DT
30157
><A
30158
NAME="cv-VENDOR"
30159
></A
30160
><CODE
30161
CLASS="envar"
30162
>VENDOR</CODE
30163
></DT
30164
><DD
30165
><P
30166
>&#13;The person or organization who supply the packaged software.
30167
This is used to fill in the
30168
<TT
30169
CLASS="literal"
30170
>Vendor:</TT
30171
>
30172
field in the controlling information for RPM packages,
30173
and the
30174
<TT
30175
CLASS="literal"
30176
>Manufacturer:</TT
30177
>
30178
field in the controlling information for MSI packages.
30179
</P
30180
></DD
30181
><DT
30182
><A
30183
NAME="cv-VERSION"
30184
></A
30185
><CODE
30186
CLASS="envar"
30187
>VERSION</CODE
30188
></DT
30189
><DD
30190
><P
30191
>&#13;The version of the project, specified as a string.
30192
</P
30193
></DD
30194
><DT
30195
><A
30196
NAME="cv-WIN32_INSERT_DEF"
30197
></A
30198
><CODE
30199
CLASS="envar"
30200
>WIN32_INSERT_DEF</CODE
30201
></DT
30202
><DD
30203
><P
30204
>&#13;A deprecated synonym for <A
30205
HREF="#cv-WINDOWS_INSERT_DEF"
30206
><CODE
30207
CLASS="envar"
30208
>$WINDOWS_INSERT_DEF</CODE
30209
></A
30210
>.
30211
</P
30212
></DD
30213
><DT
30214
><A
30215
NAME="cv-WIN32DEFPREFIX"
30216
></A
30217
><CODE
30218
CLASS="envar"
30219
>WIN32DEFPREFIX</CODE
30220
></DT
30221
><DD
30222
><P
30223
>&#13;A deprecated synonym for <A
30224
HREF="#cv-WINDOWSDEFPREFIX"
30225
><CODE
30226
CLASS="envar"
30227
>$WINDOWSDEFPREFIX</CODE
30228
></A
30229
>.
30230
</P
30231
></DD
30232
><DT
30233
><A
30234
NAME="cv-WIN32DEFSUFFIX"
30235
></A
30236
><CODE
30237
CLASS="envar"
30238
>WIN32DEFSUFFIX</CODE
30239
></DT
30240
><DD
30241
><P
30242
>&#13;A deprecated synonym for <A
30243
HREF="#cv-WINDOWSDEFSUFFIX"
30244
><CODE
30245
CLASS="envar"
30246
>$WINDOWSDEFSUFFIX</CODE
30247
></A
30248
>.
30249
</P
30250
></DD
30251
><DT
30252
><A
30253
NAME="cv-WIN32EXPPREFIX"
30254
></A
30255
><CODE
30256
CLASS="envar"
30257
>WIN32EXPPREFIX</CODE
30258
></DT
30259
><DD
30260
><P
30261
>&#13;A deprecated synonym for <A
30262
HREF="#cv-WINDOWSEXPSUFFIX"
30263
><CODE
30264
CLASS="envar"
30265
>$WINDOWSEXPSUFFIX</CODE
30266
></A
30267
>.
30268
</P
30269
></DD
30270
><DT
30271
><A
30272
NAME="cv-WIN32EXPSUFFIX"
30273
></A
30274
><CODE
30275
CLASS="envar"
30276
>WIN32EXPSUFFIX</CODE
30277
></DT
30278
><DD
30279
><P
30280
>&#13;A deprecated synonym for <A
30281
HREF="#cv-WINDOWSEXPSUFFIX"
30282
><CODE
30283
CLASS="envar"
30284
>$WINDOWSEXPSUFFIX</CODE
30285
></A
30286
>.
30287
</P
30288
></DD
30289
><DT
30290
><A
30291
NAME="cv-WINDOWS_INSERT_DEF"
30292
></A
30293
><CODE
30294
CLASS="envar"
30295
>WINDOWS_INSERT_DEF</CODE
30296
></DT
30297
><DD
30298
><P
30299
>&#13;When this is set to true,
30300
a library build of a Windows shared library
30301
(<TT
30302
CLASS="filename"
30303
>.dll</TT
30304
>file)
30305
will also build a corresponding <TT
30306
CLASS="filename"
30307
>.def</TT
30308
> file
30309
at the same time,
30310
if a <TT
30311
CLASS="filename"
30312
>.def</TT
30313
> file
30314
is not already listed as a build target.
30315
The default is 0 (do not build a <TT
30316
CLASS="filename"
30317
>.def</TT
30318
> file).
30319
</P
30320
></DD
30321
><DT
30322
><A
30323
NAME="cv-WINDOWS_INSERT_MANIFEST"
30324
></A
30325
><CODE
30326
CLASS="envar"
30327
>WINDOWS_INSERT_MANIFEST</CODE
30328
></DT
30329
><DD
30330
><P
30331
>&#13;When this is set to true,
30332
<SPAN
30333
CLASS="application"
30334
>scons</SPAN
30335
>
30336
will be aware of the
30337
<TT
30338
CLASS="filename"
30339
>.manifest</TT
30340
>
30341
files generated by Microsoft Visua C/C++ 8.
30342
</P
30343
></DD
30344
><DT
30345
><A
30346
NAME="cv-WINDOWSDEFPREFIX"
30347
></A
30348
><CODE
30349
CLASS="envar"
30350
>WINDOWSDEFPREFIX</CODE
30351
></DT
30352
><DD
30353
><P
30354
>&#13;The prefix used for Windows <TT
30355
CLASS="filename"
30356
>.def</TT
30357
>file names.
30358
</P
30359
></DD
30360
><DT
30361
><A
30362
NAME="cv-WINDOWSDEFSUFFIX"
30363
></A
30364
><CODE
30365
CLASS="envar"
30366
>WINDOWSDEFSUFFIX</CODE
30367
></DT
30368
><DD
30369
><P
30370
>&#13;The suffix used for Windows <TT
30371
CLASS="filename"
30372
>.def</TT
30373
> file names.
30374
</P
30375
></DD
30376
><DT
30377
><A
30378
NAME="cv-WINDOWSEXPPREFIX"
30379
></A
30380
><CODE
30381
CLASS="envar"
30382
>WINDOWSEXPPREFIX</CODE
30383
></DT
30384
><DD
30385
><P
30386
>&#13;The prefix used for Windows <TT
30387
CLASS="filename"
30388
>.exp</TT
30389
> file names.
30390
</P
30391
></DD
30392
><DT
30393
><A
30394
NAME="cv-WINDOWSEXPSUFFIX"
30395
></A
30396
><CODE
30397
CLASS="envar"
30398
>WINDOWSEXPSUFFIX</CODE
30399
></DT
30400
><DD
30401
><P
30402
>&#13;The suffix used for Windows <TT
30403
CLASS="filename"
30404
>.exp</TT
30405
> file names.
30406
</P
30407
></DD
30408
><DT
30409
><A
30410
NAME="cv-WINDOWSPROGMANIFESTPREFIX"
30411
></A
30412
><CODE
30413
CLASS="envar"
30414
>WINDOWSPROGMANIFESTPREFIX</CODE
30415
></DT
30416
><DD
30417
><P
30418
>&#13;The prefix used for executable program <TT
30419
CLASS="filename"
30420
>.manifest</TT
30421
> files
30422
generated by Microsoft Visual C/C++.
30423
</P
30424
></DD
30425
><DT
30426
><A
30427
NAME="cv-WINDOWSPROGMANIFESTSUFFIX"
30428
></A
30429
><CODE
30430
CLASS="envar"
30431
>WINDOWSPROGMANIFESTSUFFIX</CODE
30432
></DT
30433
><DD
30434
><P
30435
>&#13;The suffix used for executable program <TT
30436
CLASS="filename"
30437
>.manifest</TT
30438
> files
30439
generated by Microsoft Visual C/C++.
30440
</P
30441
></DD
30442
><DT
30443
><A
30444
NAME="cv-WINDOWSSHLIBMANIFESTPREFIX"
30445
></A
30446
><CODE
30447
CLASS="envar"
30448
>WINDOWSSHLIBMANIFESTPREFIX</CODE
30449
></DT
30450
><DD
30451
><P
30452
>&#13;The prefix used for shared library <TT
30453
CLASS="filename"
30454
>.manifest</TT
30455
> files
30456
generated by Microsoft Visual C/C++.
30457
</P
30458
></DD
30459
><DT
30460
><A
30461
NAME="cv-WINDOWSSHLIBMANIFESTSUFFIX"
30462
></A
30463
><CODE
30464
CLASS="envar"
30465
>WINDOWSSHLIBMANIFESTSUFFIX</CODE
30466
></DT
30467
><DD
30468
><P
30469
>&#13;The suffix used for shared library <TT
30470
CLASS="filename"
30471
>.manifest</TT
30472
> files
30473
generated by Microsoft Visual C/C++.
30474
</P
30475
></DD
30476
><DT
30477
><A
30478
NAME="cv-X_IPK_DEPENDS"
30479
></A
30480
><CODE
30481
CLASS="envar"
30482
>X_IPK_DEPENDS</CODE
30483
></DT
30484
><DD
30485
><P
30486
>&#13;This is used to fill in the
30487
<TT
30488
CLASS="literal"
30489
>Depends:</TT
30490
>
30491
field in the controlling information for Ipkg packages.
30492
</P
30493
></DD
30494
><DT
30495
><A
30496
NAME="cv-X_IPK_DESCRIPTION"
30497
></A
30498
><CODE
30499
CLASS="envar"
30500
>X_IPK_DESCRIPTION</CODE
30501
></DT
30502
><DD
30503
><P
30504
>&#13;This is used to fill in the
30505
<TT
30506
CLASS="literal"
30507
>Description:</TT
30508
>
30509
field in the controlling information for Ipkg packages.
30510
The default value is
30511
<TT
30512
CLASS="literal"
30513
>$SUMMARY\n$DESCRIPTION</TT
30514
>
30515
</P
30516
></DD
30517
><DT
30518
><A
30519
NAME="cv-X_IPK_MAINTAINER"
30520
></A
30521
><CODE
30522
CLASS="envar"
30523
>X_IPK_MAINTAINER</CODE
30524
></DT
30525
><DD
30526
><P
30527
>&#13;This is used to fill in the
30528
<TT
30529
CLASS="literal"
30530
>Maintainer:</TT
30531
>
30532
field in the controlling information for Ipkg packages.
30533
</P
30534
></DD
30535
><DT
30536
><A
30537
NAME="cv-X_IPK_PRIORITY"
30538
></A
30539
><CODE
30540
CLASS="envar"
30541
>X_IPK_PRIORITY</CODE
30542
></DT
30543
><DD
30544
><P
30545
>&#13;This is used to fill in the
30546
<TT
30547
CLASS="literal"
30548
>Priority:</TT
30549
>
30550
field in the controlling information for Ipkg packages.
30551
</P
30552
></DD
30553
><DT
30554
><A
30555
NAME="cv-X_IPK_SECTION"
30556
></A
30557
><CODE
30558
CLASS="envar"
30559
>X_IPK_SECTION</CODE
30560
></DT
30561
><DD
30562
><P
30563
>&#13;This is used to fill in the
30564
<TT
30565
CLASS="literal"
30566
>Section:</TT
30567
>
30568
field in the controlling information for Ipkg packages.
30569
</P
30570
></DD
30571
><DT
30572
><A
30573
NAME="cv-X_MSI_LANGUAGE"
30574
></A
30575
><CODE
30576
CLASS="envar"
30577
>X_MSI_LANGUAGE</CODE
30578
></DT
30579
><DD
30580
><P
30581
>&#13;This is used to fill in the
30582
<TT
30583
CLASS="literal"
30584
>Language:</TT
30585
>
30586
attribute in the controlling information for MSI packages.
30587
</P
30588
></DD
30589
><DT
30590
><A
30591
NAME="cv-X_MSI_LICENSE_TEXT"
30592
></A
30593
><CODE
30594
CLASS="envar"
30595
>X_MSI_LICENSE_TEXT</CODE
30596
></DT
30597
><DD
30598
><P
30599
>&#13;The text of the software license in RTF format.
30600
Carriage return characters will be
30601
replaced with the RTF equivalent \\par.
30602
</P
30603
></DD
30604
><DT
30605
><A
30606
NAME="cv-X_MSI_UPGRADE_CODE"
30607
></A
30608
><CODE
30609
CLASS="envar"
30610
>X_MSI_UPGRADE_CODE</CODE
30611
></DT
30612
><DD
30613
><P
30614
>&#13;TODO
30615
</P
30616
></DD
30617
><DT
30618
><A
30619
NAME="cv-X_RPM_AUTOREQPROV"
30620
></A
30621
><CODE
30622
CLASS="envar"
30623
>X_RPM_AUTOREQPROV</CODE
30624
></DT
30625
><DD
30626
><P
30627
>&#13;This is used to fill in the
30628
<TT
30629
CLASS="literal"
30630
>AutoReqProv:</TT
30631
>
30632
field in the RPM
30633
<TT
30634
CLASS="filename"
30635
>.spec</TT
30636
> file.
30637
</P
30638
></DD
30639
><DT
30640
><A
30641
NAME="cv-X_RPM_BUILD"
30642
></A
30643
><CODE
30644
CLASS="envar"
30645
>X_RPM_BUILD</CODE
30646
></DT
30647
><DD
30648
><P
30649
>&#13;internal, but overridable
30650
</P
30651
></DD
30652
><DT
30653
><A
30654
NAME="cv-X_RPM_BUILDREQUIRES"
30655
></A
30656
><CODE
30657
CLASS="envar"
30658
>X_RPM_BUILDREQUIRES</CODE
30659
></DT
30660
><DD
30661
><P
30662
>&#13;This is used to fill in the
30663
<TT
30664
CLASS="literal"
30665
>BuildRequires:</TT
30666
>
30667
field in the RPM
30668
<TT
30669
CLASS="filename"
30670
>.spec</TT
30671
> file.
30672
</P
30673
></DD
30674
><DT
30675
><A
30676
NAME="cv-X_RPM_BUILDROOT"
30677
></A
30678
><CODE
30679
CLASS="envar"
30680
>X_RPM_BUILDROOT</CODE
30681
></DT
30682
><DD
30683
><P
30684
>&#13;internal, but overridable
30685
</P
30686
></DD
30687
><DT
30688
><A
30689
NAME="cv-X_RPM_CLEAN"
30690
></A
30691
><CODE
30692
CLASS="envar"
30693
>X_RPM_CLEAN</CODE
30694
></DT
30695
><DD
30696
><P
30697
>&#13;internal, but overridable
30698
</P
30699
></DD
30700
><DT
30701
><A
30702
NAME="cv-X_RPM_CONFLICTS"
30703
></A
30704
><CODE
30705
CLASS="envar"
30706
>X_RPM_CONFLICTS</CODE
30707
></DT
30708
><DD
30709
><P
30710
>&#13;This is used to fill in the
30711
<TT
30712
CLASS="literal"
30713
>Conflicts:</TT
30714
>
30715
field in the RPM
30716
<TT
30717
CLASS="filename"
30718
>.spec</TT
30719
> file.
30720
</P
30721
></DD
30722
><DT
30723
><A
30724
NAME="cv-X_RPM_DEFATTR"
30725
></A
30726
><CODE
30727
CLASS="envar"
30728
>X_RPM_DEFATTR</CODE
30729
></DT
30730
><DD
30731
><P
30732
>&#13;This value is used as the default attributes
30733
for the files in the RPM package.
30734
The default value is
30735
<TT
30736
CLASS="literal"
30737
>(-,root,root)</TT
30738
>.
30739
</P
30740
></DD
30741
><DT
30742
><A
30743
NAME="cv-X_RPM_DISTRIBUTION"
30744
></A
30745
><CODE
30746
CLASS="envar"
30747
>X_RPM_DISTRIBUTION</CODE
30748
></DT
30749
><DD
30750
><P
30751
>&#13;This is used to fill in the
30752
<TT
30753
CLASS="literal"
30754
>Distribution:</TT
30755
>
30756
field in the RPM
30757
<TT
30758
CLASS="filename"
30759
>.spec</TT
30760
> file.
30761
</P
30762
></DD
30763
><DT
30764
><A
30765
NAME="cv-X_RPM_EPOCH"
30766
></A
30767
><CODE
30768
CLASS="envar"
30769
>X_RPM_EPOCH</CODE
30770
></DT
30771
><DD
30772
><P
30773
>&#13;This is used to fill in the
30774
<TT
30775
CLASS="literal"
30776
>Epoch:</TT
30777
>
30778
field in the controlling information for RPM packages.
30779
</P
30780
></DD
30781
><DT
30782
><A
30783
NAME="cv-X_RPM_EXCLUDEARCH"
30784
></A
30785
><CODE
30786
CLASS="envar"
30787
>X_RPM_EXCLUDEARCH</CODE
30788
></DT
30789
><DD
30790
><P
30791
>&#13;This is used to fill in the
30792
<TT
30793
CLASS="literal"
30794
>ExcludeArch:</TT
30795
>
30796
field in the RPM
30797
<TT
30798
CLASS="filename"
30799
>.spec</TT
30800
> file.
30801
</P
30802
></DD
30803
><DT
30804
><A
30805
NAME="cv-X_RPM_EXLUSIVEARCH"
30806
></A
30807
><CODE
30808
CLASS="envar"
30809
>X_RPM_EXLUSIVEARCH</CODE
30810
></DT
30811
><DD
30812
><P
30813
>&#13;This is used to fill in the
30814
<TT
30815
CLASS="literal"
30816
>ExclusiveArch:</TT
30817
>
30818
field in the RPM
30819
<TT
30820
CLASS="filename"
30821
>.spec</TT
30822
> file.
30823
</P
30824
></DD
30825
><DT
30826
><A
30827
NAME="cv-X_RPM_GROUP"
30828
></A
30829
><CODE
30830
CLASS="envar"
30831
>X_RPM_GROUP</CODE
30832
></DT
30833
><DD
30834
><P
30835
>&#13;This is used to fill in the
30836
<TT
30837
CLASS="literal"
30838
>Group:</TT
30839
>
30840
field in the RPM
30841
<TT
30842
CLASS="filename"
30843
>.spec</TT
30844
> file.
30845
</P
30846
></DD
30847
><DT
30848
><A
30849
NAME="cv-X_RPM_GROUP_lang"
30850
></A
30851
><CODE
30852
CLASS="envar"
30853
>X_RPM_GROUP_lang</CODE
30854
></DT
30855
><DD
30856
><P
30857
>&#13;This is used to fill in the
30858
<TT
30859
CLASS="literal"
30860
>Group(lang):</TT
30861
>
30862
field in the RPM
30863
<TT
30864
CLASS="filename"
30865
>.spec</TT
30866
> file.
30867
Note that
30868
<CODE
30869
CLASS="varname"
30870
>lang</CODE
30871
>
30872
is not literal
30873
and should be replaced by
30874
the appropriate language code.
30875
</P
30876
></DD
30877
><DT
30878
><A
30879
NAME="cv-X_RPM_ICON"
30880
></A
30881
><CODE
30882
CLASS="envar"
30883
>X_RPM_ICON</CODE
30884
></DT
30885
><DD
30886
><P
30887
>&#13;This is used to fill in the
30888
<TT
30889
CLASS="literal"
30890
>Icon:</TT
30891
>
30892
field in the RPM
30893
<TT
30894
CLASS="filename"
30895
>.spec</TT
30896
> file.
30897
</P
30898
></DD
30899
><DT
30900
><A
30901
NAME="cv-X_RPM_INSTALL"
30902
></A
30903
><CODE
30904
CLASS="envar"
30905
>X_RPM_INSTALL</CODE
30906
></DT
30907
><DD
30908
><P
30909
>&#13;internal, but overridable
30910
</P
30911
></DD
30912
><DT
30913
><A
30914
NAME="cv-X_RPM_PACKAGER"
30915
></A
30916
><CODE
30917
CLASS="envar"
30918
>X_RPM_PACKAGER</CODE
30919
></DT
30920
><DD
30921
><P
30922
>&#13;This is used to fill in the
30923
<TT
30924
CLASS="literal"
30925
>Packager:</TT
30926
>
30927
field in the RPM
30928
<TT
30929
CLASS="filename"
30930
>.spec</TT
30931
> file.
30932
</P
30933
></DD
30934
><DT
30935
><A
30936
NAME="cv-X_RPM_POSTINSTALL"
30937
></A
30938
><CODE
30939
CLASS="envar"
30940
>X_RPM_POSTINSTALL</CODE
30941
></DT
30942
><DD
30943
><P
30944
>&#13;This is used to fill in the
30945
<TT
30946
CLASS="literal"
30947
>%post:</TT
30948
>
30949
section in the RPM
30950
<TT
30951
CLASS="filename"
30952
>.spec</TT
30953
> file.
30954
</P
30955
></DD
30956
><DT
30957
><A
30958
NAME="cv-X_RPM_POSTUNINSTALL"
30959
></A
30960
><CODE
30961
CLASS="envar"
30962
>X_RPM_POSTUNINSTALL</CODE
30963
></DT
30964
><DD
30965
><P
30966
>&#13;This is used to fill in the
30967
<TT
30968
CLASS="literal"
30969
>%postun:</TT
30970
>
30971
section in the RPM
30972
<TT
30973
CLASS="filename"
30974
>.spec</TT
30975
> file.
30976
</P
30977
></DD
30978
><DT
30979
><A
30980
NAME="cv-X_RPM_PREFIX"
30981
></A
30982
><CODE
30983
CLASS="envar"
30984
>X_RPM_PREFIX</CODE
30985
></DT
30986
><DD
30987
><P
30988
>&#13;This is used to fill in the
30989
<TT
30990
CLASS="literal"
30991
>Prefix:</TT
30992
>
30993
field in the RPM
30994
<TT
30995
CLASS="filename"
30996
>.spec</TT
30997
> file.
30998
</P
30999
></DD
31000
><DT
31001
><A
31002
NAME="cv-X_RPM_PREINSTALL"
31003
></A
31004
><CODE
31005
CLASS="envar"
31006
>X_RPM_PREINSTALL</CODE
31007
></DT
31008
><DD
31009
><P
31010
>&#13;This is used to fill in the
31011
<TT
31012
CLASS="literal"
31013
>%pre:</TT
31014
>
31015
section in the RPM
31016
<TT
31017
CLASS="filename"
31018
>.spec</TT
31019
> file.
31020
</P
31021
></DD
31022
><DT
31023
><A
31024
NAME="cv-X_RPM_PREP"
31025
></A
31026
><CODE
31027
CLASS="envar"
31028
>X_RPM_PREP</CODE
31029
></DT
31030
><DD
31031
><P
31032
>&#13;internal, but overridable
31033
</P
31034
></DD
31035
><DT
31036
><A
31037
NAME="cv-X_RPM_PREUNINSTALL"
31038
></A
31039
><CODE
31040
CLASS="envar"
31041
>X_RPM_PREUNINSTALL</CODE
31042
></DT
31043
><DD
31044
><P
31045
>&#13;This is used to fill in the
31046
<TT
31047
CLASS="literal"
31048
>%preun:</TT
31049
>
31050
section in the RPM
31051
<TT
31052
CLASS="filename"
31053
>.spec</TT
31054
> file.
31055
</P
31056
></DD
31057
><DT
31058
><A
31059
NAME="cv-X_RPM_PROVIDES"
31060
></A
31061
><CODE
31062
CLASS="envar"
31063
>X_RPM_PROVIDES</CODE
31064
></DT
31065
><DD
31066
><P
31067
>&#13;This is used to fill in the
31068
<TT
31069
CLASS="literal"
31070
>Provides:</TT
31071
>
31072
field in the RPM
31073
<TT
31074
CLASS="filename"
31075
>.spec</TT
31076
> file.
31077
</P
31078
></DD
31079
><DT
31080
><A
31081
NAME="cv-X_RPM_REQUIRES"
31082
></A
31083
><CODE
31084
CLASS="envar"
31085
>X_RPM_REQUIRES</CODE
31086
></DT
31087
><DD
31088
><P
31089
>&#13;This is used to fill in the
31090
<TT
31091
CLASS="literal"
31092
>Requires:</TT
31093
>
31094
field in the RPM
31095
<TT
31096
CLASS="filename"
31097
>.spec</TT
31098
> file.
31099
</P
31100
></DD
31101
><DT
31102
><A
31103
NAME="cv-X_RPM_SERIAL"
31104
></A
31105
><CODE
31106
CLASS="envar"
31107
>X_RPM_SERIAL</CODE
31108
></DT
31109
><DD
31110
><P
31111
>&#13;This is used to fill in the
31112
<TT
31113
CLASS="literal"
31114
>Serial:</TT
31115
>
31116
field in the RPM
31117
<TT
31118
CLASS="filename"
31119
>.spec</TT
31120
> file.
31121
</P
31122
></DD
31123
><DT
31124
><A
31125
NAME="cv-X_RPM_URL"
31126
></A
31127
><CODE
31128
CLASS="envar"
31129
>X_RPM_URL</CODE
31130
></DT
31131
><DD
31132
><P
31133
>&#13;This is used to fill in the
31134
<TT
31135
CLASS="literal"
31136
>Url:</TT
31137
>
31138
field in the RPM
31139
<TT
31140
CLASS="filename"
31141
>.spec</TT
31142
> file.
31143
</P
31144
></DD
31145
><DT
31146
><A
31147
NAME="cv-YACC"
31148
></A
31149
><CODE
31150
CLASS="envar"
31151
>YACC</CODE
31152
></DT
31153
><DD
31154
><P
31155
>&#13;The parser generator.
31156
</P
31157
></DD
31158
><DT
31159
><A
31160
NAME="cv-YACCCOM"
31161
></A
31162
><CODE
31163
CLASS="envar"
31164
>YACCCOM</CODE
31165
></DT
31166
><DD
31167
><P
31168
>&#13;The command line used to call the parser generator
31169
to generate a source file.
31170
</P
31171
></DD
31172
><DT
31173
><A
31174
NAME="cv-YACCCOMSTR"
31175
></A
31176
><CODE
31177
CLASS="envar"
31178
>YACCCOMSTR</CODE
31179
></DT
31180
><DD
31181
><P
31182
>&#13;The string displayed when generating a source file
31183
using the parser generator.
31184
If this is not set, then <A
31185
HREF="#cv-YACCCOM"
31186
><CODE
31187
CLASS="envar"
31188
>$YACCCOM</CODE
31189
></A
31190
> (the command line) is displayed.
31191
</P
31192
><PRE
31193
CLASS="programlisting"
31194
>&#13;env = Environment(YACCCOMSTR = "Yacc'ing $TARGET from $SOURCES")
31195
</PRE
31196
></DD
31197
><DT
31198
><A
31199
NAME="cv-YACCFLAGS"
31200
></A
31201
><CODE
31202
CLASS="envar"
31203
>YACCFLAGS</CODE
31204
></DT
31205
><DD
31206
><P
31207
>&#13;General options passed to the parser generator.
31208
If <A
31209
HREF="#cv-YACCFLAGS"
31210
><CODE
31211
CLASS="envar"
31212
>$YACCFLAGS</CODE
31213
></A
31214
> contains a <CODE
31215
CLASS="option"
31216
>-d</CODE
31217
> option,
31218
SCons assumes that the call will also create a .h file
31219
(if the yacc source file ends in a .y suffix)
31220
or a .hpp file
31221
(if the yacc source file ends in a .yy suffix)
31222
</P
31223
></DD
31224
><DT
31225
><A
31226
NAME="cv-YACCHFILESUFFIX"
31227
></A
31228
><CODE
31229
CLASS="envar"
31230
>YACCHFILESUFFIX</CODE
31231
></DT
31232
><DD
31233
><P
31234
>&#13;The suffix of the C
31235
header file generated by the parser generator
31236
when the
31237
<CODE
31238
CLASS="option"
31239
>-d</CODE
31240
>
31241
option is used.
31242
Note that setting this variable does not cause
31243
the parser generator to generate a header
31244
file with the specified suffix,
31245
it exists to allow you to specify
31246
what suffix the parser generator will use of its own accord.
31247
The default value is
31248
<TT
31249
CLASS="filename"
31250
>.h</TT
31251
>.
31252
</P
31253
></DD
31254
><DT
31255
><A
31256
NAME="cv-YACCHXXFILESUFFIX"
31257
></A
31258
><CODE
31259
CLASS="envar"
31260
>YACCHXXFILESUFFIX</CODE
31261
></DT
31262
><DD
31263
><P
31264
>&#13;The suffix of the C++
31265
header file generated by the parser generator
31266
when the
31267
<CODE
31268
CLASS="option"
31269
>-d</CODE
31270
>
31271
option is used.
31272
Note that setting this variable does not cause
31273
the parser generator to generate a header
31274
file with the specified suffix,
31275
it exists to allow you to specify
31276
what suffix the parser generator will use of its own accord.
31277
The default value is
31278
<TT
31279
CLASS="filename"
31280
>.hpp</TT
31281
>,
31282
except on Mac OS X,
31283
where the default is
31284
<TT
31285
CLASS="filename"
31286
>${TARGET.suffix}.h</TT
31287
>.
31288
because the default <SPAN
31289
CLASS="application"
31290
>bison</SPAN
31291
> parser generator just
31292
appends <TT
31293
CLASS="filename"
31294
>.h</TT
31295
>
31296
to the name of the generated C++ file.
31297
</P
31298
></DD
31299
><DT
31300
><A
31301
NAME="cv-YACCVCGFILESUFFIX"
31302
></A
31303
><CODE
31304
CLASS="envar"
31305
>YACCVCGFILESUFFIX</CODE
31306
></DT
31307
><DD
31308
><P
31309
>&#13;The suffix of the file
31310
containing the VCG grammar automaton definition
31311
when the
31312
<CODE
31313
CLASS="option"
31314
>--graph=</CODE
31315
>
31316
option is used.
31317
Note that setting this variable does not cause
31318
the parser generator to generate a VCG
31319
file with the specified suffix,
31320
it exists to allow you to specify
31321
what suffix the parser generator will use of its own accord.
31322
The default value is
31323
<TT
31324
CLASS="filename"
31325
>.vcg</TT
31326
>.
31327
</P
31328
></DD
31329
><DT
31330
><A
31331
NAME="cv-ZIP"
31332
></A
31333
><CODE
31334
CLASS="envar"
31335
>ZIP</CODE
31336
></DT
31337
><DD
31338
><P
31339
>&#13;The zip compression and file packaging utility.
31340
</P
31341
></DD
31342
><DT
31343
><A
31344
NAME="cv-ZIPCOM"
31345
></A
31346
><CODE
31347
CLASS="envar"
31348
>ZIPCOM</CODE
31349
></DT
31350
><DD
31351
><P
31352
>&#13;The command line used to call the zip utility,
31353
or the internal Python function used to create a
31354
zip archive.
31355
</P
31356
></DD
31357
><DT
31358
><A
31359
NAME="cv-ZIPCOMPRESSION"
31360
></A
31361
><CODE
31362
CLASS="envar"
31363
>ZIPCOMPRESSION</CODE
31364
></DT
31365
><DD
31366
><P
31367
>&#13;The
31368
<CODE
31369
CLASS="varname"
31370
>compression</CODE
31371
>
31372
flag
31373
from the Python
31374
<TT
31375
CLASS="filename"
31376
>zipfile</TT
31377
>
31378
module used by the internal Python function
31379
to control whether the zip archive
31380
is compressed or not.
31381
The default value is
31382
<TT
31383
CLASS="literal"
31384
>zipfile.ZIP_DEFLATED</TT
31385
>,
31386
which creates a compressed zip archive.
31387
This value has no effect when using Python 1.5.2
31388
or if the
31389
<TT
31390
CLASS="literal"
31391
>zipfile</TT
31392
>
31393
module is otherwise unavailable.
31394
</P
31395
></DD
31396
><DT
31397
><A
31398
NAME="cv-ZIPCOMSTR"
31399
></A
31400
><CODE
31401
CLASS="envar"
31402
>ZIPCOMSTR</CODE
31403
></DT
31404
><DD
31405
><P
31406
>&#13;The string displayed when archiving files
31407
using the zip utility.
31408
If this is not set, then <A
31409
HREF="#cv-ZIPCOM"
31410
><CODE
31411
CLASS="envar"
31412
>$ZIPCOM</CODE
31413
></A
31414
>
31415
(the command line or internal Python function) is displayed.
31416
</P
31417
><PRE
31418
CLASS="programlisting"
31419
>&#13;env = Environment(ZIPCOMSTR = "Zipping $TARGET")
31420
</PRE
31421
></DD
31422
><DT
31423
><A
31424
NAME="cv-ZIPFLAGS"
31425
></A
31426
><CODE
31427
CLASS="envar"
31428
>ZIPFLAGS</CODE
31429
></DT
31430
><DD
31431
><P
31432
>&#13;General options passed to the zip utility.
31433
</P
31434
></DD
31435
><DT
31436
><A
31437
NAME="cv-ZIPSUFFIX"
31438
></A
31439
><CODE
31440
CLASS="envar"
31441
>ZIPSUFFIX</CODE
31442
></DT
31443
><DD
31444
><P
31445
>&#13;The suffix used for zip file names.
31446
</P
31447
></DD
31448
></DL
31449
></DIV
31450
></DIV
31451
><DIV
31452
CLASS="appendix"
31453
><HR><H1
31454
><A
31455
NAME="app-builders"
31456
></A
31457
>Appendix B. Builders</H1
31458
><P
31459
>&#13;
31460
This appendix contains descriptions of all of the
31461
Builders that are <SPAN
31462
CLASS="emphasis"
31463
><I
31464
CLASS="emphasis"
31465
>potentially</I
31466
></SPAN
31467
>
31468
available "out of the box" in this version of SCons.
31469
31470
</P
31471
><P
31472
></P
31473
><DIV
31474
CLASS="variablelist"
31475
><DL
31476
><DT
31477
><A
31478
NAME="b-CFile"
31479
></A
31480
><CODE
31481
CLASS="function"
31482
>CFile()</CODE
31483
>, <CODE
31484
CLASS="function"
31485
>env.CFile()</CODE
31486
></DT
31487
><DD
31488
><P
31489
>&#13;Builds a C source file given a lex (<TT
31490
CLASS="filename"
31491
>.l</TT
31492
>)
31493
or yacc (<TT
31494
CLASS="filename"
31495
>.y</TT
31496
>) input file.
31497
The suffix specified by the <A
31498
HREF="#cv-CFILESUFFIX"
31499
><CODE
31500
CLASS="envar"
31501
>$CFILESUFFIX</CODE
31502
></A
31503
> construction variable
31504
(<TT
31505
CLASS="filename"
31506
>.c</TT
31507
> by default)
31508
is automatically added to the target
31509
if it is not already present.
31510
Example:
31511
</P
31512
><PRE
31513
CLASS="programlisting"
31514
>&#13;# builds foo.c
31515
env.CFile(target = 'foo.c', source = 'foo.l')
31516
# builds bar.c
31517
env.CFile(target = 'bar', source = 'bar.y')
31518
</PRE
31519
></DD
31520
><DT
31521
><A
31522
NAME="b-CXXFile"
31523
></A
31524
><CODE
31525
CLASS="function"
31526
>CXXFile()</CODE
31527
>, <CODE
31528
CLASS="function"
31529
>env.CXXFile()</CODE
31530
></DT
31531
><DD
31532
><P
31533
>&#13;Builds a C++ source file given a lex (<TT
31534
CLASS="filename"
31535
>.ll</TT
31536
>)
31537
or yacc (<TT
31538
CLASS="filename"
31539
>.yy</TT
31540
>)
31541
input file.
31542
The suffix specified by the <A
31543
HREF="#cv-CXXFILESUFFIX"
31544
><CODE
31545
CLASS="envar"
31546
>$CXXFILESUFFIX</CODE
31547
></A
31548
> construction variable
31549
(<TT
31550
CLASS="filename"
31551
>.cc</TT
31552
> by default)
31553
is automatically added to the target
31554
if it is not already present.
31555
Example:
31556
</P
31557
><PRE
31558
CLASS="programlisting"
31559
>&#13;# builds foo.cc
31560
env.CXXFile(target = 'foo.cc', source = 'foo.ll')
31561
# builds bar.cc
31562
env.CXXFile(target = 'bar', source = 'bar.yy')
31563
</PRE
31564
></DD
31565
><DT
31566
><A
31567
NAME="b-DVI"
31568
></A
31569
><CODE
31570
CLASS="function"
31571
>DVI()</CODE
31572
>, <CODE
31573
CLASS="function"
31574
>env.DVI()</CODE
31575
></DT
31576
><DD
31577
><P
31578
>&#13;Builds a <TT
31579
CLASS="filename"
31580
>.dvi</TT
31581
> file
31582
from a <TT
31583
CLASS="filename"
31584
>.tex</TT
31585
>,
31586
<TT
31587
CLASS="filename"
31588
>.ltx</TT
31589
> or <TT
31590
CLASS="filename"
31591
>.latex</TT
31592
> input file.
31593
If the source file suffix is <TT
31594
CLASS="filename"
31595
>.tex</TT
31596
>,
31597
<SPAN
31598
CLASS="application"
31599
>scons</SPAN
31600
>
31601
will examine the contents of the file;
31602
if the string
31603
<TT
31604
CLASS="literal"
31605
>\documentclass</TT
31606
>
31607
or
31608
<TT
31609
CLASS="literal"
31610
>\documentstyle</TT
31611
>
31612
is found, the file is assumed to be a LaTeX file and
31613
the target is built by invoking the <A
31614
HREF="#cv-LATEXCOM"
31615
><CODE
31616
CLASS="envar"
31617
>$LATEXCOM</CODE
31618
></A
31619
> command line;
31620
otherwise, the <A
31621
HREF="#cv-TEXCOM"
31622
><CODE
31623
CLASS="envar"
31624
>$TEXCOM</CODE
31625
></A
31626
> command line is used.
31627
If the file is a LaTeX file,
31628
the
31629
<CODE
31630
CLASS="function"
31631
>DVI</CODE
31632
>
31633
builder method will also examine the contents
31634
of the
31635
<TT
31636
CLASS="filename"
31637
>.aux</TT
31638
>
31639
file and invoke the <A
31640
HREF="#cv-BIBTEX"
31641
><CODE
31642
CLASS="envar"
31643
>$BIBTEX</CODE
31644
></A
31645
> command line
31646
if the string
31647
<TT
31648
CLASS="literal"
31649
>bibdata</TT
31650
>
31651
is found,
31652
start <A
31653
HREF="#cv-MAKEINDEX"
31654
><CODE
31655
CLASS="envar"
31656
>$MAKEINDEX</CODE
31657
></A
31658
> to generate an index if a
31659
<TT
31660
CLASS="filename"
31661
>.ind</TT
31662
>
31663
file is found
31664
and will examine the contents
31665
<TT
31666
CLASS="filename"
31667
>.log</TT
31668
>
31669
file and re-run the <A
31670
HREF="#cv-LATEXCOM"
31671
><CODE
31672
CLASS="envar"
31673
>$LATEXCOM</CODE
31674
></A
31675
> command
31676
if the log file says it is necessary.</P
31677
><P
31678
>The suffix <TT
31679
CLASS="filename"
31680
>.dvi</TT
31681
>
31682
(hard-coded within TeX itself)
31683
is automatically added to the target
31684
if it is not already present.
31685
Examples:
31686
</P
31687
><PRE
31688
CLASS="programlisting"
31689
>&#13;# builds from aaa.tex
31690
env.DVI(target = 'aaa.dvi', source = 'aaa.tex')
31691
# builds bbb.dvi
31692
env.DVI(target = 'bbb', source = 'bbb.ltx')
31693
# builds from ccc.latex
31694
env.DVI(target = 'ccc.dvi', source = 'ccc.latex')
31695
</PRE
31696
></DD
31697
><DT
31698
><A
31699
NAME="b-Install"
31700
></A
31701
><CODE
31702
CLASS="function"
31703
>Install()</CODE
31704
>, <CODE
31705
CLASS="function"
31706
>env.Install()</CODE
31707
></DT
31708
><DD
31709
><P
31710
>&#13;Installs one or more source files or directories
31711
in the specified target,
31712
which must be a directory.
31713
The names of the specified source files or directories
31714
remain the same within the destination directory.
31715
</P
31716
><PRE
31717
CLASS="programlisting"
31718
>&#13;env.Install('/usr/local/bin', source = ['foo', 'bar'])
31719
</PRE
31720
></DD
31721
><DT
31722
><A
31723
NAME="b-InstallAs"
31724
></A
31725
><CODE
31726
CLASS="function"
31727
>InstallAs()</CODE
31728
>, <CODE
31729
CLASS="function"
31730
>env.InstallAs()</CODE
31731
></DT
31732
><DD
31733
><P
31734
>&#13;Installs one or more source files or directories
31735
to specific names,
31736
allowing changing a file or directory name
31737
as part of the installation.
31738
It is an error if the
31739
target
31740
and
31741
source
31742
arguments list different numbers of files or directories.
31743
</P
31744
><PRE
31745
CLASS="programlisting"
31746
>&#13;env.InstallAs(target = '/usr/local/bin/foo',
31747
              source = 'foo_debug')
31748
env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'],
31749
              source = ['libFOO.a', 'libBAR.a'])
31750
</PRE
31751
></DD
31752
><DT
31753
><A
31754
NAME="b-Jar"
31755
></A
31756
><CODE
31757
CLASS="function"
31758
>Jar()</CODE
31759
>, <CODE
31760
CLASS="function"
31761
>env.Jar()</CODE
31762
></DT
31763
><DD
31764
><P
31765
>&#13;Builds a Java archive (<TT
31766
CLASS="filename"
31767
>.jar</TT
31768
>) file
31769
from the specified list of sources.
31770
Any directories in the source list
31771
will be searched for <TT
31772
CLASS="filename"
31773
>.class</TT
31774
> files).
31775
Any <TT
31776
CLASS="filename"
31777
>.java</TT
31778
> files in the source list
31779
will be compiled  to <TT
31780
CLASS="filename"
31781
>.class</TT
31782
> files
31783
by calling the <A
31784
HREF="#b-Java"
31785
><CODE
31786
CLASS="function"
31787
>Java</CODE
31788
></A
31789
> Builder.</P
31790
><P
31791
>If the <A
31792
HREF="#cv-JARCHDIR"
31793
><CODE
31794
CLASS="envar"
31795
>$JARCHDIR</CODE
31796
></A
31797
> value is set, the
31798
<SPAN
31799
CLASS="application"
31800
>jar</SPAN
31801
>
31802
command will change to the specified directory using the
31803
<CODE
31804
CLASS="option"
31805
>-C</CODE
31806
>
31807
option.
31808
If <CODE
31809
CLASS="envar"
31810
>$JARCHDIR</CODE
31811
> is not set explicitly,
31812
<SPAN
31813
CLASS="application"
31814
>SCons</SPAN
31815
> will use the top of any subdirectory tree
31816
in which Java <TT
31817
CLASS="filename"
31818
>.class</TT
31819
>
31820
were built by the <A
31821
HREF="#b-Java"
31822
><CODE
31823
CLASS="function"
31824
>Java</CODE
31825
></A
31826
> Builder.</P
31827
><P
31828
>If the contents any of the source files begin with the string
31829
<TT
31830
CLASS="literal"
31831
>Manifest-Version</TT
31832
>,
31833
the file is assumed to be a manifest
31834
and is passed to the
31835
<SPAN
31836
CLASS="application"
31837
>jar</SPAN
31838
>
31839
command with the
31840
<CODE
31841
CLASS="option"
31842
>m</CODE
31843
>
31844
option set.
31845
</P
31846
><PRE
31847
CLASS="programlisting"
31848
>&#13;env.Jar(target = 'foo.jar', source = 'classes')
31849
31850
env.Jar(target = 'bar.jar',
31851
        source = ['bar1.java', 'bar2.java'])
31852
</PRE
31853
></DD
31854
><DT
31855
><A
31856
NAME="b-Java"
31857
></A
31858
><CODE
31859
CLASS="function"
31860
>Java()</CODE
31861
>, <CODE
31862
CLASS="function"
31863
>env.Java()</CODE
31864
></DT
31865
><DD
31866
><P
31867
>&#13;Builds one or more Java class files.
31868
The sources may be any combination of explicit
31869
<TT
31870
CLASS="filename"
31871
>.java</TT
31872
> files,
31873
or directory trees which will be scanned
31874
for <TT
31875
CLASS="filename"
31876
>.java</TT
31877
> files.</P
31878
><P
31879
>SCons will parse each source <TT
31880
CLASS="filename"
31881
>.java</TT
31882
> file
31883
to find the classes
31884
(including inner classes)
31885
defined within that file,
31886
and from that figure out the
31887
target <TT
31888
CLASS="filename"
31889
>.class</TT
31890
> files that will be created.
31891
The class files will be placed underneath
31892
the specified target directory.</P
31893
><P
31894
>SCons will also search each Java file
31895
for the Java package name,
31896
which it assumes can be found on a line
31897
beginning with the string
31898
<TT
31899
CLASS="literal"
31900
>package</TT
31901
>
31902
in the first column;
31903
the resulting <TT
31904
CLASS="filename"
31905
>.class</TT
31906
> files
31907
will be placed in a directory reflecting
31908
the specified package name.
31909
For example,
31910
the file
31911
<TT
31912
CLASS="filename"
31913
>Foo.java</TT
31914
>
31915
defining a single public
31916
<CODE
31917
CLASS="classname"
31918
>Foo</CODE
31919
>
31920
class and
31921
containing a package name of
31922
<CODE
31923
CLASS="classname"
31924
>sub.dir</CODE
31925
>
31926
will generate a corresponding
31927
<TT
31928
CLASS="filename"
31929
>sub/dir/Foo.class</TT
31930
>
31931
class file.</P
31932
><P
31933
>Example:
31934
</P
31935
><PRE
31936
CLASS="programlisting"
31937
>&#13;env.Java(target = 'classes', source = 'src')
31938
env.Java(target = 'classes', source = ['src1', 'src2'])
31939
env.Java(target = 'classes', source = ['File1.java', 'File2.java'])
31940
</PRE
31941
></DD
31942
><DT
31943
><A
31944
NAME="b-JavaH"
31945
></A
31946
><CODE
31947
CLASS="function"
31948
>JavaH()</CODE
31949
>, <CODE
31950
CLASS="function"
31951
>env.JavaH()</CODE
31952
></DT
31953
><DD
31954
><P
31955
>&#13;Builds C header and source files for
31956
implementing Java native methods.
31957
The target can be either a directory
31958
in which the header files will be written,
31959
or a header file name which
31960
will contain all of the definitions.
31961
The source can be the names of <TT
31962
CLASS="filename"
31963
>.class</TT
31964
> files,
31965
the names of <TT
31966
CLASS="filename"
31967
>.java</TT
31968
> files
31969
to be compiled into <TT
31970
CLASS="filename"
31971
>.class</TT
31972
> files
31973
by calling the <A
31974
HREF="#b-Java"
31975
><CODE
31976
CLASS="function"
31977
>Java</CODE
31978
></A
31979
> builder method,
31980
or the objects returned from the
31981
<CODE
31982
CLASS="function"
31983
>Java</CODE
31984
>
31985
builder method.</P
31986
><P
31987
>If the construction variable
31988
<A
31989
HREF="#cv-JAVACLASSDIR"
31990
><CODE
31991
CLASS="envar"
31992
>$JAVACLASSDIR</CODE
31993
></A
31994
>
31995
is set, either in the environment
31996
or in the call to the
31997
<CODE
31998
CLASS="function"
31999
>JavaH</CODE
32000
>
32001
builder method itself,
32002
then the value of the variable
32003
will be stripped from the
32004
beginning of any <TT
32005
CLASS="filename"
32006
>.class</TT
32007
> file names.</P
32008
><P
32009
>Examples:
32010
</P
32011
><PRE
32012
CLASS="programlisting"
32013
>&#13;# builds java_native.h
32014
classes = env.Java(target = 'classdir', source = 'src')
32015
env.JavaH(target = 'java_native.h', source = classes)
32016
32017
# builds include/package_foo.h and include/package_bar.h
32018
env.JavaH(target = 'include',
32019
          source = ['package/foo.class', 'package/bar.class'])
32020
32021
# builds export/foo.h and export/bar.h
32022
env.JavaH(target = 'export',
32023
          source = ['classes/foo.class', 'classes/bar.class'],
32024
          JAVACLASSDIR = 'classes')
32025
</PRE
32026
></DD
32027
><DT
32028
><A
32029
NAME="b-Library"
32030
></A
32031
><CODE
32032
CLASS="function"
32033
>Library()</CODE
32034
>, <CODE
32035
CLASS="function"
32036
>env.Library()</CODE
32037
></DT
32038
><DD
32039
><P
32040
>&#13;A synonym for the
32041
<CODE
32042
CLASS="function"
32043
>StaticLibrary</CODE
32044
>
32045
builder method.
32046
</P
32047
></DD
32048
><DT
32049
><A
32050
NAME="b-LoadableModule"
32051
></A
32052
><CODE
32053
CLASS="function"
32054
>LoadableModule()</CODE
32055
>, <CODE
32056
CLASS="function"
32057
>env.LoadableModule()</CODE
32058
></DT
32059
><DD
32060
><P
32061
>&#13;On most systems,
32062
this is the same as
32063
<CODE
32064
CLASS="function"
32065
>SharedLibrary</CODE
32066
>.
32067
On Mac OS X (Darwin) platforms,
32068
this creates a loadable module bundle.
32069
</P
32070
></DD
32071
><DT
32072
><A
32073
NAME="b-M4"
32074
></A
32075
><CODE
32076
CLASS="function"
32077
>M4()</CODE
32078
>, <CODE
32079
CLASS="function"
32080
>env.M4()</CODE
32081
></DT
32082
><DD
32083
><P
32084
>&#13;Builds an output file from an M4 input file.
32085
This uses a default <A
32086
HREF="#cv-M4FLAGS"
32087
><CODE
32088
CLASS="envar"
32089
>$M4FLAGS</CODE
32090
></A
32091
> value of
32092
<CODE
32093
CLASS="option"
32094
>-E</CODE
32095
>,
32096
which considers all warnings to be fatal
32097
and stops on the first warning
32098
when using the GNU version of m4.
32099
Example:
32100
</P
32101
><PRE
32102
CLASS="programlisting"
32103
>&#13;env.M4(target = 'foo.c', source = 'foo.c.m4')
32104
</PRE
32105
></DD
32106
><DT
32107
><A
32108
NAME="b-Moc"
32109
></A
32110
><CODE
32111
CLASS="function"
32112
>Moc()</CODE
32113
>, <CODE
32114
CLASS="function"
32115
>env.Moc()</CODE
32116
></DT
32117
><DD
32118
><P
32119
>&#13;Builds an output file from a moc input file. Moc input files are either
32120
header files or cxx files. This builder is only available after using the
32121
tool 'qt'. See the <A
32122
HREF="#cv-QTDIR"
32123
><CODE
32124
CLASS="envar"
32125
>$QTDIR</CODE
32126
></A
32127
> variable for more information.
32128
Example:
32129
</P
32130
><PRE
32131
CLASS="programlisting"
32132
>&#13;env.Moc('foo.h') # generates moc_foo.cc
32133
env.Moc('foo.cpp') # generates foo.moc
32134
</PRE
32135
></DD
32136
><DT
32137
><A
32138
NAME="b-MSVSProject"
32139
></A
32140
><CODE
32141
CLASS="function"
32142
>MSVSProject()</CODE
32143
>, <CODE
32144
CLASS="function"
32145
>env.MSVSProject()</CODE
32146
></DT
32147
><DD
32148
><P
32149
>&#13;Builds a Microsoft Visual Studio project file,
32150
and by default builds a solution file as well.</P
32151
><P
32152
>This builds a Visual Studio project file, based on the version of
32153
Visual Studio that is configured (either the latest installed version,
32154
or the version specified by
32155
<A
32156
HREF="#cv-MSVS_VERSION"
32157
><CODE
32158
CLASS="envar"
32159
>$MSVS_VERSION</CODE
32160
></A
32161
>
32162
in the Environment constructor).
32163
For Visual Studio 6, it will generate a
32164
<TT
32165
CLASS="filename"
32166
>.dsp</TT
32167
>
32168
file.
32169
For Visual Studio 7 (.NET) and later versions, it will generate a
32170
<TT
32171
CLASS="filename"
32172
>.vcproj</TT
32173
>
32174
file.</P
32175
><P
32176
>By default,
32177
this also generates a solution file
32178
for the specified project,
32179
a
32180
<TT
32181
CLASS="filename"
32182
>.dsw</TT
32183
>
32184
file for Visual Studio 6
32185
or a
32186
<TT
32187
CLASS="filename"
32188
>.sln</TT
32189
>
32190
file for Visual Studio 7 (.NET).
32191
This behavior may be disabled by specifying
32192
<TT
32193
CLASS="literal"
32194
>auto_build_solution=0</TT
32195
>
32196
when you call
32197
<CODE
32198
CLASS="function"
32199
>MSVSProject</CODE
32200
>,
32201
in which case you presumably want to
32202
build the solution file(s)
32203
by calling the
32204
<CODE
32205
CLASS="function"
32206
>MSVSSolution</CODE
32207
>
32208
Builder (see below).</P
32209
><P
32210
>It takes several lists of filenames to be placed into the project
32211
file.
32212
These are currently limited to
32213
<TT
32214
CLASS="literal"
32215
>srcs</TT
32216
>,
32217
<TT
32218
CLASS="literal"
32219
>incs</TT
32220
>,
32221
<TT
32222
CLASS="literal"
32223
>localincs</TT
32224
>,
32225
<TT
32226
CLASS="literal"
32227
>resources</TT
32228
>,
32229
and
32230
<TT
32231
CLASS="literal"
32232
>misc</TT
32233
>.
32234
These are pretty self-explanatory, but it should be noted that these
32235
lists are added to the <A
32236
HREF="#cv-SOURCES"
32237
><CODE
32238
CLASS="envar"
32239
>$SOURCES</CODE
32240
></A
32241
> construction variable as strings,
32242
NOT as SCons File Nodes.  This is because they represent file
32243
names to be added to the project file, not the source files used to
32244
build the project file.</P
32245
><P
32246
>The above filename lists are all optional,
32247
although at least one must be specified
32248
for the resulting project file to be non-empty.</P
32249
><P
32250
>In addition to the above lists of values,
32251
the following values may be specified:</P
32252
><P
32253
><TT
32254
CLASS="literal"
32255
>target</TT
32256
>:
32257
The name of the target
32258
<TT
32259
CLASS="filename"
32260
>.dsp</TT
32261
>
32262
or
32263
<TT
32264
CLASS="filename"
32265
>.vcproj</TT
32266
>
32267
file.
32268
The correct
32269
suffix for the version of Visual Studio must be used,
32270
but the
32271
<A
32272
HREF="#cv-MSVSPROJECTSUFFIX"
32273
><CODE
32274
CLASS="envar"
32275
>$MSVSPROJECTSUFFIX</CODE
32276
></A
32277
>
32278
construction variable
32279
will be defined to the correct value (see example below).</P
32280
><P
32281
><TT
32282
CLASS="literal"
32283
>variant</TT
32284
>:
32285
The name of this particular variant.
32286
For Visual Studio 7 projects,
32287
this can also be a list of variant names.
32288
These are typically things like "Debug" or "Release", but really
32289
can be anything you want.
32290
For Visual Studio 7 projects,
32291
they may also specify a target platform
32292
separated from the variant name by a
32293
<TT
32294
CLASS="literal"
32295
>|</TT
32296
>
32297
(vertical pipe)
32298
character:
32299
<TT
32300
CLASS="literal"
32301
>Debug|Xbox</TT
32302
>.
32303
The default target platform is Win32.
32304
Multiple calls to
32305
<CODE
32306
CLASS="function"
32307
>MSVSProject</CODE
32308
>
32309
with different variants are allowed;
32310
all variants will be added to the project file with their appropriate
32311
build targets and sources.</P
32312
><P
32313
><TT
32314
CLASS="literal"
32315
>buildtarget</TT
32316
>:
32317
An optional string, node, or list of strings or nodes
32318
(one per build variant), to tell the Visual Studio debugger
32319
what output target to use in what build variant.
32320
The number of
32321
<TT
32322
CLASS="literal"
32323
>buildtarget</TT
32324
>
32325
entries must match the number of
32326
<TT
32327
CLASS="literal"
32328
>variant</TT
32329
>
32330
entries.</P
32331
><P
32332
><TT
32333
CLASS="literal"
32334
>runfile</TT
32335
>:
32336
The name of the file that Visual Studio 7 and later
32337
will run and debug.
32338
This appears as the value of the
32339
<TT
32340
CLASS="literal"
32341
>Output</TT
32342
>
32343
field in the resutling Visual Studio project file.
32344
If this is not specified,
32345
the default is the same as the specified
32346
<TT
32347
CLASS="literal"
32348
>buildtarget</TT
32349
>
32350
value.</P
32351
><P
32352
>Example usage:
32353
</P
32354
><PRE
32355
CLASS="programlisting"
32356
>&#13;barsrcs = ['bar.cpp'],
32357
barincs = ['bar.h'],
32358
barlocalincs = ['StdAfx.h']
32359
barresources = ['bar.rc','resource.h']
32360
barmisc = ['bar_readme.txt']
32361
32362
dll = env.SharedLibrary(target = 'bar.dll',
32363
                        source = barsrcs)
32364
32365
env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'],
32366
                srcs = barsrcs,
32367
                incs = barincs,
32368
                localincs = barlocalincs,
32369
                resources = barresources,
32370
                misc = barmisc,
32371
                buildtarget = dll,
32372
                variant = 'Release')
32373
</PRE
32374
></DD
32375
><DT
32376
><A
32377
NAME="b-MSVSSolution"
32378
></A
32379
><CODE
32380
CLASS="function"
32381
>MSVSSolution()</CODE
32382
>, <CODE
32383
CLASS="function"
32384
>env.MSVSSolution()</CODE
32385
></DT
32386
><DD
32387
><P
32388
>&#13;Builds a Microsoft Visual Studio solution file.</P
32389
><P
32390
>This builds a Visual Studio solution file,
32391
based on the version of Visual Studio that is configured
32392
(either the latest installed version,
32393
or the version specified by
32394
<A
32395
HREF="#cv-MSVS_VERSION"
32396
><CODE
32397
CLASS="envar"
32398
>$MSVS_VERSION</CODE
32399
></A
32400
>
32401
in the construction environment).
32402
For Visual Studio 6, it will generate a
32403
<TT
32404
CLASS="filename"
32405
>.dsw</TT
32406
>
32407
file.
32408
For Visual Studio 7 (.NET), it will
32409
generate a
32410
<TT
32411
CLASS="filename"
32412
>.sln</TT
32413
>
32414
file.</P
32415
><P
32416
>The following values must be specified:</P
32417
><P
32418
><TT
32419
CLASS="literal"
32420
>target</TT
32421
>:
32422
The name of the target .dsw or .sln file.  The correct
32423
suffix for the version of Visual Studio must be used, but the value
32424
<A
32425
HREF="#cv-MSVSSOLUTIONSUFFIX"
32426
><CODE
32427
CLASS="envar"
32428
>$MSVSSOLUTIONSUFFIX</CODE
32429
></A
32430
>
32431
will be defined to the correct value (see example below).</P
32432
><P
32433
><TT
32434
CLASS="literal"
32435
>variant</TT
32436
>:
32437
The name of this particular variant, or a list of variant
32438
names (the latter is only supported for MSVS 7 solutions). These are
32439
typically things like "Debug" or "Release", but really can be anything
32440
you want. For MSVS 7 they may also specify target platform, like this
32441
"Debug|Xbox". Default platform is Win32.</P
32442
><P
32443
><TT
32444
CLASS="literal"
32445
>projects</TT
32446
>:
32447
A list of project file names, or Project nodes returned by calls to the
32448
<CODE
32449
CLASS="function"
32450
>MSVSProject</CODE
32451
>
32452
Builder,
32453
to be placed into the solution file.
32454
It should be noted that these file names are NOT added to the $SOURCES
32455
environment variable in form of files, but rather as strings.   This
32456
is because they represent file names to be added to the solution file,
32457
not the source files used to build the solution file.</P
32458
><P
32459
>(NOTE: Currently only one project is supported per solution.)</P
32460
><P
32461
>Example Usage:
32462
</P
32463
><PRE
32464
CLASS="programlisting"
32465
>&#13;env.MSVSSolution(target = 'Bar' + env['MSVSSOLUTIONSUFFIX'],
32466
                 projects = ['bar' + env['MSVSPROJECTSUFFIX']],
32467
                 variant = 'Release')
32468
</PRE
32469
></DD
32470
><DT
32471
><A
32472
NAME="b-Object"
32473
></A
32474
><CODE
32475
CLASS="function"
32476
>Object()</CODE
32477
>, <CODE
32478
CLASS="function"
32479
>env.Object()</CODE
32480
></DT
32481
><DD
32482
><P
32483
>&#13;A synonym for the
32484
<CODE
32485
CLASS="function"
32486
>StaticObject</CODE
32487
>
32488
builder method.
32489
</P
32490
></DD
32491
><DT
32492
><A
32493
NAME="b-Package"
32494
></A
32495
><CODE
32496
CLASS="function"
32497
>Package()</CODE
32498
>, <CODE
32499
CLASS="function"
32500
>env.Package()</CODE
32501
></DT
32502
><DD
32503
><P
32504
>&#13;Builds software distribution packages.  Packages consist of files
32505
to install and packaging information.  The former may be specified
32506
with the <CODE
32507
CLASS="varname"
32508
>source</CODE
32509
> parameter and may be left out, in which case the
32510
<CODE
32511
CLASS="function"
32512
>FindInstalledFiles</CODE
32513
> function will collect all files that have an
32514
<CODE
32515
CLASS="function"
32516
>Install</CODE
32517
> or <CODE
32518
CLASS="function"
32519
>InstallAs</CODE
32520
> Builder attached.  If the <CODE
32521
CLASS="varname"
32522
>target</CODE
32523
>, is
32524
not specified it will be deduced from additional information given to
32525
this Builder.</P
32526
><P
32527
>The packaging information is specified with the help of construction
32528
variables documented below.  This information is called a tag to stress
32529
that some of them can also be attached to files with the <CODE
32530
CLASS="function"
32531
>Tag</CODE
32532
> function.
32533
The mandatory ones will complain if they were not specified.  They vary
32534
depending on chosen target packager.</P
32535
><P
32536
>The target packager may be selected with the "PACKAGETYPE" command line
32537
option or with the <CODE
32538
CLASS="envar"
32539
>$PACKAGETYPE</CODE
32540
> construction variable. Currently
32541
the following packagers available:</P
32542
><P
32543
> * msi - Microsoft Installer
32544
 * rpm - Redhat Package Manger
32545
 * ipkg - Itsy Package Management System
32546
 * tarbz2 - compressed tar
32547
 * targz - compressed tar
32548
 * zip - zip file
32549
 * src_tarbz2 - compressed tar source
32550
 * src_targz - compressed tar source
32551
 * src_zip - zip file source</P
32552
><P
32553
>An updated list is always available under the "package_type" option when
32554
running "scons --help" on a project that has packaging activated.
32555
</P
32556
><PRE
32557
CLASS="programlisting"
32558
>&#13;env = Environment(tools=['default', 'packaging'])
32559
env.Install('/bin/', 'my_program')
32560
env.Package( NAME           = 'foo',
32561
             VERSION        = '1.2.3',
32562
             PACKAGEVERSION = 0,
32563
             PACKAGETYPE    = 'rpm',
32564
             LICENSE        = 'gpl',
32565
             SUMMARY        = 'balalalalal',
32566
             DESCRIPTION    = 'this should be really really long',
32567
             X_RPM_GROUP    = 'Application/fu',
32568
             SOURCE_URL     = 'http://foo.org/foo-1.2.3.tar.gz'
32569
        )
32570
</PRE
32571
></DD
32572
><DT
32573
><A
32574
NAME="b-PCH"
32575
></A
32576
><CODE
32577
CLASS="function"
32578
>PCH()</CODE
32579
>, <CODE
32580
CLASS="function"
32581
>env.PCH()</CODE
32582
></DT
32583
><DD
32584
><P
32585
>&#13;Builds a Microsoft Visual C++ precompiled header.
32586
Calling this builder method
32587
returns a list of two targets: the PCH as the first element, and the object
32588
file as the second element. Normally the object file is ignored.
32589
This builder method is only
32590
provided when Microsoft Visual C++ is being used as the compiler.
32591
The PCH builder method is generally used in
32592
conjuction with the PCH construction variable to force object files to use
32593
the precompiled header:
32594
</P
32595
><PRE
32596
CLASS="programlisting"
32597
>&#13;env['PCH'] = env.PCH('StdAfx.cpp')[0]
32598
</PRE
32599
></DD
32600
><DT
32601
><A
32602
NAME="b-PDF"
32603
></A
32604
><CODE
32605
CLASS="function"
32606
>PDF()</CODE
32607
>, <CODE
32608
CLASS="function"
32609
>env.PDF()</CODE
32610
></DT
32611
><DD
32612
><P
32613
>&#13;Builds a <TT
32614
CLASS="filename"
32615
>.pdf</TT
32616
> file
32617
from a <TT
32618
CLASS="filename"
32619
>.dvi</TT
32620
> input file
32621
(or, by extension, a <TT
32622
CLASS="filename"
32623
>.tex</TT
32624
>,
32625
<TT
32626
CLASS="filename"
32627
>.ltx</TT
32628
>,
32629
or
32630
<TT
32631
CLASS="filename"
32632
>.latex</TT
32633
> input file).
32634
The suffix specified by the <A
32635
HREF="#cv-PDFSUFFIX"
32636
><CODE
32637
CLASS="envar"
32638
>$PDFSUFFIX</CODE
32639
></A
32640
> construction variable
32641
(<TT
32642
CLASS="filename"
32643
>.pdf</TT
32644
> by default)
32645
is added automatically to the target
32646
if it is not already present.  Example:
32647
</P
32648
><PRE
32649
CLASS="programlisting"
32650
>&#13;# builds from aaa.tex
32651
env.PDF(target = 'aaa.pdf', source = 'aaa.tex')
32652
# builds bbb.pdf from bbb.dvi
32653
env.PDF(target = 'bbb', source = 'bbb.dvi')
32654
</PRE
32655
></DD
32656
><DT
32657
><A
32658
NAME="b-PostScript"
32659
></A
32660
><CODE
32661
CLASS="function"
32662
>PostScript()</CODE
32663
>, <CODE
32664
CLASS="function"
32665
>env.PostScript()</CODE
32666
></DT
32667
><DD
32668
><P
32669
>&#13;Builds a <TT
32670
CLASS="filename"
32671
>.ps</TT
32672
> file
32673
from a <TT
32674
CLASS="filename"
32675
>.dvi</TT
32676
> input file
32677
(or, by extension, a <TT
32678
CLASS="filename"
32679
>.tex</TT
32680
>,
32681
<TT
32682
CLASS="filename"
32683
>.ltx</TT
32684
>,
32685
or
32686
<TT
32687
CLASS="filename"
32688
>.latex</TT
32689
> input file).
32690
The suffix specified by the <A
32691
HREF="#cv-PSSUFFIX"
32692
><CODE
32693
CLASS="envar"
32694
>$PSSUFFIX</CODE
32695
></A
32696
> construction variable
32697
(<TT
32698
CLASS="filename"
32699
>.ps</TT
32700
> by default)
32701
is added automatically to the target
32702
if it is not already present.  Example:
32703
</P
32704
><PRE
32705
CLASS="programlisting"
32706
>&#13;# builds from aaa.tex
32707
env.PostScript(target = 'aaa.ps', source = 'aaa.tex')
32708
# builds bbb.ps from bbb.dvi
32709
env.PostScript(target = 'bbb', source = 'bbb.dvi')
32710
</PRE
32711
></DD
32712
><DT
32713
><A
32714
NAME="b-Program"
32715
></A
32716
><CODE
32717
CLASS="function"
32718
>Program()</CODE
32719
>, <CODE
32720
CLASS="function"
32721
>env.Program()</CODE
32722
></DT
32723
><DD
32724
><P
32725
>&#13;Builds an executable given one or more object files
32726
or C, C++, D, or Fortran source files.
32727
If any C, C++, D or Fortran source files are specified,
32728
then they will be automatically
32729
compiled to object files using the
32730
<CODE
32731
CLASS="function"
32732
>Object</CODE
32733
>
32734
builder method;
32735
see that builder method's description for
32736
a list of legal source file suffixes
32737
and how they are interpreted.
32738
The target executable file prefix
32739
(specified by the <A
32740
HREF="#cv-PROGPREFIX"
32741
><CODE
32742
CLASS="envar"
32743
>$PROGPREFIX</CODE
32744
></A
32745
> construction variable; nothing by default)
32746
and suffix
32747
(specified by the <A
32748
HREF="#cv-PROGSUFFIX"
32749
><CODE
32750
CLASS="envar"
32751
>$PROGSUFFIX</CODE
32752
></A
32753
> construction variable;
32754
by default, <TT
32755
CLASS="filename"
32756
>.exe</TT
32757
> on Windows systems,
32758
nothing on POSIX systems)
32759
are automatically added to the target if not already present.
32760
Example:
32761
</P
32762
><PRE
32763
CLASS="programlisting"
32764
>&#13;env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f'])
32765
</PRE
32766
></DD
32767
><DT
32768
><A
32769
NAME="b-RES"
32770
></A
32771
><CODE
32772
CLASS="function"
32773
>RES()</CODE
32774
>, <CODE
32775
CLASS="function"
32776
>env.RES()</CODE
32777
></DT
32778
><DD
32779
><P
32780
>&#13;Builds a Microsoft Visual C++ resource file.
32781
This builder method is only provided
32782
when Microsoft Visual C++ or MinGW is being used as the compiler. The
32783
<TT
32784
CLASS="filename"
32785
>.res</TT
32786
>
32787
(or
32788
<TT
32789
CLASS="filename"
32790
>.o</TT
32791
>
32792
for MinGW) suffix is added to the target name if no other suffix is given.
32793
The source
32794
file is scanned for implicit dependencies as though it were a C file.
32795
Example:
32796
</P
32797
><PRE
32798
CLASS="programlisting"
32799
>&#13;env.RES('resource.rc')
32800
</PRE
32801
></DD
32802
><DT
32803
><A
32804
NAME="b-RMIC"
32805
></A
32806
><CODE
32807
CLASS="function"
32808
>RMIC()</CODE
32809
>, <CODE
32810
CLASS="function"
32811
>env.RMIC()</CODE
32812
></DT
32813
><DD
32814
><P
32815
>&#13;Builds stub and skeleton class files
32816
for remote objects
32817
from Java <TT
32818
CLASS="filename"
32819
>.class</TT
32820
> files.
32821
The target is a directory
32822
relative to which the stub
32823
and skeleton class files will be written.
32824
The source can be the names of <TT
32825
CLASS="filename"
32826
>.class</TT
32827
> files,
32828
or the objects return from the
32829
<CODE
32830
CLASS="function"
32831
>Java</CODE
32832
>
32833
builder method.</P
32834
><P
32835
>If the construction variable
32836
<A
32837
HREF="#cv-JAVACLASSDIR"
32838
><CODE
32839
CLASS="envar"
32840
>$JAVACLASSDIR</CODE
32841
></A
32842
>
32843
is set, either in the environment
32844
or in the call to the
32845
<CODE
32846
CLASS="function"
32847
>RMIC</CODE
32848
>
32849
builder method itself,
32850
then the value of the variable
32851
will be stripped from the
32852
beginning of any <TT
32853
CLASS="filename"
32854
>.class </TT
32855
>
32856
file names.
32857
</P
32858
><PRE
32859
CLASS="programlisting"
32860
>&#13;classes = env.Java(target = 'classdir', source = 'src')
32861
env.RMIC(target = 'outdir1', source = classes)
32862
32863
env.RMIC(target = 'outdir2',
32864
         source = ['package/foo.class', 'package/bar.class'])
32865
32866
env.RMIC(target = 'outdir3',
32867
         source = ['classes/foo.class', 'classes/bar.class'],
32868
         JAVACLASSDIR = 'classes')
32869
</PRE
32870
></DD
32871
><DT
32872
><A
32873
NAME="b-RPCGenClient"
32874
></A
32875
><CODE
32876
CLASS="function"
32877
>RPCGenClient()</CODE
32878
>, <CODE
32879
CLASS="function"
32880
>env.RPCGenClient()</CODE
32881
></DT
32882
><DD
32883
><P
32884
>&#13;Generates an RPC client stub (<TT
32885
CLASS="filename"
32886
>_clnt.c</TT
32887
>) file
32888
from a specified RPC (<TT
32889
CLASS="filename"
32890
>.x</TT
32891
>) source file.
32892
Because rpcgen only builds output files
32893
in the local directory,
32894
the command will be executed
32895
in the source file's directory by default.
32896
</P
32897
><PRE
32898
CLASS="programlisting"
32899
>&#13;# Builds src/rpcif_clnt.c
32900
env.RPCGenClient('src/rpcif.x')
32901
</PRE
32902
></DD
32903
><DT
32904
><A
32905
NAME="b-RPCGenHeader"
32906
></A
32907
><CODE
32908
CLASS="function"
32909
>RPCGenHeader()</CODE
32910
>, <CODE
32911
CLASS="function"
32912
>env.RPCGenHeader()</CODE
32913
></DT
32914
><DD
32915
><P
32916
>&#13;Generates an RPC header (<TT
32917
CLASS="filename"
32918
>.h</TT
32919
>) file
32920
from a specified RPC (<TT
32921
CLASS="filename"
32922
>.x</TT
32923
>) source file.
32924
Because rpcgen only builds output files
32925
in the local directory,
32926
the command will be executed
32927
in the source file's directory by default.
32928
</P
32929
><PRE
32930
CLASS="programlisting"
32931
>&#13;# Builds src/rpcif.h
32932
env.RPCGenHeader('src/rpcif.x')
32933
</PRE
32934
></DD
32935
><DT
32936
><A
32937
NAME="b-RPCGenService"
32938
></A
32939
><CODE
32940
CLASS="function"
32941
>RPCGenService()</CODE
32942
>, <CODE
32943
CLASS="function"
32944
>env.RPCGenService()</CODE
32945
></DT
32946
><DD
32947
><P
32948
>&#13;Generates an RPC server-skeleton (<TT
32949
CLASS="filename"
32950
>_svc.c</TT
32951
>) file
32952
from a specified RPC (<TT
32953
CLASS="filename"
32954
>.x</TT
32955
>) source file.
32956
Because rpcgen only builds output files
32957
in the local directory,
32958
the command will be executed
32959
in the source file's directory by default.
32960
</P
32961
><PRE
32962
CLASS="programlisting"
32963
>&#13;# Builds src/rpcif_svc.c
32964
env.RPCGenClient('src/rpcif.x')
32965
</PRE
32966
></DD
32967
><DT
32968
><A
32969
NAME="b-RPCGenXDR"
32970
></A
32971
><CODE
32972
CLASS="function"
32973
>RPCGenXDR()</CODE
32974
>, <CODE
32975
CLASS="function"
32976
>env.RPCGenXDR()</CODE
32977
></DT
32978
><DD
32979
><P
32980
>&#13;Generates an RPC XDR routine (<TT
32981
CLASS="filename"
32982
>_xdr.c</TT
32983
>) file
32984
from a specified RPC (<TT
32985
CLASS="filename"
32986
>.x</TT
32987
>) source file.
32988
Because rpcgen only builds output files
32989
in the local directory,
32990
the command will be executed
32991
in the source file's directory by default.
32992
</P
32993
><PRE
32994
CLASS="programlisting"
32995
>&#13;# Builds src/rpcif_xdr.c
32996
env.RPCGenClient('src/rpcif.x')
32997
</PRE
32998
></DD
32999
><DT
33000
><A
33001
NAME="b-SharedLibrary"
33002
></A
33003
><CODE
33004
CLASS="function"
33005
>SharedLibrary()</CODE
33006
>, <CODE
33007
CLASS="function"
33008
>env.SharedLibrary()</CODE
33009
></DT
33010
><DD
33011
><P
33012
>&#13;Builds a shared library
33013
(<TT
33014
CLASS="filename"
33015
>.so</TT
33016
> on a POSIX system,
33017
<TT
33018
CLASS="filename"
33019
>.dll</TT
33020
> on Windows)
33021
given one or more object files
33022
or C, C++, D or Fortran source files.
33023
If any source files are given,
33024
then they will be automatically
33025
compiled to object files.
33026
The static library prefix and suffix (if any)
33027
are automatically added to the target.
33028
The target library file prefix
33029
(specified by the <A
33030
HREF="#cv-SHLIBPREFIX"
33031
><CODE
33032
CLASS="envar"
33033
>$SHLIBPREFIX</CODE
33034
></A
33035
> construction variable;
33036
by default, <TT
33037
CLASS="filename"
33038
>lib</TT
33039
> on POSIX systems,
33040
nothing on Windows systems)
33041
and suffix
33042
(specified by the <A
33043
HREF="#cv-SHLIBSUFFIX"
33044
><CODE
33045
CLASS="envar"
33046
>$SHLIBSUFFIX</CODE
33047
></A
33048
> construction variable;
33049
by default, <TT
33050
CLASS="filename"
33051
>.dll</TT
33052
> on Windows systems,
33053
<TT
33054
CLASS="filename"
33055
>.so</TT
33056
> on POSIX systems)
33057
are automatically added to the target if not already present.
33058
Example:
33059
</P
33060
><PRE
33061
CLASS="programlisting"
33062
>&#13;env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'])
33063
</PRE
33064
><P
33065
>&#13;On Windows systems, the
33066
<CODE
33067
CLASS="function"
33068
>SharedLibrary</CODE
33069
>
33070
builder method will always build an import
33071
(<TT
33072
CLASS="filename"
33073
>.lib</TT
33074
>) library
33075
in addition to the shared (<TT
33076
CLASS="filename"
33077
>.dll</TT
33078
>) library,
33079
adding a <TT
33080
CLASS="filename"
33081
>.lib</TT
33082
> library with the same basename
33083
if there is not already a <TT
33084
CLASS="filename"
33085
>.lib</TT
33086
> file explicitly
33087
listed in the targets.</P
33088
><P
33089
>Any object files listed in the
33090
<TT
33091
CLASS="literal"
33092
>source</TT
33093
>
33094
must have been built for a shared library
33095
(that is, using the
33096
<CODE
33097
CLASS="function"
33098
>SharedObject</CODE
33099
>
33100
builder method).
33101
<SPAN
33102
CLASS="application"
33103
>scons</SPAN
33104
>
33105
will raise an error if there is any mismatch.</P
33106
><P
33107
>On Windows systems, specifying
33108
<TT
33109
CLASS="literal"
33110
>register=1</TT
33111
>
33112
will cause the <TT
33113
CLASS="filename"
33114
>.dll</TT
33115
> to be
33116
registered after it is built using REGSVR32.
33117
The command that is run
33118
("regsvr32" by default) is determined by <A
33119
HREF="#cv-REGSVR"
33120
><CODE
33121
CLASS="envar"
33122
>$REGSVR</CODE
33123
></A
33124
> construction
33125
variable, and the flags passed are determined by <A
33126
HREF="#cv-REGSVRFLAGS"
33127
><CODE
33128
CLASS="envar"
33129
>$REGSVRFLAGS</CODE
33130
></A
33131
>.  By
33132
default, <A
33133
HREF="#cv-REGSVRFLAGS"
33134
><CODE
33135
CLASS="envar"
33136
>$REGSVRFLAGS</CODE
33137
></A
33138
> includes the <CODE
33139
CLASS="option"
33140
>/s</CODE
33141
> option,
33142
to prevent dialogs from popping
33143
up and requiring user attention when it is run.  If you change
33144
<A
33145
HREF="#cv-REGSVRFLAGS"
33146
><CODE
33147
CLASS="envar"
33148
>$REGSVRFLAGS</CODE
33149
></A
33150
>, be sure to include the <CODE
33151
CLASS="option"
33152
>/s</CODE
33153
> option.
33154
For example,
33155
</P
33156
><PRE
33157
CLASS="programlisting"
33158
>&#13;env.SharedLibrary(target = 'bar',
33159
                  source = ['bar.cxx', 'foo.obj'],
33160
                  register=1)
33161
</PRE
33162
><P
33163
>&#13;will register <TT
33164
CLASS="filename"
33165
>bar.dll</TT
33166
> as a COM object
33167
when it is done linking it.
33168
</P
33169
></DD
33170
><DT
33171
><A
33172
NAME="b-SharedObject"
33173
></A
33174
><CODE
33175
CLASS="function"
33176
>SharedObject()</CODE
33177
>, <CODE
33178
CLASS="function"
33179
>env.SharedObject()</CODE
33180
></DT
33181
><DD
33182
><P
33183
>&#13;Builds an object file for
33184
inclusion in a shared library.
33185
Source files must have one of the same set of extensions
33186
specified above for the
33187
<CODE
33188
CLASS="function"
33189
>StaticObject</CODE
33190
>
33191
builder method.
33192
On some platforms building a shared object requires additional
33193
compiler option
33194
(e.g. <CODE
33195
CLASS="option"
33196
>-fPIC</CODE
33197
> for gcc)
33198
in addition to those needed to build a
33199
normal (static) object, but on some platforms there is no difference between a
33200
shared object and a normal (static) one. When there is a difference, SCons
33201
will only allow shared objects to be linked into a shared library, and will
33202
use a different suffix for shared objects. On platforms where there is no
33203
difference, SCons will allow both normal (static)
33204
and shared objects to be linked into a
33205
shared library, and will use the same suffix for shared and normal
33206
(static) objects.
33207
The target object file prefix
33208
(specified by the <A
33209
HREF="#cv-SHOBJPREFIX"
33210
><CODE
33211
CLASS="envar"
33212
>$SHOBJPREFIX</CODE
33213
></A
33214
> construction variable;
33215
by default, the same as <A
33216
HREF="#cv-OBJPREFIX"
33217
><CODE
33218
CLASS="envar"
33219
>$OBJPREFIX</CODE
33220
></A
33221
>)
33222
and suffix
33223
(specified by the <A
33224
HREF="#cv-SHOBJSUFFIX"
33225
><CODE
33226
CLASS="envar"
33227
>$SHOBJSUFFIX</CODE
33228
></A
33229
> construction variable)
33230
are automatically added to the target if not already present.
33231
Examples:
33232
</P
33233
><PRE
33234
CLASS="programlisting"
33235
>&#13;env.SharedObject(target = 'ddd', source = 'ddd.c')
33236
env.SharedObject(target = 'eee.o', source = 'eee.cpp')
33237
env.SharedObject(target = 'fff.obj', source = 'fff.for')
33238
</PRE
33239
><P
33240
>&#13;Note that the source files will be scanned
33241
according to the suffix mappings in the
33242
<TT
33243
CLASS="literal"
33244
>SourceFileScanner</TT
33245
>
33246
object.
33247
See the section "Scanner Objects,"
33248
below, for a more information.
33249
</P
33250
></DD
33251
><DT
33252
><A
33253
NAME="b-StaticLibrary"
33254
></A
33255
><CODE
33256
CLASS="function"
33257
>StaticLibrary()</CODE
33258
>, <CODE
33259
CLASS="function"
33260
>env.StaticLibrary()</CODE
33261
></DT
33262
><DD
33263
><P
33264
>&#13;Builds a static library given one or more object files
33265
or C, C++, D or Fortran source files.
33266
If any source files are given,
33267
then they will be automatically
33268
compiled to object files.
33269
The static library prefix and suffix (if any)
33270
are automatically added to the target.
33271
The target library file prefix
33272
(specified by the <A
33273
HREF="#cv-LIBPREFIX"
33274
><CODE
33275
CLASS="envar"
33276
>$LIBPREFIX</CODE
33277
></A
33278
> construction variable;
33279
by default, <TT
33280
CLASS="filename"
33281
>lib</TT
33282
> on POSIX systems,
33283
nothing on Windows systems)
33284
and suffix
33285
(specified by the <A
33286
HREF="#cv-LIBSUFFIX"
33287
><CODE
33288
CLASS="envar"
33289
>$LIBSUFFIX</CODE
33290
></A
33291
> construction variable;
33292
by default, <TT
33293
CLASS="filename"
33294
>.lib</TT
33295
> on Windows systems,
33296
<TT
33297
CLASS="filename"
33298
>.a</TT
33299
> on POSIX systems)
33300
are automatically added to the target if not already present.
33301
Example:
33302
</P
33303
><PRE
33304
CLASS="programlisting"
33305
>&#13;env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o'])
33306
</PRE
33307
><P
33308
>&#13;Any object files listed in the
33309
<TT
33310
CLASS="literal"
33311
>source</TT
33312
>
33313
must have been built for a static library
33314
(that is, using the
33315
<CODE
33316
CLASS="function"
33317
>StaticObject</CODE
33318
>
33319
builder method).
33320
<SPAN
33321
CLASS="application"
33322
>scons</SPAN
33323
>
33324
will raise an error if there is any mismatch.
33325
</P
33326
></DD
33327
><DT
33328
><A
33329
NAME="b-StaticObject"
33330
></A
33331
><CODE
33332
CLASS="function"
33333
>StaticObject()</CODE
33334
>, <CODE
33335
CLASS="function"
33336
>env.StaticObject()</CODE
33337
></DT
33338
><DD
33339
><P
33340
>&#13;Builds a static object file
33341
from one or more C, C++, D, or Fortran source files.
33342
Source files must have one of the following extensions:
33343
</P
33344
><PRE
33345
CLASS="programlisting"
33346
>&#13;  .asm    assembly language file
33347
  .ASM    assembly language file
33348
  .c      C file
33349
  .C      Windows:  C file
33350
          POSIX:  C++ file
33351
  .cc     C++ file
33352
  .cpp    C++ file
33353
  .cxx    C++ file
33354
  .cxx    C++ file
33355
  .c++    C++ file
33356
  .C++    C++ file
33357
  .d      D file
33358
  .f      Fortran file
33359
  .F      Windows:  Fortran file
33360
          POSIX:  Fortran file + C pre-processor
33361
  .for    Fortran file
33362
  .FOR    Fortran file
33363
  .fpp    Fortran file + C pre-processor
33364
  .FPP    Fortran file + C pre-processor
33365
  .m      Object C file
33366
  .mm     Object C++ file
33367
  .s      assembly language file
33368
  .S      Windows:  assembly language file
33369
          POSIX:  assembly language file + C pre-processor
33370
  .spp    assembly language file + C pre-processor
33371
  .SPP    assembly language file + C pre-processor
33372
</PRE
33373
><P
33374
>&#13;The target object file prefix
33375
(specified by the <A
33376
HREF="#cv-OBJPREFIX"
33377
><CODE
33378
CLASS="envar"
33379
>$OBJPREFIX</CODE
33380
></A
33381
> construction variable; nothing by default)
33382
and suffix
33383
(specified by the <A
33384
HREF="#cv-OBJSUFFIX"
33385
><CODE
33386
CLASS="envar"
33387
>$OBJSUFFIX</CODE
33388
></A
33389
> construction variable;
33390
<TT
33391
CLASS="filename"
33392
>.obj</TT
33393
> on Windows systems,
33394
<TT
33395
CLASS="filename"
33396
>.o</TT
33397
> on POSIX systems)
33398
are automatically added to the target if not already present.
33399
Examples:
33400
</P
33401
><PRE
33402
CLASS="programlisting"
33403
>&#13;env.StaticObject(target = 'aaa', source = 'aaa.c')
33404
env.StaticObject(target = 'bbb.o', source = 'bbb.c++')
33405
env.StaticObject(target = 'ccc.obj', source = 'ccc.f')
33406
</PRE
33407
><P
33408
>&#13;Note that the source files will be scanned
33409
according to the suffix mappings in
33410
<TT
33411
CLASS="literal"
33412
>SourceFileScanner</TT
33413
>
33414
object.
33415
See the section "Scanner Objects,"
33416
below, for a more information.
33417
</P
33418
></DD
33419
><DT
33420
><A
33421
NAME="b-Tar"
33422
></A
33423
><CODE
33424
CLASS="function"
33425
>Tar()</CODE
33426
>, <CODE
33427
CLASS="function"
33428
>env.Tar()</CODE
33429
></DT
33430
><DD
33431
><P
33432
>&#13;Builds a tar archive of the specified files
33433
and/or directories.
33434
Unlike most builder methods,
33435
the
33436
<CODE
33437
CLASS="function"
33438
>Tar</CODE
33439
>
33440
builder method may be called multiple times
33441
for a given target;
33442
each additional call
33443
adds to the list of entries
33444
that will be built into the archive.
33445
Any source directories will
33446
be scanned for changes to
33447
any on-disk files,
33448
regardless of whether or not
33449
<SPAN
33450
CLASS="application"
33451
>scons</SPAN
33452
>
33453
knows about them from other Builder or function calls.
33454
</P
33455
><PRE
33456
CLASS="programlisting"
33457
>&#13;env.Tar('src.tar', 'src')
33458
33459
# Create the stuff.tar file.
33460
env.Tar('stuff', ['subdir1', 'subdir2'])
33461
# Also add "another" to the stuff.tar file.
33462
env.Tar('stuff', 'another')
33463
33464
# Set TARFLAGS to create a gzip-filtered archive.
33465
env = Environment(TARFLAGS = '-c -z')
33466
env.Tar('foo.tar.gz', 'foo')
33467
33468
# Also set the suffix to .tgz.
33469
env = Environment(TARFLAGS = '-c -z',
33470
                  TARSUFFIX = '.tgz')
33471
env.Tar('foo')
33472
</PRE
33473
></DD
33474
><DT
33475
><A
33476
NAME="b-TypeLibrary"
33477
></A
33478
><CODE
33479
CLASS="function"
33480
>TypeLibrary()</CODE
33481
>, <CODE
33482
CLASS="function"
33483
>env.TypeLibrary()</CODE
33484
></DT
33485
><DD
33486
><P
33487
>&#13;Builds a Windows type library (<TT
33488
CLASS="filename"
33489
>.tlb</TT
33490
>)
33491
file from an input IDL file (<TT
33492
CLASS="filename"
33493
>.idl</TT
33494
>).
33495
In addition, it will build the associated inteface stub and
33496
proxy source files,
33497
naming them according to the base name of the <TT
33498
CLASS="filename"
33499
>.idl</TT
33500
> file.
33501
For example,
33502
</P
33503
><PRE
33504
CLASS="programlisting"
33505
>&#13;env.TypeLibrary(source="foo.idl")
33506
</PRE
33507
><P
33508
>&#13;Will create <TT
33509
CLASS="filename"
33510
>foo.tlb</TT
33511
>,
33512
<TT
33513
CLASS="filename"
33514
>foo.h</TT
33515
>,
33516
<TT
33517
CLASS="filename"
33518
>foo_i.c</TT
33519
>,
33520
<TT
33521
CLASS="filename"
33522
>foo_p.c</TT
33523
>
33524
and
33525
<TT
33526
CLASS="filename"
33527
>foo_data.c</TT
33528
>
33529
files.
33530
</P
33531
></DD
33532
><DT
33533
><A
33534
NAME="b-Uic"
33535
></A
33536
><CODE
33537
CLASS="function"
33538
>Uic()</CODE
33539
>, <CODE
33540
CLASS="function"
33541
>env.Uic()</CODE
33542
></DT
33543
><DD
33544
><P
33545
>&#13;Builds a header file, an implementation file and a moc file from an ui file.
33546
and returns the corresponding nodes in the above order.
33547
This builder is only available after using the tool 'qt'. Note: you can
33548
specify <TT
33549
CLASS="filename"
33550
>.ui</TT
33551
> files directly as source
33552
files to the <CODE
33553
CLASS="function"
33554
>Program</CODE
33555
>,
33556
<CODE
33557
CLASS="function"
33558
>Library</CODE
33559
> and <CODE
33560
CLASS="function"
33561
>SharedLibrary</CODE
33562
> builders
33563
without using this builder. Using this builder lets you override the standard
33564
naming conventions (be careful: prefixes are always prepended to names of
33565
built files; if you don't want prefixes, you may set them to ``).
33566
See the <A
33567
HREF="#cv-QTDIR"
33568
><CODE
33569
CLASS="envar"
33570
>$QTDIR</CODE
33571
></A
33572
> variable for more information.
33573
Example:
33574
</P
33575
><PRE
33576
CLASS="programlisting"
33577
>&#13;env.Uic('foo.ui') # -&#62; ['foo.h', 'uic_foo.cc', 'moc_foo.cc']
33578
env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'),
33579
        source = 'foo.ui') # -&#62; ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc']
33580
</PRE
33581
></DD
33582
><DT
33583
><A
33584
NAME="b-Zip"
33585
></A
33586
><CODE
33587
CLASS="function"
33588
>Zip()</CODE
33589
>, <CODE
33590
CLASS="function"
33591
>env.Zip()</CODE
33592
></DT
33593
><DD
33594
><P
33595
>&#13;Builds a zip archive of the specified files
33596
and/or directories.
33597
Unlike most builder methods,
33598
the
33599
<CODE
33600
CLASS="function"
33601
>Zip</CODE
33602
>
33603
builder method may be called multiple times
33604
for a given target;
33605
each additional call
33606
adds to the list of entries
33607
that will be built into the archive.
33608
Any source directories will
33609
be scanned for changes to
33610
any on-disk files,
33611
regardless of whether or not
33612
<SPAN
33613
CLASS="application"
33614
>scons</SPAN
33615
>
33616
knows about them from other Builder or function calls.
33617
</P
33618
><PRE
33619
CLASS="programlisting"
33620
>&#13;env.Zip('src.zip', 'src')
33621
33622
# Create the stuff.zip file.
33623
env.Zip('stuff', ['subdir1', 'subdir2'])
33624
# Also add "another" to the stuff.tar file.
33625
env.Zip('stuff', 'another')
33626
</PRE
33627
></DD
33628
></DL
33629
></DIV
33630
></DIV
33631
><DIV
33632
CLASS="appendix"
33633
><HR><H1
33634
><A
33635
NAME="app-tools"
33636
></A
33637
>Appendix C. Tools</H1
33638
><P
33639
>&#13;
33640
This appendix contains descriptions of all of the
33641
Tools modules that are
33642
available "out of the box" in this version of SCons.
33643
33644
</P
33645
><P
33646
></P
33647
><DIV
33648
CLASS="variablelist"
33649
><DL
33650
><DT
33651
><A
33652
NAME="t-386asm"
33653
></A
33654
><TT
33655
CLASS="literal"
33656
>386asm</TT
33657
></DT
33658
><DD
33659
><P
33660
>&#13;Sets construction variables for the 386ASM assembler
33661
for the Phar Lap ETS embedded operating system.
33662
</P
33663
><P
33664
>&#13;Sets:  <A
33665
HREF="#cv-AS"
33666
><CODE
33667
CLASS="envar"
33668
>$AS</CODE
33669
></A
33670
>, <A
33671
HREF="#cv-ASCOM"
33672
><CODE
33673
CLASS="envar"
33674
>$ASCOM</CODE
33675
></A
33676
>, <A
33677
HREF="#cv-ASFLAGS"
33678
><CODE
33679
CLASS="envar"
33680
>$ASFLAGS</CODE
33681
></A
33682
>, <A
33683
HREF="#cv-ASPPCOM"
33684
><CODE
33685
CLASS="envar"
33686
>$ASPPCOM</CODE
33687
></A
33688
>, <A
33689
HREF="#cv-ASPPFLAGS"
33690
><CODE
33691
CLASS="envar"
33692
>$ASPPFLAGS</CODE
33693
></A
33694
>.
33695
</P
33696
><P
33697
>&#13;Uses:  <A
33698
HREF="#cv-CC"
33699
><CODE
33700
CLASS="envar"
33701
>$CC</CODE
33702
></A
33703
>, <A
33704
HREF="#cv-CPPFLAGS"
33705
><CODE
33706
CLASS="envar"
33707
>$CPPFLAGS</CODE
33708
></A
33709
>, <A
33710
HREF="#cv-_CPPDEFFLAGS"
33711
><CODE
33712
CLASS="envar"
33713
>$_CPPDEFFLAGS</CODE
33714
></A
33715
>, <A
33716
HREF="#cv-_CPPINCFLAGS"
33717
><CODE
33718
CLASS="envar"
33719
>$_CPPINCFLAGS</CODE
33720
></A
33721
>.
33722
</P
33723
></DD
33724
><DT
33725
><A
33726
NAME="t-aixcXX"
33727
></A
33728
><TT
33729
CLASS="literal"
33730
>aixc++</TT
33731
></DT
33732
><DD
33733
><P
33734
>&#13;Sets construction variables for the IMB xlc / Visual Age C++ compiler.
33735
</P
33736
><P
33737
>&#13;Sets:  <A
33738
HREF="#cv-CXX"
33739
><CODE
33740
CLASS="envar"
33741
>$CXX</CODE
33742
></A
33743
>, <A
33744
HREF="#cv-CXXVERSION"
33745
><CODE
33746
CLASS="envar"
33747
>$CXXVERSION</CODE
33748
></A
33749
>, <A
33750
HREF="#cv-SHCXX"
33751
><CODE
33752
CLASS="envar"
33753
>$SHCXX</CODE
33754
></A
33755
>, <A
33756
HREF="#cv-SHOBJSUFFIX"
33757
><CODE
33758
CLASS="envar"
33759
>$SHOBJSUFFIX</CODE
33760
></A
33761
>.
33762
</P
33763
></DD
33764
><DT
33765
><A
33766
NAME="t-aixcc"
33767
></A
33768
><TT
33769
CLASS="literal"
33770
>aixcc</TT
33771
></DT
33772
><DD
33773
><P
33774
>&#13;Sets construction variables for the IBM xlc / Visual Age C compiler.
33775
</P
33776
><P
33777
>&#13;Sets:  <A
33778
HREF="#cv-CC"
33779
><CODE
33780
CLASS="envar"
33781
>$CC</CODE
33782
></A
33783
>, <A
33784
HREF="#cv-CCVERSION"
33785
><CODE
33786
CLASS="envar"
33787
>$CCVERSION</CODE
33788
></A
33789
>, <A
33790
HREF="#cv-SHCC"
33791
><CODE
33792
CLASS="envar"
33793
>$SHCC</CODE
33794
></A
33795
>.
33796
</P
33797
></DD
33798
><DT
33799
><A
33800
NAME="t-aixf77"
33801
></A
33802
><TT
33803
CLASS="literal"
33804
>aixf77</TT
33805
></DT
33806
><DD
33807
><P
33808
>&#13;Sets construction variables for the IBM Visual Age f77 Fortran compiler.
33809
</P
33810
><P
33811
>&#13;Sets:  <A
33812
HREF="#cv-F77"
33813
><CODE
33814
CLASS="envar"
33815
>$F77</CODE
33816
></A
33817
>, <A
33818
HREF="#cv-SHF77"
33819
><CODE
33820
CLASS="envar"
33821
>$SHF77</CODE
33822
></A
33823
>.
33824
</P
33825
></DD
33826
><DT
33827
><A
33828
NAME="t-aixlink"
33829
></A
33830
><TT
33831
CLASS="literal"
33832
>aixlink</TT
33833
></DT
33834
><DD
33835
><P
33836
>&#13;Sets construction variables for the IBM Visual Age linker.
33837
</P
33838
><P
33839
>&#13;Sets:  <A
33840
HREF="#cv-LINKFLAGS"
33841
><CODE
33842
CLASS="envar"
33843
>$LINKFLAGS</CODE
33844
></A
33845
>, <A
33846
HREF="#cv-SHLIBSUFFIX"
33847
><CODE
33848
CLASS="envar"
33849
>$SHLIBSUFFIX</CODE
33850
></A
33851
>, <A
33852
HREF="#cv-SHLINKFLAGS"
33853
><CODE
33854
CLASS="envar"
33855
>$SHLINKFLAGS</CODE
33856
></A
33857
>.
33858
</P
33859
></DD
33860
><DT
33861
><A
33862
NAME="t-applelink"
33863
></A
33864
><TT
33865
CLASS="literal"
33866
>applelink</TT
33867
></DT
33868
><DD
33869
><P
33870
>&#13;Sets construction variables for the Apple linker
33871
(similar to the GNU linker).
33872
</P
33873
><P
33874
>&#13;Sets:  <A
33875
HREF="#cv-FRAMEWORKPATHPREFIX"
33876
><CODE
33877
CLASS="envar"
33878
>$FRAMEWORKPATHPREFIX</CODE
33879
></A
33880
>, <A
33881
HREF="#cv-LDMODULECOM"
33882
><CODE
33883
CLASS="envar"
33884
>$LDMODULECOM</CODE
33885
></A
33886
>, <A
33887
HREF="#cv-LDMODULEFLAGS"
33888
><CODE
33889
CLASS="envar"
33890
>$LDMODULEFLAGS</CODE
33891
></A
33892
>, <A
33893
HREF="#cv-LDMODULEPREFIX"
33894
><CODE
33895
CLASS="envar"
33896
>$LDMODULEPREFIX</CODE
33897
></A
33898
>, <A
33899
HREF="#cv-LDMODULESUFFIX"
33900
><CODE
33901
CLASS="envar"
33902
>$LDMODULESUFFIX</CODE
33903
></A
33904
>, <A
33905
HREF="#cv-LINKCOM"
33906
><CODE
33907
CLASS="envar"
33908
>$LINKCOM</CODE
33909
></A
33910
>, <A
33911
HREF="#cv-SHLINKCOM"
33912
><CODE
33913
CLASS="envar"
33914
>$SHLINKCOM</CODE
33915
></A
33916
>, <A
33917
HREF="#cv-SHLINKFLAGS"
33918
><CODE
33919
CLASS="envar"
33920
>$SHLINKFLAGS</CODE
33921
></A
33922
>, <A
33923
HREF="#cv-_FRAMEWORKPATH"
33924
><CODE
33925
CLASS="envar"
33926
>$_FRAMEWORKPATH</CODE
33927
></A
33928
>, <A
33929
HREF="#cv-_FRAMEWORKS"
33930
><CODE
33931
CLASS="envar"
33932
>$_FRAMEWORKS</CODE
33933
></A
33934
>.
33935
</P
33936
><P
33937
>&#13;Uses:  <A
33938
HREF="#cv-FRAMEWORKSFLAGS"
33939
><CODE
33940
CLASS="envar"
33941
>$FRAMEWORKSFLAGS</CODE
33942
></A
33943
>.
33944
</P
33945
></DD
33946
><DT
33947
><A
33948
NAME="t-ar"
33949
></A
33950
><TT
33951
CLASS="literal"
33952
>ar</TT
33953
></DT
33954
><DD
33955
><P
33956
>&#13;Sets construction variables for the <SPAN
33957
CLASS="application"
33958
>ar</SPAN
33959
> library archiver.
33960
</P
33961
><P
33962
>&#13;Sets:  <A
33963
HREF="#cv-AR"
33964
><CODE
33965
CLASS="envar"
33966
>$AR</CODE
33967
></A
33968
>, <A
33969
HREF="#cv-ARCOM"
33970
><CODE
33971
CLASS="envar"
33972
>$ARCOM</CODE
33973
></A
33974
>, <A
33975
HREF="#cv-ARFLAGS"
33976
><CODE
33977
CLASS="envar"
33978
>$ARFLAGS</CODE
33979
></A
33980
>, <A
33981
HREF="#cv-LIBPREFIX"
33982
><CODE
33983
CLASS="envar"
33984
>$LIBPREFIX</CODE
33985
></A
33986
>, <A
33987
HREF="#cv-LIBSUFFIX"
33988
><CODE
33989
CLASS="envar"
33990
>$LIBSUFFIX</CODE
33991
></A
33992
>, <A
33993
HREF="#cv-RANLIB"
33994
><CODE
33995
CLASS="envar"
33996
>$RANLIB</CODE
33997
></A
33998
>, <A
33999
HREF="#cv-RANLIBCOM"
34000
><CODE
34001
CLASS="envar"
34002
>$RANLIBCOM</CODE
34003
></A
34004
>, <A
34005
HREF="#cv-RANLIBFLAGS"
34006
><CODE
34007
CLASS="envar"
34008
>$RANLIBFLAGS</CODE
34009
></A
34010
>.
34011
</P
34012
></DD
34013
><DT
34014
><A
34015
NAME="t-as"
34016
></A
34017
><TT
34018
CLASS="literal"
34019
>as</TT
34020
></DT
34021
><DD
34022
><P
34023
>&#13;Sets construction variables for the <SPAN
34024
CLASS="application"
34025
>as</SPAN
34026
> assembler.
34027
</P
34028
><P
34029
>&#13;Sets:  <A
34030
HREF="#cv-AS"
34031
><CODE
34032
CLASS="envar"
34033
>$AS</CODE
34034
></A
34035
>, <A
34036
HREF="#cv-ASCOM"
34037
><CODE
34038
CLASS="envar"
34039
>$ASCOM</CODE
34040
></A
34041
>, <A
34042
HREF="#cv-ASFLAGS"
34043
><CODE
34044
CLASS="envar"
34045
>$ASFLAGS</CODE
34046
></A
34047
>, <A
34048
HREF="#cv-ASPPCOM"
34049
><CODE
34050
CLASS="envar"
34051
>$ASPPCOM</CODE
34052
></A
34053
>, <A
34054
HREF="#cv-ASPPFLAGS"
34055
><CODE
34056
CLASS="envar"
34057
>$ASPPFLAGS</CODE
34058
></A
34059
>.
34060
</P
34061
><P
34062
>&#13;Uses:  <A
34063
HREF="#cv-CC"
34064
><CODE
34065
CLASS="envar"
34066
>$CC</CODE
34067
></A
34068
>, <A
34069
HREF="#cv-CPPFLAGS"
34070
><CODE
34071
CLASS="envar"
34072
>$CPPFLAGS</CODE
34073
></A
34074
>, <A
34075
HREF="#cv-_CPPDEFFLAGS"
34076
><CODE
34077
CLASS="envar"
34078
>$_CPPDEFFLAGS</CODE
34079
></A
34080
>, <A
34081
HREF="#cv-_CPPINCFLAGS"
34082
><CODE
34083
CLASS="envar"
34084
>$_CPPINCFLAGS</CODE
34085
></A
34086
>.
34087
</P
34088
></DD
34089
><DT
34090
><A
34091
NAME="t-bcc32"
34092
></A
34093
><TT
34094
CLASS="literal"
34095
>bcc32</TT
34096
></DT
34097
><DD
34098
><P
34099
>&#13;Sets construction variables for the bcc32 compiler.
34100
</P
34101
><P
34102
>&#13;Sets:  <A
34103
HREF="#cv-CC"
34104
><CODE
34105
CLASS="envar"
34106
>$CC</CODE
34107
></A
34108
>, <A
34109
HREF="#cv-CCCOM"
34110
><CODE
34111
CLASS="envar"
34112
>$CCCOM</CODE
34113
></A
34114
>, <A
34115
HREF="#cv-CCFLAGS"
34116
><CODE
34117
CLASS="envar"
34118
>$CCFLAGS</CODE
34119
></A
34120
>, <A
34121
HREF="#cv-CFILESUFFIX"
34122
><CODE
34123
CLASS="envar"
34124
>$CFILESUFFIX</CODE
34125
></A
34126
>, <A
34127
HREF="#cv-CFLAGS"
34128
><CODE
34129
CLASS="envar"
34130
>$CFLAGS</CODE
34131
></A
34132
>, <A
34133
HREF="#cv-CPPDEFPREFIX"
34134
><CODE
34135
CLASS="envar"
34136
>$CPPDEFPREFIX</CODE
34137
></A
34138
>, <A
34139
HREF="#cv-CPPDEFSUFFIX"
34140
><CODE
34141
CLASS="envar"
34142
>$CPPDEFSUFFIX</CODE
34143
></A
34144
>, <A
34145
HREF="#cv-INCPREFIX"
34146
><CODE
34147
CLASS="envar"
34148
>$INCPREFIX</CODE
34149
></A
34150
>, <A
34151
HREF="#cv-INCSUFFIX"
34152
><CODE
34153
CLASS="envar"
34154
>$INCSUFFIX</CODE
34155
></A
34156
>, <A
34157
HREF="#cv-SHCC"
34158
><CODE
34159
CLASS="envar"
34160
>$SHCC</CODE
34161
></A
34162
>, <A
34163
HREF="#cv-SHCCCOM"
34164
><CODE
34165
CLASS="envar"
34166
>$SHCCCOM</CODE
34167
></A
34168
>, <A
34169
HREF="#cv-SHCCFLAGS"
34170
><CODE
34171
CLASS="envar"
34172
>$SHCCFLAGS</CODE
34173
></A
34174
>, <A
34175
HREF="#cv-SHCFLAGS"
34176
><CODE
34177
CLASS="envar"
34178
>$SHCFLAGS</CODE
34179
></A
34180
>, <A
34181
HREF="#cv-SHOBJSUFFIX"
34182
><CODE
34183
CLASS="envar"
34184
>$SHOBJSUFFIX</CODE
34185
></A
34186
>.
34187
</P
34188
><P
34189
>&#13;Uses:  <A
34190
HREF="#cv-_CPPDEFFLAGS"
34191
><CODE
34192
CLASS="envar"
34193
>$_CPPDEFFLAGS</CODE
34194
></A
34195
>, <A
34196
HREF="#cv-_CPPINCFLAGS"
34197
><CODE
34198
CLASS="envar"
34199
>$_CPPINCFLAGS</CODE
34200
></A
34201
>.
34202
</P
34203
></DD
34204
><DT
34205
><A
34206
NAME="t-BitKeeper"
34207
></A
34208
><TT
34209
CLASS="literal"
34210
>BitKeeper</TT
34211
></DT
34212
><DD
34213
><P
34214
>&#13;Sets construction variables for the BitKeeper
34215
source code control system.
34216
</P
34217
><P
34218
>&#13;Sets:  <A
34219
HREF="#cv-BITKEEPER"
34220
><CODE
34221
CLASS="envar"
34222
>$BITKEEPER</CODE
34223
></A
34224
>, <A
34225
HREF="#cv-BITKEEPERCOM"
34226
><CODE
34227
CLASS="envar"
34228
>$BITKEEPERCOM</CODE
34229
></A
34230
>, <A
34231
HREF="#cv-BITKEEPERGET"
34232
><CODE
34233
CLASS="envar"
34234
>$BITKEEPERGET</CODE
34235
></A
34236
>, <A
34237
HREF="#cv-BITKEEPERGETFLAGS"
34238
><CODE
34239
CLASS="envar"
34240
>$BITKEEPERGETFLAGS</CODE
34241
></A
34242
>.
34243
</P
34244
><P
34245
>&#13;Uses:  <A
34246
HREF="#cv-BITKEEPERCOMSTR"
34247
><CODE
34248
CLASS="envar"
34249
>$BITKEEPERCOMSTR</CODE
34250
></A
34251
>.
34252
</P
34253
></DD
34254
><DT
34255
><A
34256
NAME="t-cc"
34257
></A
34258
><TT
34259
CLASS="literal"
34260
>cc</TT
34261
></DT
34262
><DD
34263
><P
34264
>&#13;Sets construction variables for generic POSIX C copmilers.
34265
</P
34266
><P
34267
>&#13;Sets:  <A
34268
HREF="#cv-CC"
34269
><CODE
34270
CLASS="envar"
34271
>$CC</CODE
34272
></A
34273
>, <A
34274
HREF="#cv-CCCOM"
34275
><CODE
34276
CLASS="envar"
34277
>$CCCOM</CODE
34278
></A
34279
>, <A
34280
HREF="#cv-CCFLAGS"
34281
><CODE
34282
CLASS="envar"
34283
>$CCFLAGS</CODE
34284
></A
34285
>, <A
34286
HREF="#cv-CFILESUFFIX"
34287
><CODE
34288
CLASS="envar"
34289
>$CFILESUFFIX</CODE
34290
></A
34291
>, <A
34292
HREF="#cv-CFLAGS"
34293
><CODE
34294
CLASS="envar"
34295
>$CFLAGS</CODE
34296
></A
34297
>, <A
34298
HREF="#cv-CPPDEFPREFIX"
34299
><CODE
34300
CLASS="envar"
34301
>$CPPDEFPREFIX</CODE
34302
></A
34303
>, <A
34304
HREF="#cv-CPPDEFSUFFIX"
34305
><CODE
34306
CLASS="envar"
34307
>$CPPDEFSUFFIX</CODE
34308
></A
34309
>, <A
34310
HREF="#cv-FRAMEWORKPATH"
34311
><CODE
34312
CLASS="envar"
34313
>$FRAMEWORKPATH</CODE
34314
></A
34315
>, <A
34316
HREF="#cv-FRAMEWORKS"
34317
><CODE
34318
CLASS="envar"
34319
>$FRAMEWORKS</CODE
34320
></A
34321
>, <A
34322
HREF="#cv-INCPREFIX"
34323
><CODE
34324
CLASS="envar"
34325
>$INCPREFIX</CODE
34326
></A
34327
>, <A
34328
HREF="#cv-INCSUFFIX"
34329
><CODE
34330
CLASS="envar"
34331
>$INCSUFFIX</CODE
34332
></A
34333
>, <A
34334
HREF="#cv-SHCC"
34335
><CODE
34336
CLASS="envar"
34337
>$SHCC</CODE
34338
></A
34339
>, <A
34340
HREF="#cv-SHCCCOM"
34341
><CODE
34342
CLASS="envar"
34343
>$SHCCCOM</CODE
34344
></A
34345
>, <A
34346
HREF="#cv-SHCCFLAGS"
34347
><CODE
34348
CLASS="envar"
34349
>$SHCCFLAGS</CODE
34350
></A
34351
>, <A
34352
HREF="#cv-SHCFLAGS"
34353
><CODE
34354
CLASS="envar"
34355
>$SHCFLAGS</CODE
34356
></A
34357
>, <A
34358
HREF="#cv-SHOBJSUFFIX"
34359
><CODE
34360
CLASS="envar"
34361
>$SHOBJSUFFIX</CODE
34362
></A
34363
>.
34364
</P
34365
><P
34366
>&#13;Uses:  <A
34367
HREF="#cv-PLATFORM"
34368
><CODE
34369
CLASS="envar"
34370
>$PLATFORM</CODE
34371
></A
34372
>.
34373
</P
34374
></DD
34375
><DT
34376
><A
34377
NAME="t-cvf"
34378
></A
34379
><TT
34380
CLASS="literal"
34381
>cvf</TT
34382
></DT
34383
><DD
34384
><P
34385
>&#13;Sets construction variables for the Compaq Visual Fortran compiler.
34386
</P
34387
><P
34388
>&#13;Sets:  <A
34389
HREF="#cv-FORTRAN"
34390
><CODE
34391
CLASS="envar"
34392
>$FORTRAN</CODE
34393
></A
34394
>, <A
34395
HREF="#cv-FORTRANCOM"
34396
><CODE
34397
CLASS="envar"
34398
>$FORTRANCOM</CODE
34399
></A
34400
>, <A
34401
HREF="#cv-FORTRANMODDIR"
34402
><CODE
34403
CLASS="envar"
34404
>$FORTRANMODDIR</CODE
34405
></A
34406
>, <A
34407
HREF="#cv-FORTRANMODDIRPREFIX"
34408
><CODE
34409
CLASS="envar"
34410
>$FORTRANMODDIRPREFIX</CODE
34411
></A
34412
>, <A
34413
HREF="#cv-FORTRANMODDIRSUFFIX"
34414
><CODE
34415
CLASS="envar"
34416
>$FORTRANMODDIRSUFFIX</CODE
34417
></A
34418
>, <A
34419
HREF="#cv-FORTRANPPCOM"
34420
><CODE
34421
CLASS="envar"
34422
>$FORTRANPPCOM</CODE
34423
></A
34424
>, <A
34425
HREF="#cv-OBJSUFFIX"
34426
><CODE
34427
CLASS="envar"
34428
>$OBJSUFFIX</CODE
34429
></A
34430
>, <A
34431
HREF="#cv-SHFORTRANCOM"
34432
><CODE
34433
CLASS="envar"
34434
>$SHFORTRANCOM</CODE
34435
></A
34436
>, <A
34437
HREF="#cv-SHFORTRANPPCOM"
34438
><CODE
34439
CLASS="envar"
34440
>$SHFORTRANPPCOM</CODE
34441
></A
34442
>.
34443
</P
34444
><P
34445
>&#13;Uses:  <A
34446
HREF="#cv-CPPFLAGS"
34447
><CODE
34448
CLASS="envar"
34449
>$CPPFLAGS</CODE
34450
></A
34451
>, <A
34452
HREF="#cv-FORTRANFLAGS"
34453
><CODE
34454
CLASS="envar"
34455
>$FORTRANFLAGS</CODE
34456
></A
34457
>, <A
34458
HREF="#cv-SHFORTRANFLAGS"
34459
><CODE
34460
CLASS="envar"
34461
>$SHFORTRANFLAGS</CODE
34462
></A
34463
>, <A
34464
HREF="#cv-_CPPDEFFLAGS"
34465
><CODE
34466
CLASS="envar"
34467
>$_CPPDEFFLAGS</CODE
34468
></A
34469
>, <A
34470
HREF="#cv-_FORTRANINCFLAGS"
34471
><CODE
34472
CLASS="envar"
34473
>$_FORTRANINCFLAGS</CODE
34474
></A
34475
>, <A
34476
HREF="#cv-_FORTRANMODFLAG"
34477
><CODE
34478
CLASS="envar"
34479
>$_FORTRANMODFLAG</CODE
34480
></A
34481
>.
34482
</P
34483
></DD
34484
><DT
34485
><A
34486
NAME="t-CVS"
34487
></A
34488
><TT
34489
CLASS="literal"
34490
>CVS</TT
34491
></DT
34492
><DD
34493
><P
34494
>&#13;Sets construction variables for the CVS source code
34495
management system.
34496
</P
34497
><P
34498
>&#13;Sets:  <A
34499
HREF="#cv-CVS"
34500
><CODE
34501
CLASS="envar"
34502
>$CVS</CODE
34503
></A
34504
>, <A
34505
HREF="#cv-CVSCOFLAGS"
34506
><CODE
34507
CLASS="envar"
34508
>$CVSCOFLAGS</CODE
34509
></A
34510
>, <A
34511
HREF="#cv-CVSCOM"
34512
><CODE
34513
CLASS="envar"
34514
>$CVSCOM</CODE
34515
></A
34516
>, <A
34517
HREF="#cv-CVSFLAGS"
34518
><CODE
34519
CLASS="envar"
34520
>$CVSFLAGS</CODE
34521
></A
34522
>.
34523
</P
34524
><P
34525
>&#13;Uses:  <A
34526
HREF="#cv-CVSCOMSTR"
34527
><CODE
34528
CLASS="envar"
34529
>$CVSCOMSTR</CODE
34530
></A
34531
>.
34532
</P
34533
></DD
34534
><DT
34535
><A
34536
NAME="t-cXX"
34537
></A
34538
><TT
34539
CLASS="literal"
34540
>cXX</TT
34541
></DT
34542
><DD
34543
><P
34544
>&#13;Sets construction variables for generic POSIX C++ compilers.
34545
</P
34546
><P
34547
>&#13;Sets:  <A
34548
HREF="#cv-CPPDEFPREFIX"
34549
><CODE
34550
CLASS="envar"
34551
>$CPPDEFPREFIX</CODE
34552
></A
34553
>, <A
34554
HREF="#cv-CPPDEFSUFFIX"
34555
><CODE
34556
CLASS="envar"
34557
>$CPPDEFSUFFIX</CODE
34558
></A
34559
>, <A
34560
HREF="#cv-CXX"
34561
><CODE
34562
CLASS="envar"
34563
>$CXX</CODE
34564
></A
34565
>, <A
34566
HREF="#cv-CXXCOM"
34567
><CODE
34568
CLASS="envar"
34569
>$CXXCOM</CODE
34570
></A
34571
>, <A
34572
HREF="#cv-CXXFILESUFFIX"
34573
><CODE
34574
CLASS="envar"
34575
>$CXXFILESUFFIX</CODE
34576
></A
34577
>, <A
34578
HREF="#cv-CXXFLAGS"
34579
><CODE
34580
CLASS="envar"
34581
>$CXXFLAGS</CODE
34582
></A
34583
>, <A
34584
HREF="#cv-INCPREFIX"
34585
><CODE
34586
CLASS="envar"
34587
>$INCPREFIX</CODE
34588
></A
34589
>, <A
34590
HREF="#cv-INCSUFFIX"
34591
><CODE
34592
CLASS="envar"
34593
>$INCSUFFIX</CODE
34594
></A
34595
>, <A
34596
HREF="#cv-OBJSUFFIX"
34597
><CODE
34598
CLASS="envar"
34599
>$OBJSUFFIX</CODE
34600
></A
34601
>, <A
34602
HREF="#cv-SHCXX"
34603
><CODE
34604
CLASS="envar"
34605
>$SHCXX</CODE
34606
></A
34607
>, <A
34608
HREF="#cv-SHCXXCOM"
34609
><CODE
34610
CLASS="envar"
34611
>$SHCXXCOM</CODE
34612
></A
34613
>, <A
34614
HREF="#cv-SHCXXFLAGS"
34615
><CODE
34616
CLASS="envar"
34617
>$SHCXXFLAGS</CODE
34618
></A
34619
>, <A
34620
HREF="#cv-SHOBJSUFFIX"
34621
><CODE
34622
CLASS="envar"
34623
>$SHOBJSUFFIX</CODE
34624
></A
34625
>.
34626
</P
34627
><P
34628
>&#13;Uses:  <A
34629
HREF="#cv-CXXCOMSTR"
34630
><CODE
34631
CLASS="envar"
34632
>$CXXCOMSTR</CODE
34633
></A
34634
>.
34635
</P
34636
></DD
34637
><DT
34638
><A
34639
NAME="t-default"
34640
></A
34641
><TT
34642
CLASS="literal"
34643
>default</TT
34644
></DT
34645
><DD
34646
><P
34647
>&#13;Sets variables by calling a default list of Tool modules
34648
for the platform on which SCons is running.
34649
</P
34650
></DD
34651
><DT
34652
><A
34653
NAME="t-dmd"
34654
></A
34655
><TT
34656
CLASS="literal"
34657
>dmd</TT
34658
></DT
34659
><DD
34660
><P
34661
>&#13;Sets construction variables for D language compilers
34662
(the Digital Mars D compiler, or GDC).
34663
</P
34664
></DD
34665
><DT
34666
><A
34667
NAME="t-dvi"
34668
></A
34669
><TT
34670
CLASS="literal"
34671
>dvi</TT
34672
></DT
34673
><DD
34674
><P
34675
>&#13;Attaches the <CODE
34676
CLASS="function"
34677
>DVI</CODE
34678
> builder to the
34679
construction environment.
34680
</P
34681
></DD
34682
><DT
34683
><A
34684
NAME="t-dvipdf"
34685
></A
34686
><TT
34687
CLASS="literal"
34688
>dvipdf</TT
34689
></DT
34690
><DD
34691
><P
34692
>&#13;Sets construction variables for the dvipdf utility.
34693
</P
34694
><P
34695
>&#13;Sets:  <A
34696
HREF="#cv-DVIPDF"
34697
><CODE
34698
CLASS="envar"
34699
>$DVIPDF</CODE
34700
></A
34701
>, <A
34702
HREF="#cv-DVIPDFCOM"
34703
><CODE
34704
CLASS="envar"
34705
>$DVIPDFCOM</CODE
34706
></A
34707
>, <A
34708
HREF="#cv-DVIPDFFLAGS"
34709
><CODE
34710
CLASS="envar"
34711
>$DVIPDFFLAGS</CODE
34712
></A
34713
>.
34714
</P
34715
><P
34716
>&#13;Uses:  <A
34717
HREF="#cv-DVIPDFCOMSTR"
34718
><CODE
34719
CLASS="envar"
34720
>$DVIPDFCOMSTR</CODE
34721
></A
34722
>.
34723
</P
34724
></DD
34725
><DT
34726
><A
34727
NAME="t-dvips"
34728
></A
34729
><TT
34730
CLASS="literal"
34731
>dvips</TT
34732
></DT
34733
><DD
34734
><P
34735
>&#13;Sets construction variables for the dvips utility.
34736
</P
34737
><P
34738
>&#13;Sets:  <A
34739
HREF="#cv-DVIPS"
34740
><CODE
34741
CLASS="envar"
34742
>$DVIPS</CODE
34743
></A
34744
>, <A
34745
HREF="#cv-DVIPSFLAGS"
34746
><CODE
34747
CLASS="envar"
34748
>$DVIPSFLAGS</CODE
34749
></A
34750
>, <A
34751
HREF="#cv-PSCOM"
34752
><CODE
34753
CLASS="envar"
34754
>$PSCOM</CODE
34755
></A
34756
>, <A
34757
HREF="#cv-PSPREFIX"
34758
><CODE
34759
CLASS="envar"
34760
>$PSPREFIX</CODE
34761
></A
34762
>, <A
34763
HREF="#cv-PSSUFFIX"
34764
><CODE
34765
CLASS="envar"
34766
>$PSSUFFIX</CODE
34767
></A
34768
>.
34769
</P
34770
><P
34771
>&#13;Uses:  <A
34772
HREF="#cv-PSCOMSTR"
34773
><CODE
34774
CLASS="envar"
34775
>$PSCOMSTR</CODE
34776
></A
34777
>.
34778
</P
34779
></DD
34780
><DT
34781
><A
34782
NAME="t-f77"
34783
></A
34784
><TT
34785
CLASS="literal"
34786
>f77</TT
34787
></DT
34788
><DD
34789
><P
34790
>&#13;Set construction variables for generic POSIX Fortran 77 compilers.
34791
</P
34792
><P
34793
>&#13;Sets:  <A
34794
HREF="#cv-F77"
34795
><CODE
34796
CLASS="envar"
34797
>$F77</CODE
34798
></A
34799
>, <A
34800
HREF="#cv-F77COM"
34801
><CODE
34802
CLASS="envar"
34803
>$F77COM</CODE
34804
></A
34805
>, <A
34806
HREF="#cv-F77FILESUFFIXES"
34807
><CODE
34808
CLASS="envar"
34809
>$F77FILESUFFIXES</CODE
34810
></A
34811
>, <A
34812
HREF="#cv-F77FLAGS"
34813
><CODE
34814
CLASS="envar"
34815
>$F77FLAGS</CODE
34816
></A
34817
>, <A
34818
HREF="#cv-F77PPCOM"
34819
><CODE
34820
CLASS="envar"
34821
>$F77PPCOM</CODE
34822
></A
34823
>, <A
34824
HREF="#cv-F77PPFILESUFFIXES"
34825
><CODE
34826
CLASS="envar"
34827
>$F77PPFILESUFFIXES</CODE
34828
></A
34829
>, <A
34830
HREF="#cv-FORTRAN"
34831
><CODE
34832
CLASS="envar"
34833
>$FORTRAN</CODE
34834
></A
34835
>, <A
34836
HREF="#cv-FORTRANCOM"
34837
><CODE
34838
CLASS="envar"
34839
>$FORTRANCOM</CODE
34840
></A
34841
>, <A
34842
HREF="#cv-FORTRANFLAGS"
34843
><CODE
34844
CLASS="envar"
34845
>$FORTRANFLAGS</CODE
34846
></A
34847
>, <A
34848
HREF="#cv-SHF77"
34849
><CODE
34850
CLASS="envar"
34851
>$SHF77</CODE
34852
></A
34853
>, <A
34854
HREF="#cv-SHF77COM"
34855
><CODE
34856
CLASS="envar"
34857
>$SHF77COM</CODE
34858
></A
34859
>, <A
34860
HREF="#cv-SHF77FLAGS"
34861
><CODE
34862
CLASS="envar"
34863
>$SHF77FLAGS</CODE
34864
></A
34865
>, <A
34866
HREF="#cv-SHF77PPCOM"
34867
><CODE
34868
CLASS="envar"
34869
>$SHF77PPCOM</CODE
34870
></A
34871
>, <A
34872
HREF="#cv-SHFORTRAN"
34873
><CODE
34874
CLASS="envar"
34875
>$SHFORTRAN</CODE
34876
></A
34877
>, <A
34878
HREF="#cv-SHFORTRANCOM"
34879
><CODE
34880
CLASS="envar"
34881
>$SHFORTRANCOM</CODE
34882
></A
34883
>, <A
34884
HREF="#cv-SHFORTRANFLAGS"
34885
><CODE
34886
CLASS="envar"
34887
>$SHFORTRANFLAGS</CODE
34888
></A
34889
>, <A
34890
HREF="#cv-SHFORTRANPPCOM"
34891
><CODE
34892
CLASS="envar"
34893
>$SHFORTRANPPCOM</CODE
34894
></A
34895
>, <A
34896
HREF="#cv-_F77INCFLAGS"
34897
><CODE
34898
CLASS="envar"
34899
>$_F77INCFLAGS</CODE
34900
></A
34901
>.
34902
</P
34903
><P
34904
>&#13;Uses:  <A
34905
HREF="#cv-F77COMSTR"
34906
><CODE
34907
CLASS="envar"
34908
>$F77COMSTR</CODE
34909
></A
34910
>, <A
34911
HREF="#cv-F77PPCOMSTR"
34912
><CODE
34913
CLASS="envar"
34914
>$F77PPCOMSTR</CODE
34915
></A
34916
>, <A
34917
HREF="#cv-FORTRANCOMSTR"
34918
><CODE
34919
CLASS="envar"
34920
>$FORTRANCOMSTR</CODE
34921
></A
34922
>, <A
34923
HREF="#cv-FORTRANPPCOMSTR"
34924
><CODE
34925
CLASS="envar"
34926
>$FORTRANPPCOMSTR</CODE
34927
></A
34928
>, <A
34929
HREF="#cv-SHF77COMSTR"
34930
><CODE
34931
CLASS="envar"
34932
>$SHF77COMSTR</CODE
34933
></A
34934
>, <A
34935
HREF="#cv-SHF77PPCOMSTR"
34936
><CODE
34937
CLASS="envar"
34938
>$SHF77PPCOMSTR</CODE
34939
></A
34940
>, <A
34941
HREF="#cv-SHFORTRANCOMSTR"
34942
><CODE
34943
CLASS="envar"
34944
>$SHFORTRANCOMSTR</CODE
34945
></A
34946
>, <A
34947
HREF="#cv-SHFORTRANPPCOMSTR"
34948
><CODE
34949
CLASS="envar"
34950
>$SHFORTRANPPCOMSTR</CODE
34951
></A
34952
>.
34953
</P
34954
></DD
34955
><DT
34956
><A
34957
NAME="t-f90"
34958
></A
34959
><TT
34960
CLASS="literal"
34961
>f90</TT
34962
></DT
34963
><DD
34964
><P
34965
>&#13;Set construction variables for generic POSIX Fortran 90 compilers.
34966
</P
34967
><P
34968
>&#13;Sets:  <A
34969
HREF="#cv-F90"
34970
><CODE
34971
CLASS="envar"
34972
>$F90</CODE
34973
></A
34974
>, <A
34975
HREF="#cv-F90COM"
34976
><CODE
34977
CLASS="envar"
34978
>$F90COM</CODE
34979
></A
34980
>, <A
34981
HREF="#cv-F90FLAGS"
34982
><CODE
34983
CLASS="envar"
34984
>$F90FLAGS</CODE
34985
></A
34986
>, <A
34987
HREF="#cv-F90PPCOM"
34988
><CODE
34989
CLASS="envar"
34990
>$F90PPCOM</CODE
34991
></A
34992
>, <A
34993
HREF="#cv-SHF90"
34994
><CODE
34995
CLASS="envar"
34996
>$SHF90</CODE
34997
></A
34998
>, <A
34999
HREF="#cv-SHF90COM"
35000
><CODE
35001
CLASS="envar"
35002
>$SHF90COM</CODE
35003
></A
35004
>, <A
35005
HREF="#cv-SHF90FLAGS"
35006
><CODE
35007
CLASS="envar"
35008
>$SHF90FLAGS</CODE
35009
></A
35010
>, <A
35011
HREF="#cv-SHF90PPCOM"
35012
><CODE
35013
CLASS="envar"
35014
>$SHF90PPCOM</CODE
35015
></A
35016
>, <A
35017
HREF="#cv-_F90INCFLAGS"
35018
><CODE
35019
CLASS="envar"
35020
>$_F90INCFLAGS</CODE
35021
></A
35022
>.
35023
</P
35024
><P
35025
>&#13;Uses:  <A
35026
HREF="#cv-F90COMSTR"
35027
><CODE
35028
CLASS="envar"
35029
>$F90COMSTR</CODE
35030
></A
35031
>, <A
35032
HREF="#cv-F90PPCOMSTR"
35033
><CODE
35034
CLASS="envar"
35035
>$F90PPCOMSTR</CODE
35036
></A
35037
>, <A
35038
HREF="#cv-SHF90COMSTR"
35039
><CODE
35040
CLASS="envar"
35041
>$SHF90COMSTR</CODE
35042
></A
35043
>, <A
35044
HREF="#cv-SHF90PPCOMSTR"
35045
><CODE
35046
CLASS="envar"
35047
>$SHF90PPCOMSTR</CODE
35048
></A
35049
>.
35050
</P
35051
></DD
35052
><DT
35053
><A
35054
NAME="t-f95"
35055
></A
35056
><TT
35057
CLASS="literal"
35058
>f95</TT
35059
></DT
35060
><DD
35061
><P
35062
>&#13;Set construction variables for generic POSIX Fortran 95 compilers.
35063
</P
35064
><P
35065
>&#13;Sets:  <A
35066
HREF="#cv-F95"
35067
><CODE
35068
CLASS="envar"
35069
>$F95</CODE
35070
></A
35071
>, <A
35072
HREF="#cv-F95COM"
35073
><CODE
35074
CLASS="envar"
35075
>$F95COM</CODE
35076
></A
35077
>, <A
35078
HREF="#cv-F95FLAGS"
35079
><CODE
35080
CLASS="envar"
35081
>$F95FLAGS</CODE
35082
></A
35083
>, <A
35084
HREF="#cv-F95PPCOM"
35085
><CODE
35086
CLASS="envar"
35087
>$F95PPCOM</CODE
35088
></A
35089
>, <A
35090
HREF="#cv-SHF95"
35091
><CODE
35092
CLASS="envar"
35093
>$SHF95</CODE
35094
></A
35095
>, <A
35096
HREF="#cv-SHF95COM"
35097
><CODE
35098
CLASS="envar"
35099
>$SHF95COM</CODE
35100
></A
35101
>, <A
35102
HREF="#cv-SHF95FLAGS"
35103
><CODE
35104
CLASS="envar"
35105
>$SHF95FLAGS</CODE
35106
></A
35107
>, <A
35108
HREF="#cv-SHF95PPCOM"
35109
><CODE
35110
CLASS="envar"
35111
>$SHF95PPCOM</CODE
35112
></A
35113
>, <A
35114
HREF="#cv-_F95INCFLAGS"
35115
><CODE
35116
CLASS="envar"
35117
>$_F95INCFLAGS</CODE
35118
></A
35119
>.
35120
</P
35121
><P
35122
>&#13;Uses:  <A
35123
HREF="#cv-F95COMSTR"
35124
><CODE
35125
CLASS="envar"
35126
>$F95COMSTR</CODE
35127
></A
35128
>, <A
35129
HREF="#cv-F95PPCOMSTR"
35130
><CODE
35131
CLASS="envar"
35132
>$F95PPCOMSTR</CODE
35133
></A
35134
>, <A
35135
HREF="#cv-SHF95COMSTR"
35136
><CODE
35137
CLASS="envar"
35138
>$SHF95COMSTR</CODE
35139
></A
35140
>, <A
35141
HREF="#cv-SHF95PPCOMSTR"
35142
><CODE
35143
CLASS="envar"
35144
>$SHF95PPCOMSTR</CODE
35145
></A
35146
>.
35147
</P
35148
></DD
35149
><DT
35150
><A
35151
NAME="t-fortran"
35152
></A
35153
><TT
35154
CLASS="literal"
35155
>fortran</TT
35156
></DT
35157
><DD
35158
><P
35159
>&#13;Set construction variables for generic POSIX Fortran compilers.
35160
</P
35161
><P
35162
>&#13;Sets:  <A
35163
HREF="#cv-FORTRAN"
35164
><CODE
35165
CLASS="envar"
35166
>$FORTRAN</CODE
35167
></A
35168
>, <A
35169
HREF="#cv-FORTRANCOM"
35170
><CODE
35171
CLASS="envar"
35172
>$FORTRANCOM</CODE
35173
></A
35174
>, <A
35175
HREF="#cv-FORTRANFLAGS"
35176
><CODE
35177
CLASS="envar"
35178
>$FORTRANFLAGS</CODE
35179
></A
35180
>, <A
35181
HREF="#cv-SHFORTRAN"
35182
><CODE
35183
CLASS="envar"
35184
>$SHFORTRAN</CODE
35185
></A
35186
>, <A
35187
HREF="#cv-SHFORTRANCOM"
35188
><CODE
35189
CLASS="envar"
35190
>$SHFORTRANCOM</CODE
35191
></A
35192
>, <A
35193
HREF="#cv-SHFORTRANFLAGS"
35194
><CODE
35195
CLASS="envar"
35196
>$SHFORTRANFLAGS</CODE
35197
></A
35198
>, <A
35199
HREF="#cv-SHFORTRANPPCOM"
35200
><CODE
35201
CLASS="envar"
35202
>$SHFORTRANPPCOM</CODE
35203
></A
35204
>.
35205
</P
35206
><P
35207
>&#13;Uses:  <A
35208
HREF="#cv-FORTRANCOMSTR"
35209
><CODE
35210
CLASS="envar"
35211
>$FORTRANCOMSTR</CODE
35212
></A
35213
>, <A
35214
HREF="#cv-FORTRANPPCOMSTR"
35215
><CODE
35216
CLASS="envar"
35217
>$FORTRANPPCOMSTR</CODE
35218
></A
35219
>, <A
35220
HREF="#cv-SHFORTRANCOMSTR"
35221
><CODE
35222
CLASS="envar"
35223
>$SHFORTRANCOMSTR</CODE
35224
></A
35225
>, <A
35226
HREF="#cv-SHFORTRANPPCOMSTR"
35227
><CODE
35228
CLASS="envar"
35229
>$SHFORTRANPPCOMSTR</CODE
35230
></A
35231
>.
35232
</P
35233
></DD
35234
><DT
35235
><A
35236
NAME="t-gXX"
35237
></A
35238
><TT
35239
CLASS="literal"
35240
>g++</TT
35241
></DT
35242
><DD
35243
><P
35244
>&#13;Set construction variables for the <SPAN
35245
CLASS="application"
35246
>gXX</SPAN
35247
> C++ compiler.
35248
</P
35249
><P
35250
>&#13;Sets:  <A
35251
HREF="#cv-CXX"
35252
><CODE
35253
CLASS="envar"
35254
>$CXX</CODE
35255
></A
35256
>, <A
35257
HREF="#cv-CXXVERSION"
35258
><CODE
35259
CLASS="envar"
35260
>$CXXVERSION</CODE
35261
></A
35262
>, <A
35263
HREF="#cv-SHCXXFLAGS"
35264
><CODE
35265
CLASS="envar"
35266
>$SHCXXFLAGS</CODE
35267
></A
35268
>, <A
35269
HREF="#cv-SHOBJSUFFIX"
35270
><CODE
35271
CLASS="envar"
35272
>$SHOBJSUFFIX</CODE
35273
></A
35274
>.
35275
</P
35276
></DD
35277
><DT
35278
><A
35279
NAME="t-g77"
35280
></A
35281
><TT
35282
CLASS="literal"
35283
>g77</TT
35284
></DT
35285
><DD
35286
><P
35287
>&#13;Set construction variables for the <SPAN
35288
CLASS="application"
35289
>g77</SPAN
35290
> Fortran compiler.
35291
Calls the <TT
35292
CLASS="literal"
35293
>f77</TT
35294
> Tool module
35295
to set variables.
35296
</P
35297
></DD
35298
><DT
35299
><A
35300
NAME="t-gas"
35301
></A
35302
><TT
35303
CLASS="literal"
35304
>gas</TT
35305
></DT
35306
><DD
35307
><P
35308
>&#13;Sets construction variables for the <SPAN
35309
CLASS="application"
35310
>gas</SPAN
35311
> assembler.
35312
Calls the <TT
35313
CLASS="literal"
35314
>as</TT
35315
> module.
35316
</P
35317
><P
35318
>&#13;Sets:  <A
35319
HREF="#cv-AS"
35320
><CODE
35321
CLASS="envar"
35322
>$AS</CODE
35323
></A
35324
>.
35325
</P
35326
></DD
35327
><DT
35328
><A
35329
NAME="t-gcc"
35330
></A
35331
><TT
35332
CLASS="literal"
35333
>gcc</TT
35334
></DT
35335
><DD
35336
><P
35337
>&#13;Set construction variables for the <SPAN
35338
CLASS="application"
35339
>gcc</SPAN
35340
> C compiler.
35341
</P
35342
><P
35343
>&#13;Sets:  <A
35344
HREF="#cv-CC"
35345
><CODE
35346
CLASS="envar"
35347
>$CC</CODE
35348
></A
35349
>, <A
35350
HREF="#cv-CCVERSION"
35351
><CODE
35352
CLASS="envar"
35353
>$CCVERSION</CODE
35354
></A
35355
>, <A
35356
HREF="#cv-SHCCFLAGS"
35357
><CODE
35358
CLASS="envar"
35359
>$SHCCFLAGS</CODE
35360
></A
35361
>.
35362
</P
35363
></DD
35364
><DT
35365
><A
35366
NAME="t-gnulink"
35367
></A
35368
><TT
35369
CLASS="literal"
35370
>gnulink</TT
35371
></DT
35372
><DD
35373
><P
35374
>&#13;Set construction variables for GNU linker/loader.
35375
</P
35376
><P
35377
>&#13;Sets:  <A
35378
HREF="#cv-RPATHPREFIX"
35379
><CODE
35380
CLASS="envar"
35381
>$RPATHPREFIX</CODE
35382
></A
35383
>, <A
35384
HREF="#cv-RPATHSUFFIX"
35385
><CODE
35386
CLASS="envar"
35387
>$RPATHSUFFIX</CODE
35388
></A
35389
>, <A
35390
HREF="#cv-SHLINKFLAGS"
35391
><CODE
35392
CLASS="envar"
35393
>$SHLINKFLAGS</CODE
35394
></A
35395
>.
35396
</P
35397
></DD
35398
><DT
35399
><A
35400
NAME="t-gs"
35401
></A
35402
><TT
35403
CLASS="literal"
35404
>gs</TT
35405
></DT
35406
><DD
35407
><P
35408
>&#13;Set construction variables for Ghostscript.
35409
</P
35410
><P
35411
>&#13;Sets:  <A
35412
HREF="#cv-GS"
35413
><CODE
35414
CLASS="envar"
35415
>$GS</CODE
35416
></A
35417
>, <A
35418
HREF="#cv-GSCOM"
35419
><CODE
35420
CLASS="envar"
35421
>$GSCOM</CODE
35422
></A
35423
>, <A
35424
HREF="#cv-GSFLAGS"
35425
><CODE
35426
CLASS="envar"
35427
>$GSFLAGS</CODE
35428
></A
35429
>.
35430
</P
35431
><P
35432
>&#13;Uses:  <A
35433
HREF="#cv-GSCOMSTR"
35434
><CODE
35435
CLASS="envar"
35436
>$GSCOMSTR</CODE
35437
></A
35438
>.
35439
</P
35440
></DD
35441
><DT
35442
><A
35443
NAME="t-hpcXX"
35444
></A
35445
><TT
35446
CLASS="literal"
35447
>hpc++</TT
35448
></DT
35449
><DD
35450
><P
35451
>&#13;Set construction variables for the compilers aCC on HP/UX systems.
35452
</P
35453
></DD
35454
><DT
35455
><A
35456
NAME="t-hpcc"
35457
></A
35458
><TT
35459
CLASS="literal"
35460
>hpcc</TT
35461
></DT
35462
><DD
35463
><P
35464
>&#13;Set construction variables for the
35465
<SPAN
35466
CLASS="application"
35467
>aCC</SPAN
35468
> on HP/UX systems.
35469
Calls the <TT
35470
CLASS="literal"
35471
>cXX</TT
35472
> tool for additional variables.
35473
</P
35474
><P
35475
>&#13;Sets:  <A
35476
HREF="#cv-CXX"
35477
><CODE
35478
CLASS="envar"
35479
>$CXX</CODE
35480
></A
35481
>, <A
35482
HREF="#cv-CXXVERSION"
35483
><CODE
35484
CLASS="envar"
35485
>$CXXVERSION</CODE
35486
></A
35487
>, <A
35488
HREF="#cv-SHCXXFLAGS"
35489
><CODE
35490
CLASS="envar"
35491
>$SHCXXFLAGS</CODE
35492
></A
35493
>.
35494
</P
35495
></DD
35496
><DT
35497
><A
35498
NAME="t-hplink"
35499
></A
35500
><TT
35501
CLASS="literal"
35502
>hplink</TT
35503
></DT
35504
><DD
35505
><P
35506
>&#13;Sets construction variables for the linker on HP/UX systems.
35507
</P
35508
><P
35509
>&#13;Sets:  <A
35510
HREF="#cv-LINKFLAGS"
35511
><CODE
35512
CLASS="envar"
35513
>$LINKFLAGS</CODE
35514
></A
35515
>, <A
35516
HREF="#cv-SHLIBSUFFIX"
35517
><CODE
35518
CLASS="envar"
35519
>$SHLIBSUFFIX</CODE
35520
></A
35521
>, <A
35522
HREF="#cv-SHLINKFLAGS"
35523
><CODE
35524
CLASS="envar"
35525
>$SHLINKFLAGS</CODE
35526
></A
35527
>.
35528
</P
35529
></DD
35530
><DT
35531
><A
35532
NAME="t-icc"
35533
></A
35534
><TT
35535
CLASS="literal"
35536
>icc</TT
35537
></DT
35538
><DD
35539
><P
35540
>&#13;Sets construction variables for the
35541
<SPAN
35542
CLASS="application"
35543
>icc</SPAN
35544
> compiler on OS/2 systems.
35545
</P
35546
><P
35547
>&#13;Sets:  <A
35548
HREF="#cv-CC"
35549
><CODE
35550
CLASS="envar"
35551
>$CC</CODE
35552
></A
35553
>, <A
35554
HREF="#cv-CCCOM"
35555
><CODE
35556
CLASS="envar"
35557
>$CCCOM</CODE
35558
></A
35559
>, <A
35560
HREF="#cv-CFILESUFFIX"
35561
><CODE
35562
CLASS="envar"
35563
>$CFILESUFFIX</CODE
35564
></A
35565
>, <A
35566
HREF="#cv-CPPDEFPREFIX"
35567
><CODE
35568
CLASS="envar"
35569
>$CPPDEFPREFIX</CODE
35570
></A
35571
>, <A
35572
HREF="#cv-CPPDEFSUFFIX"
35573
><CODE
35574
CLASS="envar"
35575
>$CPPDEFSUFFIX</CODE
35576
></A
35577
>, <A
35578
HREF="#cv-CXXCOM"
35579
><CODE
35580
CLASS="envar"
35581
>$CXXCOM</CODE
35582
></A
35583
>, <A
35584
HREF="#cv-CXXFILESUFFIX"
35585
><CODE
35586
CLASS="envar"
35587
>$CXXFILESUFFIX</CODE
35588
></A
35589
>, <A
35590
HREF="#cv-INCPREFIX"
35591
><CODE
35592
CLASS="envar"
35593
>$INCPREFIX</CODE
35594
></A
35595
>, <A
35596
HREF="#cv-INCSUFFIX"
35597
><CODE
35598
CLASS="envar"
35599
>$INCSUFFIX</CODE
35600
></A
35601
>.
35602
</P
35603
><P
35604
>&#13;Uses:  <A
35605
HREF="#cv-CCFLAGS"
35606
><CODE
35607
CLASS="envar"
35608
>$CCFLAGS</CODE
35609
></A
35610
>, <A
35611
HREF="#cv-CFLAGS"
35612
><CODE
35613
CLASS="envar"
35614
>$CFLAGS</CODE
35615
></A
35616
>, <A
35617
HREF="#cv-CPPFLAGS"
35618
><CODE
35619
CLASS="envar"
35620
>$CPPFLAGS</CODE
35621
></A
35622
>, <A
35623
HREF="#cv-_CPPDEFFLAGS"
35624
><CODE
35625
CLASS="envar"
35626
>$_CPPDEFFLAGS</CODE
35627
></A
35628
>, <A
35629
HREF="#cv-_CPPINCFLAGS"
35630
><CODE
35631
CLASS="envar"
35632
>$_CPPINCFLAGS</CODE
35633
></A
35634
>.
35635
</P
35636
></DD
35637
><DT
35638
><A
35639
NAME="t-icl"
35640
></A
35641
><TT
35642
CLASS="literal"
35643
>icl</TT
35644
></DT
35645
><DD
35646
><P
35647
>&#13;Sets construction variables for the Intel C/C++ compiler.
35648
Calls the <TT
35649
CLASS="literal"
35650
>intelc</TT
35651
> Tool module to set its variables.
35652
</P
35653
></DD
35654
><DT
35655
><A
35656
NAME="t-ifl"
35657
></A
35658
><TT
35659
CLASS="literal"
35660
>ifl</TT
35661
></DT
35662
><DD
35663
><P
35664
>&#13;Sets construction variables for the Intel Fortran compiler.
35665
</P
35666
><P
35667
>&#13;Sets:  <A
35668
HREF="#cv-FORTRAN"
35669
><CODE
35670
CLASS="envar"
35671
>$FORTRAN</CODE
35672
></A
35673
>, <A
35674
HREF="#cv-FORTRANCOM"
35675
><CODE
35676
CLASS="envar"
35677
>$FORTRANCOM</CODE
35678
></A
35679
>, <A
35680
HREF="#cv-FORTRANPPCOM"
35681
><CODE
35682
CLASS="envar"
35683
>$FORTRANPPCOM</CODE
35684
></A
35685
>, <A
35686
HREF="#cv-SHFORTRANCOM"
35687
><CODE
35688
CLASS="envar"
35689
>$SHFORTRANCOM</CODE
35690
></A
35691
>, <A
35692
HREF="#cv-SHFORTRANPPCOM"
35693
><CODE
35694
CLASS="envar"
35695
>$SHFORTRANPPCOM</CODE
35696
></A
35697
>.
35698
</P
35699
><P
35700
>&#13;Uses:  <A
35701
HREF="#cv-CPPFLAGS"
35702
><CODE
35703
CLASS="envar"
35704
>$CPPFLAGS</CODE
35705
></A
35706
>, <A
35707
HREF="#cv-FORTRANFLAGS"
35708
><CODE
35709
CLASS="envar"
35710
>$FORTRANFLAGS</CODE
35711
></A
35712
>, <A
35713
HREF="#cv-_CPPDEFFLAGS"
35714
><CODE
35715
CLASS="envar"
35716
>$_CPPDEFFLAGS</CODE
35717
></A
35718
>, <A
35719
HREF="#cv-_FORTRANINCFLAGS"
35720
><CODE
35721
CLASS="envar"
35722
>$_FORTRANINCFLAGS</CODE
35723
></A
35724
>.
35725
</P
35726
></DD
35727
><DT
35728
><A
35729
NAME="t-ifort"
35730
></A
35731
><TT
35732
CLASS="literal"
35733
>ifort</TT
35734
></DT
35735
><DD
35736
><P
35737
>&#13;Sets construction variables for newer versions
35738
of the Intel Fortran compiler for Linux.
35739
</P
35740
><P
35741
>&#13;Sets:  <A
35742
HREF="#cv-F77"
35743
><CODE
35744
CLASS="envar"
35745
>$F77</CODE
35746
></A
35747
>, <A
35748
HREF="#cv-F90"
35749
><CODE
35750
CLASS="envar"
35751
>$F90</CODE
35752
></A
35753
>, <A
35754
HREF="#cv-F95"
35755
><CODE
35756
CLASS="envar"
35757
>$F95</CODE
35758
></A
35759
>, <A
35760
HREF="#cv-FORTRAN"
35761
><CODE
35762
CLASS="envar"
35763
>$FORTRAN</CODE
35764
></A
35765
>, <A
35766
HREF="#cv-SHF77"
35767
><CODE
35768
CLASS="envar"
35769
>$SHF77</CODE
35770
></A
35771
>, <A
35772
HREF="#cv-SHF77FLAGS"
35773
><CODE
35774
CLASS="envar"
35775
>$SHF77FLAGS</CODE
35776
></A
35777
>, <A
35778
HREF="#cv-SHF90"
35779
><CODE
35780
CLASS="envar"
35781
>$SHF90</CODE
35782
></A
35783
>, <A
35784
HREF="#cv-SHF90FLAGS"
35785
><CODE
35786
CLASS="envar"
35787
>$SHF90FLAGS</CODE
35788
></A
35789
>, <A
35790
HREF="#cv-SHF95"
35791
><CODE
35792
CLASS="envar"
35793
>$SHF95</CODE
35794
></A
35795
>, <A
35796
HREF="#cv-SHF95FLAGS"
35797
><CODE
35798
CLASS="envar"
35799
>$SHF95FLAGS</CODE
35800
></A
35801
>, <A
35802
HREF="#cv-SHFORTRAN"
35803
><CODE
35804
CLASS="envar"
35805
>$SHFORTRAN</CODE
35806
></A
35807
>, <A
35808
HREF="#cv-SHFORTRANFLAGS"
35809
><CODE
35810
CLASS="envar"
35811
>$SHFORTRANFLAGS</CODE
35812
></A
35813
>.
35814
</P
35815
></DD
35816
><DT
35817
><A
35818
NAME="t-ilink"
35819
></A
35820
><TT
35821
CLASS="literal"
35822
>ilink</TT
35823
></DT
35824
><DD
35825
><P
35826
>&#13;Sets construction variables for the
35827
<SPAN
35828
CLASS="application"
35829
>ilink</SPAN
35830
> linker on OS/2 systems.
35831
</P
35832
><P
35833
>&#13;Sets:  <A
35834
HREF="#cv-LIBDIRPREFIX"
35835
><CODE
35836
CLASS="envar"
35837
>$LIBDIRPREFIX</CODE
35838
></A
35839
>, <A
35840
HREF="#cv-LIBDIRSUFFIX"
35841
><CODE
35842
CLASS="envar"
35843
>$LIBDIRSUFFIX</CODE
35844
></A
35845
>, <A
35846
HREF="#cv-LIBLINKPREFIX"
35847
><CODE
35848
CLASS="envar"
35849
>$LIBLINKPREFIX</CODE
35850
></A
35851
>, <A
35852
HREF="#cv-LIBLINKSUFFIX"
35853
><CODE
35854
CLASS="envar"
35855
>$LIBLINKSUFFIX</CODE
35856
></A
35857
>, <A
35858
HREF="#cv-LINK"
35859
><CODE
35860
CLASS="envar"
35861
>$LINK</CODE
35862
></A
35863
>, <A
35864
HREF="#cv-LINKCOM"
35865
><CODE
35866
CLASS="envar"
35867
>$LINKCOM</CODE
35868
></A
35869
>, <A
35870
HREF="#cv-LINKFLAGS"
35871
><CODE
35872
CLASS="envar"
35873
>$LINKFLAGS</CODE
35874
></A
35875
>.
35876
</P
35877
></DD
35878
><DT
35879
><A
35880
NAME="t-ilink32"
35881
></A
35882
><TT
35883
CLASS="literal"
35884
>ilink32</TT
35885
></DT
35886
><DD
35887
><P
35888
>&#13;Sets construction variables for the Borland
35889
<SPAN
35890
CLASS="application"
35891
>ilink32</SPAN
35892
> linker.
35893
</P
35894
><P
35895
>&#13;Sets:  <A
35896
HREF="#cv-LIBDIRPREFIX"
35897
><CODE
35898
CLASS="envar"
35899
>$LIBDIRPREFIX</CODE
35900
></A
35901
>, <A
35902
HREF="#cv-LIBDIRSUFFIX"
35903
><CODE
35904
CLASS="envar"
35905
>$LIBDIRSUFFIX</CODE
35906
></A
35907
>, <A
35908
HREF="#cv-LIBLINKPREFIX"
35909
><CODE
35910
CLASS="envar"
35911
>$LIBLINKPREFIX</CODE
35912
></A
35913
>, <A
35914
HREF="#cv-LIBLINKSUFFIX"
35915
><CODE
35916
CLASS="envar"
35917
>$LIBLINKSUFFIX</CODE
35918
></A
35919
>, <A
35920
HREF="#cv-LINK"
35921
><CODE
35922
CLASS="envar"
35923
>$LINK</CODE
35924
></A
35925
>, <A
35926
HREF="#cv-LINKCOM"
35927
><CODE
35928
CLASS="envar"
35929
>$LINKCOM</CODE
35930
></A
35931
>, <A
35932
HREF="#cv-LINKFLAGS"
35933
><CODE
35934
CLASS="envar"
35935
>$LINKFLAGS</CODE
35936
></A
35937
>.
35938
</P
35939
></DD
35940
><DT
35941
><A
35942
NAME="t-install"
35943
></A
35944
><TT
35945
CLASS="literal"
35946
>install</TT
35947
></DT
35948
><DD
35949
><P
35950
>&#13;Sets construction variables for file
35951
and directory installation.
35952
</P
35953
><P
35954
>&#13;Sets:  <A
35955
HREF="#cv-INSTALL"
35956
><CODE
35957
CLASS="envar"
35958
>$INSTALL</CODE
35959
></A
35960
>, <A
35961
HREF="#cv-INSTALLSTR"
35962
><CODE
35963
CLASS="envar"
35964
>$INSTALLSTR</CODE
35965
></A
35966
>.
35967
</P
35968
></DD
35969
><DT
35970
><A
35971
NAME="t-intelc"
35972
></A
35973
><TT
35974
CLASS="literal"
35975
>intelc</TT
35976
></DT
35977
><DD
35978
><P
35979
>&#13;Sets construction variables for the Intel C/C++ compiler
35980
(Linux and Windows, version 7 and later).
35981
Calls the <TT
35982
CLASS="literal"
35983
>gcc</TT
35984
> or <TT
35985
CLASS="literal"
35986
>msvc</TT
35987
>
35988
(on Linux and Windows, respectively)
35989
to set underlying variables.
35990
</P
35991
><P
35992
>&#13;Sets:  <A
35993
HREF="#cv-AR"
35994
><CODE
35995
CLASS="envar"
35996
>$AR</CODE
35997
></A
35998
>, <A
35999
HREF="#cv-CC"
36000
><CODE
36001
CLASS="envar"
36002
>$CC</CODE
36003
></A
36004
>, <A
36005
HREF="#cv-CXX"
36006
><CODE
36007
CLASS="envar"
36008
>$CXX</CODE
36009
></A
36010
>, <A
36011
HREF="#cv-INTEL_C_COMPILER_VERSION"
36012
><CODE
36013
CLASS="envar"
36014
>$INTEL_C_COMPILER_VERSION</CODE
36015
></A
36016
>, <A
36017
HREF="#cv-LINK"
36018
><CODE
36019
CLASS="envar"
36020
>$LINK</CODE
36021
></A
36022
>.
36023
</P
36024
></DD
36025
><DT
36026
><A
36027
NAME="t-jar"
36028
></A
36029
><TT
36030
CLASS="literal"
36031
>jar</TT
36032
></DT
36033
><DD
36034
><P
36035
>&#13;Sets construction variables for the <SPAN
36036
CLASS="application"
36037
>jar</SPAN
36038
> utility.
36039
</P
36040
><P
36041
>&#13;Sets:  <A
36042
HREF="#cv-JAR"
36043
><CODE
36044
CLASS="envar"
36045
>$JAR</CODE
36046
></A
36047
>, <A
36048
HREF="#cv-JARCOM"
36049
><CODE
36050
CLASS="envar"
36051
>$JARCOM</CODE
36052
></A
36053
>, <A
36054
HREF="#cv-JARFLAGS"
36055
><CODE
36056
CLASS="envar"
36057
>$JARFLAGS</CODE
36058
></A
36059
>, <A
36060
HREF="#cv-JARSUFFIX"
36061
><CODE
36062
CLASS="envar"
36063
>$JARSUFFIX</CODE
36064
></A
36065
>.
36066
</P
36067
><P
36068
>&#13;Uses:  <A
36069
HREF="#cv-JARCOMSTR"
36070
><CODE
36071
CLASS="envar"
36072
>$JARCOMSTR</CODE
36073
></A
36074
>.
36075
</P
36076
></DD
36077
><DT
36078
><A
36079
NAME="t-javac"
36080
></A
36081
><TT
36082
CLASS="literal"
36083
>javac</TT
36084
></DT
36085
><DD
36086
><P
36087
>&#13;Sets construction variables for the <SPAN
36088
CLASS="application"
36089
>javac</SPAN
36090
> compiler.
36091
</P
36092
><P
36093
>&#13;Sets:  <A
36094
HREF="#cv-JAVABOOTCLASSPATH"
36095
><CODE
36096
CLASS="envar"
36097
>$JAVABOOTCLASSPATH</CODE
36098
></A
36099
>, <A
36100
HREF="#cv-JAVAC"
36101
><CODE
36102
CLASS="envar"
36103
>$JAVAC</CODE
36104
></A
36105
>, <A
36106
HREF="#cv-JAVACCOM"
36107
><CODE
36108
CLASS="envar"
36109
>$JAVACCOM</CODE
36110
></A
36111
>, <A
36112
HREF="#cv-JAVACFLAGS"
36113
><CODE
36114
CLASS="envar"
36115
>$JAVACFLAGS</CODE
36116
></A
36117
>, <A
36118
HREF="#cv-JAVACLASSPATH"
36119
><CODE
36120
CLASS="envar"
36121
>$JAVACLASSPATH</CODE
36122
></A
36123
>, <A
36124
HREF="#cv-JAVACLASSSUFFIX"
36125
><CODE
36126
CLASS="envar"
36127
>$JAVACLASSSUFFIX</CODE
36128
></A
36129
>, <A
36130
HREF="#cv-JAVASOURCEPATH"
36131
><CODE
36132
CLASS="envar"
36133
>$JAVASOURCEPATH</CODE
36134
></A
36135
>, <A
36136
HREF="#cv-JAVASUFFIX"
36137
><CODE
36138
CLASS="envar"
36139
>$JAVASUFFIX</CODE
36140
></A
36141
>.
36142
</P
36143
><P
36144
>&#13;Uses:  <A
36145
HREF="#cv-JAVACCOMSTR"
36146
><CODE
36147
CLASS="envar"
36148
>$JAVACCOMSTR</CODE
36149
></A
36150
>.
36151
</P
36152
></DD
36153
><DT
36154
><A
36155
NAME="t-javah"
36156
></A
36157
><TT
36158
CLASS="literal"
36159
>javah</TT
36160
></DT
36161
><DD
36162
><P
36163
>&#13;Sets construction variables for the <SPAN
36164
CLASS="application"
36165
>javah</SPAN
36166
> tool.
36167
</P
36168
><P
36169
>&#13;Sets:  <A
36170
HREF="#cv-JAVACLASSSUFFIX"
36171
><CODE
36172
CLASS="envar"
36173
>$JAVACLASSSUFFIX</CODE
36174
></A
36175
>, <A
36176
HREF="#cv-JAVAH"
36177
><CODE
36178
CLASS="envar"
36179
>$JAVAH</CODE
36180
></A
36181
>, <A
36182
HREF="#cv-JAVAHCOM"
36183
><CODE
36184
CLASS="envar"
36185
>$JAVAHCOM</CODE
36186
></A
36187
>, <A
36188
HREF="#cv-JAVAHFLAGS"
36189
><CODE
36190
CLASS="envar"
36191
>$JAVAHFLAGS</CODE
36192
></A
36193
>.
36194
</P
36195
><P
36196
>&#13;Uses:  <A
36197
HREF="#cv-JAVACLASSPATH"
36198
><CODE
36199
CLASS="envar"
36200
>$JAVACLASSPATH</CODE
36201
></A
36202
>, <A
36203
HREF="#cv-JAVAHCOMSTR"
36204
><CODE
36205
CLASS="envar"
36206
>$JAVAHCOMSTR</CODE
36207
></A
36208
>.
36209
</P
36210
></DD
36211
><DT
36212
><A
36213
NAME="t-latex"
36214
></A
36215
><TT
36216
CLASS="literal"
36217
>latex</TT
36218
></DT
36219
><DD
36220
><P
36221
>&#13;Sets construction variables for the <SPAN
36222
CLASS="application"
36223
>latex</SPAN
36224
> utility.
36225
</P
36226
><P
36227
>&#13;Sets:  <A
36228
HREF="#cv-LATEX"
36229
><CODE
36230
CLASS="envar"
36231
>$LATEX</CODE
36232
></A
36233
>, <A
36234
HREF="#cv-LATEXCOM"
36235
><CODE
36236
CLASS="envar"
36237
>$LATEXCOM</CODE
36238
></A
36239
>, <A
36240
HREF="#cv-LATEXFLAGS"
36241
><CODE
36242
CLASS="envar"
36243
>$LATEXFLAGS</CODE
36244
></A
36245
>.
36246
</P
36247
><P
36248
>&#13;Uses:  <A
36249
HREF="#cv-LATEXCOMSTR"
36250
><CODE
36251
CLASS="envar"
36252
>$LATEXCOMSTR</CODE
36253
></A
36254
>.
36255
</P
36256
></DD
36257
><DT
36258
><A
36259
NAME="t-lex"
36260
></A
36261
><TT
36262
CLASS="literal"
36263
>lex</TT
36264
></DT
36265
><DD
36266
><P
36267
>&#13;Sets construction variables for the <SPAN
36268
CLASS="application"
36269
>lex</SPAN
36270
> lexical analyser.
36271
</P
36272
><P
36273
>&#13;Sets:  <A
36274
HREF="#cv-LEX"
36275
><CODE
36276
CLASS="envar"
36277
>$LEX</CODE
36278
></A
36279
>, <A
36280
HREF="#cv-LEXCOM"
36281
><CODE
36282
CLASS="envar"
36283
>$LEXCOM</CODE
36284
></A
36285
>, <A
36286
HREF="#cv-LEXFLAGS"
36287
><CODE
36288
CLASS="envar"
36289
>$LEXFLAGS</CODE
36290
></A
36291
>.
36292
</P
36293
><P
36294
>&#13;Uses:  <A
36295
HREF="#cv-LEXCOMSTR"
36296
><CODE
36297
CLASS="envar"
36298
>$LEXCOMSTR</CODE
36299
></A
36300
>.
36301
</P
36302
></DD
36303
><DT
36304
><A
36305
NAME="t-link"
36306
></A
36307
><TT
36308
CLASS="literal"
36309
>link</TT
36310
></DT
36311
><DD
36312
><P
36313
>&#13;Sets construction variables for generic POSIX linkers.
36314
</P
36315
><P
36316
>&#13;Sets:  <A
36317
HREF="#cv-LDMODULE"
36318
><CODE
36319
CLASS="envar"
36320
>$LDMODULE</CODE
36321
></A
36322
>, <A
36323
HREF="#cv-LDMODULECOM"
36324
><CODE
36325
CLASS="envar"
36326
>$LDMODULECOM</CODE
36327
></A
36328
>, <A
36329
HREF="#cv-LDMODULEFLAGS"
36330
><CODE
36331
CLASS="envar"
36332
>$LDMODULEFLAGS</CODE
36333
></A
36334
>, <A
36335
HREF="#cv-LDMODULEPREFIX"
36336
><CODE
36337
CLASS="envar"
36338
>$LDMODULEPREFIX</CODE
36339
></A
36340
>, <A
36341
HREF="#cv-LDMODULESUFFIX"
36342
><CODE
36343
CLASS="envar"
36344
>$LDMODULESUFFIX</CODE
36345
></A
36346
>, <A
36347
HREF="#cv-LIBDIRPREFIX"
36348
><CODE
36349
CLASS="envar"
36350
>$LIBDIRPREFIX</CODE
36351
></A
36352
>, <A
36353
HREF="#cv-LIBDIRSUFFIX"
36354
><CODE
36355
CLASS="envar"
36356
>$LIBDIRSUFFIX</CODE
36357
></A
36358
>, <A
36359
HREF="#cv-LIBLINKPREFIX"
36360
><CODE
36361
CLASS="envar"
36362
>$LIBLINKPREFIX</CODE
36363
></A
36364
>, <A
36365
HREF="#cv-LIBLINKSUFFIX"
36366
><CODE
36367
CLASS="envar"
36368
>$LIBLINKSUFFIX</CODE
36369
></A
36370
>, <A
36371
HREF="#cv-LINK"
36372
><CODE
36373
CLASS="envar"
36374
>$LINK</CODE
36375
></A
36376
>, <A
36377
HREF="#cv-LINKCOM"
36378
><CODE
36379
CLASS="envar"
36380
>$LINKCOM</CODE
36381
></A
36382
>, <A
36383
HREF="#cv-LINKFLAGS"
36384
><CODE
36385
CLASS="envar"
36386
>$LINKFLAGS</CODE
36387
></A
36388
>, <A
36389
HREF="#cv-SHLIBSUFFIX"
36390
><CODE
36391
CLASS="envar"
36392
>$SHLIBSUFFIX</CODE
36393
></A
36394
>, <A
36395
HREF="#cv-SHLINK"
36396
><CODE
36397
CLASS="envar"
36398
>$SHLINK</CODE
36399
></A
36400
>, <A
36401
HREF="#cv-SHLINKCOM"
36402
><CODE
36403
CLASS="envar"
36404
>$SHLINKCOM</CODE
36405
></A
36406
>, <A
36407
HREF="#cv-SHLINKFLAGS"
36408
><CODE
36409
CLASS="envar"
36410
>$SHLINKFLAGS</CODE
36411
></A
36412
>.
36413
</P
36414
><P
36415
>&#13;Uses:  <A
36416
HREF="#cv-LDMODULECOMSTR"
36417
><CODE
36418
CLASS="envar"
36419
>$LDMODULECOMSTR</CODE
36420
></A
36421
>, <A
36422
HREF="#cv-LINKCOMSTR"
36423
><CODE
36424
CLASS="envar"
36425
>$LINKCOMSTR</CODE
36426
></A
36427
>, <A
36428
HREF="#cv-SHLINKCOMSTR"
36429
><CODE
36430
CLASS="envar"
36431
>$SHLINKCOMSTR</CODE
36432
></A
36433
>.
36434
</P
36435
></DD
36436
><DT
36437
><A
36438
NAME="t-linkloc"
36439
></A
36440
><TT
36441
CLASS="literal"
36442
>linkloc</TT
36443
></DT
36444
><DD
36445
><P
36446
>&#13;Sets construction variables for the
36447
<SPAN
36448
CLASS="application"
36449
>LinkLoc</SPAN
36450
>
36451
linker for the Phar Lap ETS embedded operating system.
36452
</P
36453
><P
36454
>&#13;Sets:  <A
36455
HREF="#cv-LIBDIRPREFIX"
36456
><CODE
36457
CLASS="envar"
36458
>$LIBDIRPREFIX</CODE
36459
></A
36460
>, <A
36461
HREF="#cv-LIBDIRSUFFIX"
36462
><CODE
36463
CLASS="envar"
36464
>$LIBDIRSUFFIX</CODE
36465
></A
36466
>, <A
36467
HREF="#cv-LIBLINKPREFIX"
36468
><CODE
36469
CLASS="envar"
36470
>$LIBLINKPREFIX</CODE
36471
></A
36472
>, <A
36473
HREF="#cv-LIBLINKSUFFIX"
36474
><CODE
36475
CLASS="envar"
36476
>$LIBLINKSUFFIX</CODE
36477
></A
36478
>, <A
36479
HREF="#cv-LINK"
36480
><CODE
36481
CLASS="envar"
36482
>$LINK</CODE
36483
></A
36484
>, <A
36485
HREF="#cv-LINKCOM"
36486
><CODE
36487
CLASS="envar"
36488
>$LINKCOM</CODE
36489
></A
36490
>, <A
36491
HREF="#cv-LINKFLAGS"
36492
><CODE
36493
CLASS="envar"
36494
>$LINKFLAGS</CODE
36495
></A
36496
>, <A
36497
HREF="#cv-SHLINK"
36498
><CODE
36499
CLASS="envar"
36500
>$SHLINK</CODE
36501
></A
36502
>, <A
36503
HREF="#cv-SHLINKCOM"
36504
><CODE
36505
CLASS="envar"
36506
>$SHLINKCOM</CODE
36507
></A
36508
>, <A
36509
HREF="#cv-SHLINKFLAGS"
36510
><CODE
36511
CLASS="envar"
36512
>$SHLINKFLAGS</CODE
36513
></A
36514
>.
36515
</P
36516
><P
36517
>&#13;Uses:  <A
36518
HREF="#cv-LINKCOMSTR"
36519
><CODE
36520
CLASS="envar"
36521
>$LINKCOMSTR</CODE
36522
></A
36523
>, <A
36524
HREF="#cv-SHLINKCOMSTR"
36525
><CODE
36526
CLASS="envar"
36527
>$SHLINKCOMSTR</CODE
36528
></A
36529
>.
36530
</P
36531
></DD
36532
><DT
36533
><A
36534
NAME="t-m4"
36535
></A
36536
><TT
36537
CLASS="literal"
36538
>m4</TT
36539
></DT
36540
><DD
36541
><P
36542
>&#13;Sets construction variables for the <SPAN
36543
CLASS="application"
36544
>m4</SPAN
36545
> macro processor.
36546
</P
36547
><P
36548
>&#13;Sets:  <A
36549
HREF="#cv-M4"
36550
><CODE
36551
CLASS="envar"
36552
>$M4</CODE
36553
></A
36554
>, <A
36555
HREF="#cv-M4COM"
36556
><CODE
36557
CLASS="envar"
36558
>$M4COM</CODE
36559
></A
36560
>, <A
36561
HREF="#cv-M4FLAGS"
36562
><CODE
36563
CLASS="envar"
36564
>$M4FLAGS</CODE
36565
></A
36566
>.
36567
</P
36568
><P
36569
>&#13;Uses:  <A
36570
HREF="#cv-M4COMSTR"
36571
><CODE
36572
CLASS="envar"
36573
>$M4COMSTR</CODE
36574
></A
36575
>.
36576
</P
36577
></DD
36578
><DT
36579
><A
36580
NAME="t-masm"
36581
></A
36582
><TT
36583
CLASS="literal"
36584
>masm</TT
36585
></DT
36586
><DD
36587
><P
36588
>&#13;Sets construction variables for the Microsoft assembler.
36589
</P
36590
><P
36591
>&#13;Sets:  <A
36592
HREF="#cv-AS"
36593
><CODE
36594
CLASS="envar"
36595
>$AS</CODE
36596
></A
36597
>, <A
36598
HREF="#cv-ASCOM"
36599
><CODE
36600
CLASS="envar"
36601
>$ASCOM</CODE
36602
></A
36603
>, <A
36604
HREF="#cv-ASFLAGS"
36605
><CODE
36606
CLASS="envar"
36607
>$ASFLAGS</CODE
36608
></A
36609
>, <A
36610
HREF="#cv-ASPPCOM"
36611
><CODE
36612
CLASS="envar"
36613
>$ASPPCOM</CODE
36614
></A
36615
>, <A
36616
HREF="#cv-ASPPFLAGS"
36617
><CODE
36618
CLASS="envar"
36619
>$ASPPFLAGS</CODE
36620
></A
36621
>.
36622
</P
36623
><P
36624
>&#13;Uses:  <A
36625
HREF="#cv-ASCOMSTR"
36626
><CODE
36627
CLASS="envar"
36628
>$ASCOMSTR</CODE
36629
></A
36630
>, <A
36631
HREF="#cv-ASPPCOMSTR"
36632
><CODE
36633
CLASS="envar"
36634
>$ASPPCOMSTR</CODE
36635
></A
36636
>, <A
36637
HREF="#cv-CPPFLAGS"
36638
><CODE
36639
CLASS="envar"
36640
>$CPPFLAGS</CODE
36641
></A
36642
>, <A
36643
HREF="#cv-_CPPDEFFLAGS"
36644
><CODE
36645
CLASS="envar"
36646
>$_CPPDEFFLAGS</CODE
36647
></A
36648
>, <A
36649
HREF="#cv-_CPPINCFLAGS"
36650
><CODE
36651
CLASS="envar"
36652
>$_CPPINCFLAGS</CODE
36653
></A
36654
>.
36655
</P
36656
></DD
36657
><DT
36658
><A
36659
NAME="t-midl"
36660
></A
36661
><TT
36662
CLASS="literal"
36663
>midl</TT
36664
></DT
36665
><DD
36666
><P
36667
>&#13;Sets construction variables for the Microsoft IDL compiler.
36668
</P
36669
><P
36670
>&#13;Sets:  <A
36671
HREF="#cv-MIDL"
36672
><CODE
36673
CLASS="envar"
36674
>$MIDL</CODE
36675
></A
36676
>, <A
36677
HREF="#cv-MIDLCOM"
36678
><CODE
36679
CLASS="envar"
36680
>$MIDLCOM</CODE
36681
></A
36682
>, <A
36683
HREF="#cv-MIDLFLAGS"
36684
><CODE
36685
CLASS="envar"
36686
>$MIDLFLAGS</CODE
36687
></A
36688
>.
36689
</P
36690
><P
36691
>&#13;Uses:  <A
36692
HREF="#cv-MIDLCOMSTR"
36693
><CODE
36694
CLASS="envar"
36695
>$MIDLCOMSTR</CODE
36696
></A
36697
>.
36698
</P
36699
></DD
36700
><DT
36701
><A
36702
NAME="t-mingw"
36703
></A
36704
><TT
36705
CLASS="literal"
36706
>mingw</TT
36707
></DT
36708
><DD
36709
><P
36710
>&#13;Sets construction variables for MinGW (Minimal Gnu on Windows).
36711
</P
36712
><P
36713
>&#13;Sets:  <A
36714
HREF="#cv-AS"
36715
><CODE
36716
CLASS="envar"
36717
>$AS</CODE
36718
></A
36719
>, <A
36720
HREF="#cv-CC"
36721
><CODE
36722
CLASS="envar"
36723
>$CC</CODE
36724
></A
36725
>, <A
36726
HREF="#cv-CXX"
36727
><CODE
36728
CLASS="envar"
36729
>$CXX</CODE
36730
></A
36731
>, <A
36732
HREF="#cv-LDMODULECOM"
36733
><CODE
36734
CLASS="envar"
36735
>$LDMODULECOM</CODE
36736
></A
36737
>, <A
36738
HREF="#cv-LIBPREFIX"
36739
><CODE
36740
CLASS="envar"
36741
>$LIBPREFIX</CODE
36742
></A
36743
>, <A
36744
HREF="#cv-LIBSUFFIX"
36745
><CODE
36746
CLASS="envar"
36747
>$LIBSUFFIX</CODE
36748
></A
36749
>, <A
36750
HREF="#cv-OBJSUFFIX"
36751
><CODE
36752
CLASS="envar"
36753
>$OBJSUFFIX</CODE
36754
></A
36755
>, <A
36756
HREF="#cv-RC"
36757
><CODE
36758
CLASS="envar"
36759
>$RC</CODE
36760
></A
36761
>, <A
36762
HREF="#cv-RCCOM"
36763
><CODE
36764
CLASS="envar"
36765
>$RCCOM</CODE
36766
></A
36767
>, <A
36768
HREF="#cv-RCFLAGS"
36769
><CODE
36770
CLASS="envar"
36771
>$RCFLAGS</CODE
36772
></A
36773
>, <A
36774
HREF="#cv-RCINCFLAGS"
36775
><CODE
36776
CLASS="envar"
36777
>$RCINCFLAGS</CODE
36778
></A
36779
>, <A
36780
HREF="#cv-RCINCPREFIX"
36781
><CODE
36782
CLASS="envar"
36783
>$RCINCPREFIX</CODE
36784
></A
36785
>, <A
36786
HREF="#cv-RCINCSUFFIX"
36787
><CODE
36788
CLASS="envar"
36789
>$RCINCSUFFIX</CODE
36790
></A
36791
>, <A
36792
HREF="#cv-SHCCFLAGS"
36793
><CODE
36794
CLASS="envar"
36795
>$SHCCFLAGS</CODE
36796
></A
36797
>, <A
36798
HREF="#cv-SHCXXFLAGS"
36799
><CODE
36800
CLASS="envar"
36801
>$SHCXXFLAGS</CODE
36802
></A
36803
>, <A
36804
HREF="#cv-SHLINKCOM"
36805
><CODE
36806
CLASS="envar"
36807
>$SHLINKCOM</CODE
36808
></A
36809
>, <A
36810
HREF="#cv-SHLINKFLAGS"
36811
><CODE
36812
CLASS="envar"
36813
>$SHLINKFLAGS</CODE
36814
></A
36815
>, <A
36816
HREF="#cv-SHOBJSUFFIX"
36817
><CODE
36818
CLASS="envar"
36819
>$SHOBJSUFFIX</CODE
36820
></A
36821
>, <A
36822
HREF="#cv-WINDOWSDEFPREFIX"
36823
><CODE
36824
CLASS="envar"
36825
>$WINDOWSDEFPREFIX</CODE
36826
></A
36827
>, <A
36828
HREF="#cv-WINDOWSDEFSUFFIX"
36829
><CODE
36830
CLASS="envar"
36831
>$WINDOWSDEFSUFFIX</CODE
36832
></A
36833
>.
36834
</P
36835
><P
36836
>&#13;Uses:  <A
36837
HREF="#cv-RCCOMSTR"
36838
><CODE
36839
CLASS="envar"
36840
>$RCCOMSTR</CODE
36841
></A
36842
>, <A
36843
HREF="#cv-SHLINKCOMSTR"
36844
><CODE
36845
CLASS="envar"
36846
>$SHLINKCOMSTR</CODE
36847
></A
36848
>.
36849
</P
36850
></DD
36851
><DT
36852
><A
36853
NAME="t-mslib"
36854
></A
36855
><TT
36856
CLASS="literal"
36857
>mslib</TT
36858
></DT
36859
><DD
36860
><P
36861
>&#13;Sets construction variables for the Microsoft
36862
<SPAN
36863
CLASS="application"
36864
>mslib</SPAN
36865
>
36866
library archiver.
36867
</P
36868
><P
36869
>&#13;Sets:  <A
36870
HREF="#cv-AR"
36871
><CODE
36872
CLASS="envar"
36873
>$AR</CODE
36874
></A
36875
>, <A
36876
HREF="#cv-ARCOM"
36877
><CODE
36878
CLASS="envar"
36879
>$ARCOM</CODE
36880
></A
36881
>, <A
36882
HREF="#cv-ARFLAGS"
36883
><CODE
36884
CLASS="envar"
36885
>$ARFLAGS</CODE
36886
></A
36887
>, <A
36888
HREF="#cv-LIBPREFIX"
36889
><CODE
36890
CLASS="envar"
36891
>$LIBPREFIX</CODE
36892
></A
36893
>, <A
36894
HREF="#cv-LIBSUFFIX"
36895
><CODE
36896
CLASS="envar"
36897
>$LIBSUFFIX</CODE
36898
></A
36899
>.
36900
</P
36901
><P
36902
>&#13;Uses:  <A
36903
HREF="#cv-ARCOMSTR"
36904
><CODE
36905
CLASS="envar"
36906
>$ARCOMSTR</CODE
36907
></A
36908
>.
36909
</P
36910
></DD
36911
><DT
36912
><A
36913
NAME="t-mslink"
36914
></A
36915
><TT
36916
CLASS="literal"
36917
>mslink</TT
36918
></DT
36919
><DD
36920
><P
36921
>&#13;Sets construction variables for the Microsoft linker.
36922
</P
36923
><P
36924
>&#13;Sets:  <A
36925
HREF="#cv-LDMODULE"
36926
><CODE
36927
CLASS="envar"
36928
>$LDMODULE</CODE
36929
></A
36930
>, <A
36931
HREF="#cv-LDMODULECOM"
36932
><CODE
36933
CLASS="envar"
36934
>$LDMODULECOM</CODE
36935
></A
36936
>, <A
36937
HREF="#cv-LDMODULEFLAGS"
36938
><CODE
36939
CLASS="envar"
36940
>$LDMODULEFLAGS</CODE
36941
></A
36942
>, <A
36943
HREF="#cv-LDMODULEPREFIX"
36944
><CODE
36945
CLASS="envar"
36946
>$LDMODULEPREFIX</CODE
36947
></A
36948
>, <A
36949
HREF="#cv-LDMODULESUFFIX"
36950
><CODE
36951
CLASS="envar"
36952
>$LDMODULESUFFIX</CODE
36953
></A
36954
>, <A
36955
HREF="#cv-LIBDIRPREFIX"
36956
><CODE
36957
CLASS="envar"
36958
>$LIBDIRPREFIX</CODE
36959
></A
36960
>, <A
36961
HREF="#cv-LIBDIRSUFFIX"
36962
><CODE
36963
CLASS="envar"
36964
>$LIBDIRSUFFIX</CODE
36965
></A
36966
>, <A
36967
HREF="#cv-LIBLINKPREFIX"
36968
><CODE
36969
CLASS="envar"
36970
>$LIBLINKPREFIX</CODE
36971
></A
36972
>, <A
36973
HREF="#cv-LIBLINKSUFFIX"
36974
><CODE
36975
CLASS="envar"
36976
>$LIBLINKSUFFIX</CODE
36977
></A
36978
>, <A
36979
HREF="#cv-LINK"
36980
><CODE
36981
CLASS="envar"
36982
>$LINK</CODE
36983
></A
36984
>, <A
36985
HREF="#cv-LINKCOM"
36986
><CODE
36987
CLASS="envar"
36988
>$LINKCOM</CODE
36989
></A
36990
>, <A
36991
HREF="#cv-LINKFLAGS"
36992
><CODE
36993
CLASS="envar"
36994
>$LINKFLAGS</CODE
36995
></A
36996
>, <A
36997
HREF="#cv-REGSVR"
36998
><CODE
36999
CLASS="envar"
37000
>$REGSVR</CODE
37001
></A
37002
>, <A
37003
HREF="#cv-REGSVRCOM"
37004
><CODE
37005
CLASS="envar"
37006
>$REGSVRCOM</CODE
37007
></A
37008
>, <A
37009
HREF="#cv-REGSVRFLAGS"
37010
><CODE
37011
CLASS="envar"
37012
>$REGSVRFLAGS</CODE
37013
></A
37014
>, <A
37015
HREF="#cv-SHLINK"
37016
><CODE
37017
CLASS="envar"
37018
>$SHLINK</CODE
37019
></A
37020
>, <A
37021
HREF="#cv-SHLINKCOM"
37022
><CODE
37023
CLASS="envar"
37024
>$SHLINKCOM</CODE
37025
></A
37026
>, <A
37027
HREF="#cv-SHLINKFLAGS"
37028
><CODE
37029
CLASS="envar"
37030
>$SHLINKFLAGS</CODE
37031
></A
37032
>, <A
37033
HREF="#cv-WIN32DEFPREFIX"
37034
><CODE
37035
CLASS="envar"
37036
>$WIN32DEFPREFIX</CODE
37037
></A
37038
>, <A
37039
HREF="#cv-WIN32DEFSUFFIX"
37040
><CODE
37041
CLASS="envar"
37042
>$WIN32DEFSUFFIX</CODE
37043
></A
37044
>, <A
37045
HREF="#cv-WIN32EXPPREFIX"
37046
><CODE
37047
CLASS="envar"
37048
>$WIN32EXPPREFIX</CODE
37049
></A
37050
>, <A
37051
HREF="#cv-WIN32EXPSUFFIX"
37052
><CODE
37053
CLASS="envar"
37054
>$WIN32EXPSUFFIX</CODE
37055
></A
37056
>, <A
37057
HREF="#cv-WINDOWSDEFPREFIX"
37058
><CODE
37059
CLASS="envar"
37060
>$WINDOWSDEFPREFIX</CODE
37061
></A
37062
>, <A
37063
HREF="#cv-WINDOWSDEFSUFFIX"
37064
><CODE
37065
CLASS="envar"
37066
>$WINDOWSDEFSUFFIX</CODE
37067
></A
37068
>, <A
37069
HREF="#cv-WINDOWSEXPPREFIX"
37070
><CODE
37071
CLASS="envar"
37072
>$WINDOWSEXPPREFIX</CODE
37073
></A
37074
>, <A
37075
HREF="#cv-WINDOWSEXPSUFFIX"
37076
><CODE
37077
CLASS="envar"
37078
>$WINDOWSEXPSUFFIX</CODE
37079
></A
37080
>, <A
37081
HREF="#cv-WINDOWSPROGMANIFESTPREFIX"
37082
><CODE
37083
CLASS="envar"
37084
>$WINDOWSPROGMANIFESTPREFIX</CODE
37085
></A
37086
>, <A
37087
HREF="#cv-WINDOWSPROGMANIFESTSUFFIX"
37088
><CODE
37089
CLASS="envar"
37090
>$WINDOWSPROGMANIFESTSUFFIX</CODE
37091
></A
37092
>, <A
37093
HREF="#cv-WINDOWSSHLIBMANIFESTPREFIX"
37094
><CODE
37095
CLASS="envar"
37096
>$WINDOWSSHLIBMANIFESTPREFIX</CODE
37097
></A
37098
>, <A
37099
HREF="#cv-WINDOWSSHLIBMANIFESTSUFFIX"
37100
><CODE
37101
CLASS="envar"
37102
>$WINDOWSSHLIBMANIFESTSUFFIX</CODE
37103
></A
37104
>, <A
37105
HREF="#cv-WINDOWS_INSERT_DEF"
37106
><CODE
37107
CLASS="envar"
37108
>$WINDOWS_INSERT_DEF</CODE
37109
></A
37110
>.
37111
</P
37112
><P
37113
>&#13;Uses:  <A
37114
HREF="#cv-LDMODULECOMSTR"
37115
><CODE
37116
CLASS="envar"
37117
>$LDMODULECOMSTR</CODE
37118
></A
37119
>, <A
37120
HREF="#cv-LINKCOMSTR"
37121
><CODE
37122
CLASS="envar"
37123
>$LINKCOMSTR</CODE
37124
></A
37125
>, <A
37126
HREF="#cv-MSVS_IGNORE_IDE_PATHS"
37127
><CODE
37128
CLASS="envar"
37129
>$MSVS_IGNORE_IDE_PATHS</CODE
37130
></A
37131
>, <A
37132
HREF="#cv-REGSVRCOMSTR"
37133
><CODE
37134
CLASS="envar"
37135
>$REGSVRCOMSTR</CODE
37136
></A
37137
>, <A
37138
HREF="#cv-SHLINKCOMSTR"
37139
><CODE
37140
CLASS="envar"
37141
>$SHLINKCOMSTR</CODE
37142
></A
37143
>.
37144
</P
37145
></DD
37146
><DT
37147
><A
37148
NAME="t-msvc"
37149
></A
37150
><TT
37151
CLASS="literal"
37152
>msvc</TT
37153
></DT
37154
><DD
37155
><P
37156
>&#13;Sets construction variables for the Microsoft Visual C/C++ compiler.
37157
</P
37158
><P
37159
>&#13;Sets:  <A
37160
HREF="#cv-BUILDERS"
37161
><CODE
37162
CLASS="envar"
37163
>$BUILDERS</CODE
37164
></A
37165
>, <A
37166
HREF="#cv-CC"
37167
><CODE
37168
CLASS="envar"
37169
>$CC</CODE
37170
></A
37171
>, <A
37172
HREF="#cv-CCCOM"
37173
><CODE
37174
CLASS="envar"
37175
>$CCCOM</CODE
37176
></A
37177
>, <A
37178
HREF="#cv-CCFLAGS"
37179
><CODE
37180
CLASS="envar"
37181
>$CCFLAGS</CODE
37182
></A
37183
>, <A
37184
HREF="#cv-CCPCHFLAGS"
37185
><CODE
37186
CLASS="envar"
37187
>$CCPCHFLAGS</CODE
37188
></A
37189
>, <A
37190
HREF="#cv-CCPDBFLAGS"
37191
><CODE
37192
CLASS="envar"
37193
>$CCPDBFLAGS</CODE
37194
></A
37195
>, <A
37196
HREF="#cv-CFILESUFFIX"
37197
><CODE
37198
CLASS="envar"
37199
>$CFILESUFFIX</CODE
37200
></A
37201
>, <A
37202
HREF="#cv-CFLAGS"
37203
><CODE
37204
CLASS="envar"
37205
>$CFLAGS</CODE
37206
></A
37207
>, <A
37208
HREF="#cv-CPPDEFPREFIX"
37209
><CODE
37210
CLASS="envar"
37211
>$CPPDEFPREFIX</CODE
37212
></A
37213
>, <A
37214
HREF="#cv-CPPDEFSUFFIX"
37215
><CODE
37216
CLASS="envar"
37217
>$CPPDEFSUFFIX</CODE
37218
></A
37219
>, <A
37220
HREF="#cv-CXX"
37221
><CODE
37222
CLASS="envar"
37223
>$CXX</CODE
37224
></A
37225
>, <A
37226
HREF="#cv-CXXCOM"
37227
><CODE
37228
CLASS="envar"
37229
>$CXXCOM</CODE
37230
></A
37231
>, <A
37232
HREF="#cv-CXXFILESUFFIX"
37233
><CODE
37234
CLASS="envar"
37235
>$CXXFILESUFFIX</CODE
37236
></A
37237
>, <A
37238
HREF="#cv-CXXFLAGS"
37239
><CODE
37240
CLASS="envar"
37241
>$CXXFLAGS</CODE
37242
></A
37243
>, <A
37244
HREF="#cv-INCPREFIX"
37245
><CODE
37246
CLASS="envar"
37247
>$INCPREFIX</CODE
37248
></A
37249
>, <A
37250
HREF="#cv-INCSUFFIX"
37251
><CODE
37252
CLASS="envar"
37253
>$INCSUFFIX</CODE
37254
></A
37255
>, <A
37256
HREF="#cv-OBJPREFIX"
37257
><CODE
37258
CLASS="envar"
37259
>$OBJPREFIX</CODE
37260
></A
37261
>, <A
37262
HREF="#cv-OBJSUFFIX"
37263
><CODE
37264
CLASS="envar"
37265
>$OBJSUFFIX</CODE
37266
></A
37267
>, <A
37268
HREF="#cv-PCHCOM"
37269
><CODE
37270
CLASS="envar"
37271
>$PCHCOM</CODE
37272
></A
37273
>, <A
37274
HREF="#cv-PCHPDBFLAGS"
37275
><CODE
37276
CLASS="envar"
37277
>$PCHPDBFLAGS</CODE
37278
></A
37279
>, <A
37280
HREF="#cv-RC"
37281
><CODE
37282
CLASS="envar"
37283
>$RC</CODE
37284
></A
37285
>, <A
37286
HREF="#cv-RCCOM"
37287
><CODE
37288
CLASS="envar"
37289
>$RCCOM</CODE
37290
></A
37291
>, <A
37292
HREF="#cv-RCFLAGS"
37293
><CODE
37294
CLASS="envar"
37295
>$RCFLAGS</CODE
37296
></A
37297
>, <A
37298
HREF="#cv-SHCC"
37299
><CODE
37300
CLASS="envar"
37301
>$SHCC</CODE
37302
></A
37303
>, <A
37304
HREF="#cv-SHCCCOM"
37305
><CODE
37306
CLASS="envar"
37307
>$SHCCCOM</CODE
37308
></A
37309
>, <A
37310
HREF="#cv-SHCCFLAGS"
37311
><CODE
37312
CLASS="envar"
37313
>$SHCCFLAGS</CODE
37314
></A
37315
>, <A
37316
HREF="#cv-SHCFLAGS"
37317
><CODE
37318
CLASS="envar"
37319
>$SHCFLAGS</CODE
37320
></A
37321
>, <A
37322
HREF="#cv-SHCXX"
37323
><CODE
37324
CLASS="envar"
37325
>$SHCXX</CODE
37326
></A
37327
>, <A
37328
HREF="#cv-SHCXXCOM"
37329
><CODE
37330
CLASS="envar"
37331
>$SHCXXCOM</CODE
37332
></A
37333
>, <A
37334
HREF="#cv-SHCXXFLAGS"
37335
><CODE
37336
CLASS="envar"
37337
>$SHCXXFLAGS</CODE
37338
></A
37339
>, <A
37340
HREF="#cv-SHOBJPREFIX"
37341
><CODE
37342
CLASS="envar"
37343
>$SHOBJPREFIX</CODE
37344
></A
37345
>, <A
37346
HREF="#cv-SHOBJSUFFIX"
37347
><CODE
37348
CLASS="envar"
37349
>$SHOBJSUFFIX</CODE
37350
></A
37351
>.
37352
</P
37353
><P
37354
>&#13;Uses:  <A
37355
HREF="#cv-CCCOMSTR"
37356
><CODE
37357
CLASS="envar"
37358
>$CCCOMSTR</CODE
37359
></A
37360
>, <A
37361
HREF="#cv-CXXCOMSTR"
37362
><CODE
37363
CLASS="envar"
37364
>$CXXCOMSTR</CODE
37365
></A
37366
>, <A
37367
HREF="#cv-SHCCCOMSTR"
37368
><CODE
37369
CLASS="envar"
37370
>$SHCCCOMSTR</CODE
37371
></A
37372
>, <A
37373
HREF="#cv-SHCXXCOMSTR"
37374
><CODE
37375
CLASS="envar"
37376
>$SHCXXCOMSTR</CODE
37377
></A
37378
>.
37379
</P
37380
></DD
37381
><DT
37382
><A
37383
NAME="t-msvs"
37384
></A
37385
><TT
37386
CLASS="literal"
37387
>msvs</TT
37388
></DT
37389
><DD
37390
><P
37391
>&#13;Sets construction variables for Microsoft Visual Studio.
37392
</P
37393
><P
37394
>&#13;Sets:  <A
37395
HREF="#cv-MSVSBUILDCOM"
37396
><CODE
37397
CLASS="envar"
37398
>$MSVSBUILDCOM</CODE
37399
></A
37400
>, <A
37401
HREF="#cv-MSVSCLEANCOM"
37402
><CODE
37403
CLASS="envar"
37404
>$MSVSCLEANCOM</CODE
37405
></A
37406
>, <A
37407
HREF="#cv-MSVSENCODING"
37408
><CODE
37409
CLASS="envar"
37410
>$MSVSENCODING</CODE
37411
></A
37412
>, <A
37413
HREF="#cv-MSVSPROJECTCOM"
37414
><CODE
37415
CLASS="envar"
37416
>$MSVSPROJECTCOM</CODE
37417
></A
37418
>, <A
37419
HREF="#cv-MSVSREBUILDCOM"
37420
><CODE
37421
CLASS="envar"
37422
>$MSVSREBUILDCOM</CODE
37423
></A
37424
>, <A
37425
HREF="#cv-MSVSSCONS"
37426
><CODE
37427
CLASS="envar"
37428
>$MSVSSCONS</CODE
37429
></A
37430
>, <A
37431
HREF="#cv-MSVSSCONSCOM"
37432
><CODE
37433
CLASS="envar"
37434
>$MSVSSCONSCOM</CODE
37435
></A
37436
>, <A
37437
HREF="#cv-MSVSSCONSCRIPT"
37438
><CODE
37439
CLASS="envar"
37440
>$MSVSSCONSCRIPT</CODE
37441
></A
37442
>, <A
37443
HREF="#cv-MSVSSCONSFLAGS"
37444
><CODE
37445
CLASS="envar"
37446
>$MSVSSCONSFLAGS</CODE
37447
></A
37448
>, <A
37449
HREF="#cv-MSVSSOLUTIONCOM"
37450
><CODE
37451
CLASS="envar"
37452
>$MSVSSOLUTIONCOM</CODE
37453
></A
37454
>.
37455
</P
37456
></DD
37457
><DT
37458
><A
37459
NAME="t-mwcc"
37460
></A
37461
><TT
37462
CLASS="literal"
37463
>mwcc</TT
37464
></DT
37465
><DD
37466
><P
37467
>&#13;Sets construction variables for the Metrowerks CodeWarrior compiler.
37468
</P
37469
><P
37470
>&#13;Sets:  <A
37471
HREF="#cv-CC"
37472
><CODE
37473
CLASS="envar"
37474
>$CC</CODE
37475
></A
37476
>, <A
37477
HREF="#cv-CCCOM"
37478
><CODE
37479
CLASS="envar"
37480
>$CCCOM</CODE
37481
></A
37482
>, <A
37483
HREF="#cv-CFILESUFFIX"
37484
><CODE
37485
CLASS="envar"
37486
>$CFILESUFFIX</CODE
37487
></A
37488
>, <A
37489
HREF="#cv-CPPDEFPREFIX"
37490
><CODE
37491
CLASS="envar"
37492
>$CPPDEFPREFIX</CODE
37493
></A
37494
>, <A
37495
HREF="#cv-CPPDEFSUFFIX"
37496
><CODE
37497
CLASS="envar"
37498
>$CPPDEFSUFFIX</CODE
37499
></A
37500
>, <A
37501
HREF="#cv-CXX"
37502
><CODE
37503
CLASS="envar"
37504
>$CXX</CODE
37505
></A
37506
>, <A
37507
HREF="#cv-CXXCOM"
37508
><CODE
37509
CLASS="envar"
37510
>$CXXCOM</CODE
37511
></A
37512
>, <A
37513
HREF="#cv-CXXFILESUFFIX"
37514
><CODE
37515
CLASS="envar"
37516
>$CXXFILESUFFIX</CODE
37517
></A
37518
>, <A
37519
HREF="#cv-INCPREFIX"
37520
><CODE
37521
CLASS="envar"
37522
>$INCPREFIX</CODE
37523
></A
37524
>, <A
37525
HREF="#cv-INCSUFFIX"
37526
><CODE
37527
CLASS="envar"
37528
>$INCSUFFIX</CODE
37529
></A
37530
>, <A
37531
HREF="#cv-MWCW_VERSION"
37532
><CODE
37533
CLASS="envar"
37534
>$MWCW_VERSION</CODE
37535
></A
37536
>, <A
37537
HREF="#cv-MWCW_VERSIONS"
37538
><CODE
37539
CLASS="envar"
37540
>$MWCW_VERSIONS</CODE
37541
></A
37542
>, <A
37543
HREF="#cv-SHCC"
37544
><CODE
37545
CLASS="envar"
37546
>$SHCC</CODE
37547
></A
37548
>, <A
37549
HREF="#cv-SHCCCOM"
37550
><CODE
37551
CLASS="envar"
37552
>$SHCCCOM</CODE
37553
></A
37554
>, <A
37555
HREF="#cv-SHCCFLAGS"
37556
><CODE
37557
CLASS="envar"
37558
>$SHCCFLAGS</CODE
37559
></A
37560
>, <A
37561
HREF="#cv-SHCFLAGS"
37562
><CODE
37563
CLASS="envar"
37564
>$SHCFLAGS</CODE
37565
></A
37566
>, <A
37567
HREF="#cv-SHCXX"
37568
><CODE
37569
CLASS="envar"
37570
>$SHCXX</CODE
37571
></A
37572
>, <A
37573
HREF="#cv-SHCXXCOM"
37574
><CODE
37575
CLASS="envar"
37576
>$SHCXXCOM</CODE
37577
></A
37578
>, <A
37579
HREF="#cv-SHCXXFLAGS"
37580
><CODE
37581
CLASS="envar"
37582
>$SHCXXFLAGS</CODE
37583
></A
37584
>.
37585
</P
37586
><P
37587
>&#13;Uses:  <A
37588
HREF="#cv-CCCOMSTR"
37589
><CODE
37590
CLASS="envar"
37591
>$CCCOMSTR</CODE
37592
></A
37593
>, <A
37594
HREF="#cv-CXXCOMSTR"
37595
><CODE
37596
CLASS="envar"
37597
>$CXXCOMSTR</CODE
37598
></A
37599
>, <A
37600
HREF="#cv-SHCCCOMSTR"
37601
><CODE
37602
CLASS="envar"
37603
>$SHCCCOMSTR</CODE
37604
></A
37605
>, <A
37606
HREF="#cv-SHCXXCOMSTR"
37607
><CODE
37608
CLASS="envar"
37609
>$SHCXXCOMSTR</CODE
37610
></A
37611
>.
37612
</P
37613
></DD
37614
><DT
37615
><A
37616
NAME="t-mwld"
37617
></A
37618
><TT
37619
CLASS="literal"
37620
>mwld</TT
37621
></DT
37622
><DD
37623
><P
37624
>&#13;Sets construction variables for the Metrowerks CodeWarrior linker.
37625
</P
37626
><P
37627
>&#13;Sets:  <A
37628
HREF="#cv-AR"
37629
><CODE
37630
CLASS="envar"
37631
>$AR</CODE
37632
></A
37633
>, <A
37634
HREF="#cv-ARCOM"
37635
><CODE
37636
CLASS="envar"
37637
>$ARCOM</CODE
37638
></A
37639
>, <A
37640
HREF="#cv-LIBDIRPREFIX"
37641
><CODE
37642
CLASS="envar"
37643
>$LIBDIRPREFIX</CODE
37644
></A
37645
>, <A
37646
HREF="#cv-LIBDIRSUFFIX"
37647
><CODE
37648
CLASS="envar"
37649
>$LIBDIRSUFFIX</CODE
37650
></A
37651
>, <A
37652
HREF="#cv-LIBLINKPREFIX"
37653
><CODE
37654
CLASS="envar"
37655
>$LIBLINKPREFIX</CODE
37656
></A
37657
>, <A
37658
HREF="#cv-LIBLINKSUFFIX"
37659
><CODE
37660
CLASS="envar"
37661
>$LIBLINKSUFFIX</CODE
37662
></A
37663
>, <A
37664
HREF="#cv-LINK"
37665
><CODE
37666
CLASS="envar"
37667
>$LINK</CODE
37668
></A
37669
>, <A
37670
HREF="#cv-LINKCOM"
37671
><CODE
37672
CLASS="envar"
37673
>$LINKCOM</CODE
37674
></A
37675
>, <A
37676
HREF="#cv-SHLINK"
37677
><CODE
37678
CLASS="envar"
37679
>$SHLINK</CODE
37680
></A
37681
>, <A
37682
HREF="#cv-SHLINKCOM"
37683
><CODE
37684
CLASS="envar"
37685
>$SHLINKCOM</CODE
37686
></A
37687
>, <A
37688
HREF="#cv-SHLINKFLAGS"
37689
><CODE
37690
CLASS="envar"
37691
>$SHLINKFLAGS</CODE
37692
></A
37693
>.
37694
</P
37695
></DD
37696
><DT
37697
><A
37698
NAME="t-nasm"
37699
></A
37700
><TT
37701
CLASS="literal"
37702
>nasm</TT
37703
></DT
37704
><DD
37705
><P
37706
>&#13;Sets construction variables for the
37707
<SPAN
37708
CLASS="application"
37709
>nasm</SPAN
37710
> Netwide Assembler.
37711
</P
37712
><P
37713
>&#13;Sets:  <A
37714
HREF="#cv-AS"
37715
><CODE
37716
CLASS="envar"
37717
>$AS</CODE
37718
></A
37719
>, <A
37720
HREF="#cv-ASCOM"
37721
><CODE
37722
CLASS="envar"
37723
>$ASCOM</CODE
37724
></A
37725
>, <A
37726
HREF="#cv-ASFLAGS"
37727
><CODE
37728
CLASS="envar"
37729
>$ASFLAGS</CODE
37730
></A
37731
>, <A
37732
HREF="#cv-ASPPCOM"
37733
><CODE
37734
CLASS="envar"
37735
>$ASPPCOM</CODE
37736
></A
37737
>, <A
37738
HREF="#cv-ASPPFLAGS"
37739
><CODE
37740
CLASS="envar"
37741
>$ASPPFLAGS</CODE
37742
></A
37743
>.
37744
</P
37745
><P
37746
>&#13;Uses:  <A
37747
HREF="#cv-ASCOMSTR"
37748
><CODE
37749
CLASS="envar"
37750
>$ASCOMSTR</CODE
37751
></A
37752
>, <A
37753
HREF="#cv-ASPPCOMSTR"
37754
><CODE
37755
CLASS="envar"
37756
>$ASPPCOMSTR</CODE
37757
></A
37758
>.
37759
</P
37760
></DD
37761
><DT
37762
><A
37763
NAME="t-packaging"
37764
></A
37765
><TT
37766
CLASS="literal"
37767
>packaging</TT
37768
></DT
37769
><DD
37770
><P
37771
>&#13;A framework for building binary and source packages.
37772
</P
37773
></DD
37774
><DT
37775
><A
37776
NAME="t-Packaging"
37777
></A
37778
><TT
37779
CLASS="literal"
37780
>Packaging</TT
37781
></DT
37782
><DD
37783
><P
37784
>&#13;Sets construction variables for the <CODE
37785
CLASS="function"
37786
>Package</CODE
37787
> Builder.
37788
</P
37789
></DD
37790
><DT
37791
><A
37792
NAME="t-pdf"
37793
></A
37794
><TT
37795
CLASS="literal"
37796
>pdf</TT
37797
></DT
37798
><DD
37799
><P
37800
>&#13;Sets construction variables for the Portable Document Format builder.
37801
</P
37802
><P
37803
>&#13;Sets:  <A
37804
HREF="#cv-PDFPREFIX"
37805
><CODE
37806
CLASS="envar"
37807
>$PDFPREFIX</CODE
37808
></A
37809
>, <A
37810
HREF="#cv-PDFSUFFIX"
37811
><CODE
37812
CLASS="envar"
37813
>$PDFSUFFIX</CODE
37814
></A
37815
>.
37816
</P
37817
></DD
37818
><DT
37819
><A
37820
NAME="t-pdflatex"
37821
></A
37822
><TT
37823
CLASS="literal"
37824
>pdflatex</TT
37825
></DT
37826
><DD
37827
><P
37828
>&#13;Sets construction variables for the <SPAN
37829
CLASS="application"
37830
>pdflatex</SPAN
37831
> utility.
37832
</P
37833
><P
37834
>&#13;Sets:  <A
37835
HREF="#cv-LATEXRETRIES"
37836
><CODE
37837
CLASS="envar"
37838
>$LATEXRETRIES</CODE
37839
></A
37840
>, <A
37841
HREF="#cv-PDFLATEX"
37842
><CODE
37843
CLASS="envar"
37844
>$PDFLATEX</CODE
37845
></A
37846
>, <A
37847
HREF="#cv-PDFLATEXCOM"
37848
><CODE
37849
CLASS="envar"
37850
>$PDFLATEXCOM</CODE
37851
></A
37852
>, <A
37853
HREF="#cv-PDFLATEXFLAGS"
37854
><CODE
37855
CLASS="envar"
37856
>$PDFLATEXFLAGS</CODE
37857
></A
37858
>.
37859
</P
37860
><P
37861
>&#13;Uses:  <A
37862
HREF="#cv-PDFLATEXCOMSTR"
37863
><CODE
37864
CLASS="envar"
37865
>$PDFLATEXCOMSTR</CODE
37866
></A
37867
>.
37868
</P
37869
></DD
37870
><DT
37871
><A
37872
NAME="t-pdftex"
37873
></A
37874
><TT
37875
CLASS="literal"
37876
>pdftex</TT
37877
></DT
37878
><DD
37879
><P
37880
>&#13;Sets construction variables for the <SPAN
37881
CLASS="application"
37882
>pdftex</SPAN
37883
> utility.
37884
</P
37885
><P
37886
>&#13;Sets:  <A
37887
HREF="#cv-LATEXRETRIES"
37888
><CODE
37889
CLASS="envar"
37890
>$LATEXRETRIES</CODE
37891
></A
37892
>, <A
37893
HREF="#cv-PDFLATEX"
37894
><CODE
37895
CLASS="envar"
37896
>$PDFLATEX</CODE
37897
></A
37898
>, <A
37899
HREF="#cv-PDFLATEXCOM"
37900
><CODE
37901
CLASS="envar"
37902
>$PDFLATEXCOM</CODE
37903
></A
37904
>, <A
37905
HREF="#cv-PDFLATEXFLAGS"
37906
><CODE
37907
CLASS="envar"
37908
>$PDFLATEXFLAGS</CODE
37909
></A
37910
>, <A
37911
HREF="#cv-PDFTEX"
37912
><CODE
37913
CLASS="envar"
37914
>$PDFTEX</CODE
37915
></A
37916
>, <A
37917
HREF="#cv-PDFTEXCOM"
37918
><CODE
37919
CLASS="envar"
37920
>$PDFTEXCOM</CODE
37921
></A
37922
>, <A
37923
HREF="#cv-PDFTEXFLAGS"
37924
><CODE
37925
CLASS="envar"
37926
>$PDFTEXFLAGS</CODE
37927
></A
37928
>.
37929
</P
37930
><P
37931
>&#13;Uses:  <A
37932
HREF="#cv-PDFLATEXCOMSTR"
37933
><CODE
37934
CLASS="envar"
37935
>$PDFLATEXCOMSTR</CODE
37936
></A
37937
>, <A
37938
HREF="#cv-PDFTEXCOMSTR"
37939
><CODE
37940
CLASS="envar"
37941
>$PDFTEXCOMSTR</CODE
37942
></A
37943
>.
37944
</P
37945
></DD
37946
><DT
37947
><A
37948
NAME="t-Perforce"
37949
></A
37950
><TT
37951
CLASS="literal"
37952
>Perforce</TT
37953
></DT
37954
><DD
37955
><P
37956
>&#13;Sets construction variables for interacting with the
37957
Perforce source code management system.
37958
</P
37959
><P
37960
>&#13;Sets:  <A
37961
HREF="#cv-P4"
37962
><CODE
37963
CLASS="envar"
37964
>$P4</CODE
37965
></A
37966
>, <A
37967
HREF="#cv-P4COM"
37968
><CODE
37969
CLASS="envar"
37970
>$P4COM</CODE
37971
></A
37972
>, <A
37973
HREF="#cv-P4FLAGS"
37974
><CODE
37975
CLASS="envar"
37976
>$P4FLAGS</CODE
37977
></A
37978
>.
37979
</P
37980
><P
37981
>&#13;Uses:  <A
37982
HREF="#cv-P4COMSTR"
37983
><CODE
37984
CLASS="envar"
37985
>$P4COMSTR</CODE
37986
></A
37987
>.
37988
</P
37989
></DD
37990
><DT
37991
><A
37992
NAME="t-qt"
37993
></A
37994
><TT
37995
CLASS="literal"
37996
>qt</TT
37997
></DT
37998
><DD
37999
><P
38000
>&#13;Sets construction variables for building Qt applications.
38001
</P
38002
><P
38003
>&#13;Sets:  <A
38004
HREF="#cv-QTDIR"
38005
><CODE
38006
CLASS="envar"
38007
>$QTDIR</CODE
38008
></A
38009
>, <A
38010
HREF="#cv-QT_AUTOSCAN"
38011
><CODE
38012
CLASS="envar"
38013
>$QT_AUTOSCAN</CODE
38014
></A
38015
>, <A
38016
HREF="#cv-QT_BINPATH"
38017
><CODE
38018
CLASS="envar"
38019
>$QT_BINPATH</CODE
38020
></A
38021
>, <A
38022
HREF="#cv-QT_CPPPATH"
38023
><CODE
38024
CLASS="envar"
38025
>$QT_CPPPATH</CODE
38026
></A
38027
>, <A
38028
HREF="#cv-QT_LIB"
38029
><CODE
38030
CLASS="envar"
38031
>$QT_LIB</CODE
38032
></A
38033
>, <A
38034
HREF="#cv-QT_LIBPATH"
38035
><CODE
38036
CLASS="envar"
38037
>$QT_LIBPATH</CODE
38038
></A
38039
>, <A
38040
HREF="#cv-QT_MOC"
38041
><CODE
38042
CLASS="envar"
38043
>$QT_MOC</CODE
38044
></A
38045
>, <A
38046
HREF="#cv-QT_MOCCXXPREFIX"
38047
><CODE
38048
CLASS="envar"
38049
>$QT_MOCCXXPREFIX</CODE
38050
></A
38051
>, <A
38052
HREF="#cv-QT_MOCCXXSUFFIX"
38053
><CODE
38054
CLASS="envar"
38055
>$QT_MOCCXXSUFFIX</CODE
38056
></A
38057
>, <A
38058
HREF="#cv-QT_MOCFROMCXXCOM"
38059
><CODE
38060
CLASS="envar"
38061
>$QT_MOCFROMCXXCOM</CODE
38062
></A
38063
>, <A
38064
HREF="#cv-QT_MOCFROMCXXFLAGS"
38065
><CODE
38066
CLASS="envar"
38067
>$QT_MOCFROMCXXFLAGS</CODE
38068
></A
38069
>, <A
38070
HREF="#cv-QT_MOCFROMHCOM"
38071
><CODE
38072
CLASS="envar"
38073
>$QT_MOCFROMHCOM</CODE
38074
></A
38075
>, <A
38076
HREF="#cv-QT_MOCFROMHFLAGS"
38077
><CODE
38078
CLASS="envar"
38079
>$QT_MOCFROMHFLAGS</CODE
38080
></A
38081
>, <A
38082
HREF="#cv-QT_MOCHPREFIX"
38083
><CODE
38084
CLASS="envar"
38085
>$QT_MOCHPREFIX</CODE
38086
></A
38087
>, <A
38088
HREF="#cv-QT_MOCHSUFFIX"
38089
><CODE
38090
CLASS="envar"
38091
>$QT_MOCHSUFFIX</CODE
38092
></A
38093
>, <A
38094
HREF="#cv-QT_UIC"
38095
><CODE
38096
CLASS="envar"
38097
>$QT_UIC</CODE
38098
></A
38099
>, <A
38100
HREF="#cv-QT_UICCOM"
38101
><CODE
38102
CLASS="envar"
38103
>$QT_UICCOM</CODE
38104
></A
38105
>, <A
38106
HREF="#cv-QT_UICDECLFLAGS"
38107
><CODE
38108
CLASS="envar"
38109
>$QT_UICDECLFLAGS</CODE
38110
></A
38111
>, <A
38112
HREF="#cv-QT_UICDECLPREFIX"
38113
><CODE
38114
CLASS="envar"
38115
>$QT_UICDECLPREFIX</CODE
38116
></A
38117
>, <A
38118
HREF="#cv-QT_UICDECLSUFFIX"
38119
><CODE
38120
CLASS="envar"
38121
>$QT_UICDECLSUFFIX</CODE
38122
></A
38123
>, <A
38124
HREF="#cv-QT_UICIMPLFLAGS"
38125
><CODE
38126
CLASS="envar"
38127
>$QT_UICIMPLFLAGS</CODE
38128
></A
38129
>, <A
38130
HREF="#cv-QT_UICIMPLPREFIX"
38131
><CODE
38132
CLASS="envar"
38133
>$QT_UICIMPLPREFIX</CODE
38134
></A
38135
>, <A
38136
HREF="#cv-QT_UICIMPLSUFFIX"
38137
><CODE
38138
CLASS="envar"
38139
>$QT_UICIMPLSUFFIX</CODE
38140
></A
38141
>, <A
38142
HREF="#cv-QT_UISUFFIX"
38143
><CODE
38144
CLASS="envar"
38145
>$QT_UISUFFIX</CODE
38146
></A
38147
>.
38148
</P
38149
></DD
38150
><DT
38151
><A
38152
NAME="t-RCS"
38153
></A
38154
><TT
38155
CLASS="literal"
38156
>RCS</TT
38157
></DT
38158
><DD
38159
><P
38160
>&#13;Sets construction variables for the interaction
38161
with the Revision Control System.
38162
</P
38163
><P
38164
>&#13;Sets:  <A
38165
HREF="#cv-RCS"
38166
><CODE
38167
CLASS="envar"
38168
>$RCS</CODE
38169
></A
38170
>, <A
38171
HREF="#cv-RCS_CO"
38172
><CODE
38173
CLASS="envar"
38174
>$RCS_CO</CODE
38175
></A
38176
>, <A
38177
HREF="#cv-RCS_COCOM"
38178
><CODE
38179
CLASS="envar"
38180
>$RCS_COCOM</CODE
38181
></A
38182
>, <A
38183
HREF="#cv-RCS_COFLAGS"
38184
><CODE
38185
CLASS="envar"
38186
>$RCS_COFLAGS</CODE
38187
></A
38188
>.
38189
</P
38190
><P
38191
>&#13;Uses:  <A
38192
HREF="#cv-RCS_COCOMSTR"
38193
><CODE
38194
CLASS="envar"
38195
>$RCS_COCOMSTR</CODE
38196
></A
38197
>.
38198
</P
38199
></DD
38200
><DT
38201
><A
38202
NAME="t-rmic"
38203
></A
38204
><TT
38205
CLASS="literal"
38206
>rmic</TT
38207
></DT
38208
><DD
38209
><P
38210
>&#13;Sets construction variables for the <SPAN
38211
CLASS="application"
38212
>rmic</SPAN
38213
> utility.
38214
</P
38215
><P
38216
>&#13;Sets:  <A
38217
HREF="#cv-JAVACLASSSUFFIX"
38218
><CODE
38219
CLASS="envar"
38220
>$JAVACLASSSUFFIX</CODE
38221
></A
38222
>, <A
38223
HREF="#cv-RMIC"
38224
><CODE
38225
CLASS="envar"
38226
>$RMIC</CODE
38227
></A
38228
>, <A
38229
HREF="#cv-RMICCOM"
38230
><CODE
38231
CLASS="envar"
38232
>$RMICCOM</CODE
38233
></A
38234
>, <A
38235
HREF="#cv-RMICFLAGS"
38236
><CODE
38237
CLASS="envar"
38238
>$RMICFLAGS</CODE
38239
></A
38240
>.
38241
</P
38242
><P
38243
>&#13;Uses:  <A
38244
HREF="#cv-RMICCOMSTR"
38245
><CODE
38246
CLASS="envar"
38247
>$RMICCOMSTR</CODE
38248
></A
38249
>.
38250
</P
38251
></DD
38252
><DT
38253
><A
38254
NAME="t-rpcgen"
38255
></A
38256
><TT
38257
CLASS="literal"
38258
>rpcgen</TT
38259
></DT
38260
><DD
38261
><P
38262
>&#13;Sets construction variables for building with RPCGEN.
38263
</P
38264
><P
38265
>&#13;Sets:  <A
38266
HREF="#cv-RPCGEN"
38267
><CODE
38268
CLASS="envar"
38269
>$RPCGEN</CODE
38270
></A
38271
>, <A
38272
HREF="#cv-RPCGENCLIENTFLAGS"
38273
><CODE
38274
CLASS="envar"
38275
>$RPCGENCLIENTFLAGS</CODE
38276
></A
38277
>, <A
38278
HREF="#cv-RPCGENFLAGS"
38279
><CODE
38280
CLASS="envar"
38281
>$RPCGENFLAGS</CODE
38282
></A
38283
>, <A
38284
HREF="#cv-RPCGENHEADERFLAGS"
38285
><CODE
38286
CLASS="envar"
38287
>$RPCGENHEADERFLAGS</CODE
38288
></A
38289
>, <A
38290
HREF="#cv-RPCGENSERVICEFLAGS"
38291
><CODE
38292
CLASS="envar"
38293
>$RPCGENSERVICEFLAGS</CODE
38294
></A
38295
>, <A
38296
HREF="#cv-RPCGENXDRFLAGS"
38297
><CODE
38298
CLASS="envar"
38299
>$RPCGENXDRFLAGS</CODE
38300
></A
38301
>.
38302
</P
38303
></DD
38304
><DT
38305
><A
38306
NAME="t-SCCS"
38307
></A
38308
><TT
38309
CLASS="literal"
38310
>SCCS</TT
38311
></DT
38312
><DD
38313
><P
38314
>&#13;Sets construction variables for interacting with the
38315
Source Code Control System.
38316
</P
38317
><P
38318
>&#13;Sets:  <A
38319
HREF="#cv-SCCS"
38320
><CODE
38321
CLASS="envar"
38322
>$SCCS</CODE
38323
></A
38324
>, <A
38325
HREF="#cv-SCCSCOM"
38326
><CODE
38327
CLASS="envar"
38328
>$SCCSCOM</CODE
38329
></A
38330
>, <A
38331
HREF="#cv-SCCSFLAGS"
38332
><CODE
38333
CLASS="envar"
38334
>$SCCSFLAGS</CODE
38335
></A
38336
>, <A
38337
HREF="#cv-SCCSGETFLAGS"
38338
><CODE
38339
CLASS="envar"
38340
>$SCCSGETFLAGS</CODE
38341
></A
38342
>.
38343
</P
38344
><P
38345
>&#13;Uses:  <A
38346
HREF="#cv-SCCSCOMSTR"
38347
><CODE
38348
CLASS="envar"
38349
>$SCCSCOMSTR</CODE
38350
></A
38351
>.
38352
</P
38353
></DD
38354
><DT
38355
><A
38356
NAME="t-sgiar"
38357
></A
38358
><TT
38359
CLASS="literal"
38360
>sgiar</TT
38361
></DT
38362
><DD
38363
><P
38364
>&#13;Sets construction variables for the SGI library archiver.
38365
</P
38366
><P
38367
>&#13;Sets:  <A
38368
HREF="#cv-AR"
38369
><CODE
38370
CLASS="envar"
38371
>$AR</CODE
38372
></A
38373
>, <A
38374
HREF="#cv-ARCOMSTR"
38375
><CODE
38376
CLASS="envar"
38377
>$ARCOMSTR</CODE
38378
></A
38379
>, <A
38380
HREF="#cv-ARFLAGS"
38381
><CODE
38382
CLASS="envar"
38383
>$ARFLAGS</CODE
38384
></A
38385
>, <A
38386
HREF="#cv-LIBPREFIX"
38387
><CODE
38388
CLASS="envar"
38389
>$LIBPREFIX</CODE
38390
></A
38391
>, <A
38392
HREF="#cv-LIBSUFFIX"
38393
><CODE
38394
CLASS="envar"
38395
>$LIBSUFFIX</CODE
38396
></A
38397
>, <A
38398
HREF="#cv-SHLINK"
38399
><CODE
38400
CLASS="envar"
38401
>$SHLINK</CODE
38402
></A
38403
>, <A
38404
HREF="#cv-SHLINKFLAGS"
38405
><CODE
38406
CLASS="envar"
38407
>$SHLINKFLAGS</CODE
38408
></A
38409
>.
38410
</P
38411
><P
38412
>&#13;Uses:  <A
38413
HREF="#cv-ARCOMSTR"
38414
><CODE
38415
CLASS="envar"
38416
>$ARCOMSTR</CODE
38417
></A
38418
>, <A
38419
HREF="#cv-SHLINKCOMSTR"
38420
><CODE
38421
CLASS="envar"
38422
>$SHLINKCOMSTR</CODE
38423
></A
38424
>.
38425
</P
38426
></DD
38427
><DT
38428
><A
38429
NAME="t-sgicXX"
38430
></A
38431
><TT
38432
CLASS="literal"
38433
>sgic++</TT
38434
></DT
38435
><DD
38436
><P
38437
>&#13;Sets construction variables for the SGI C++ compiler.
38438
</P
38439
><P
38440
>&#13;Sets:  <A
38441
HREF="#cv-CXX"
38442
><CODE
38443
CLASS="envar"
38444
>$CXX</CODE
38445
></A
38446
>, <A
38447
HREF="#cv-CXXFLAGS"
38448
><CODE
38449
CLASS="envar"
38450
>$CXXFLAGS</CODE
38451
></A
38452
>, <A
38453
HREF="#cv-SHCXX"
38454
><CODE
38455
CLASS="envar"
38456
>$SHCXX</CODE
38457
></A
38458
>, <A
38459
HREF="#cv-SHOBJSUFFIX"
38460
><CODE
38461
CLASS="envar"
38462
>$SHOBJSUFFIX</CODE
38463
></A
38464
>.
38465
</P
38466
></DD
38467
><DT
38468
><A
38469
NAME="t-sgicc"
38470
></A
38471
><TT
38472
CLASS="literal"
38473
>sgicc</TT
38474
></DT
38475
><DD
38476
><P
38477
>&#13;Sets construction variables for the SGI C compiler.
38478
</P
38479
><P
38480
>&#13;Sets:  <A
38481
HREF="#cv-CXX"
38482
><CODE
38483
CLASS="envar"
38484
>$CXX</CODE
38485
></A
38486
>, <A
38487
HREF="#cv-SHOBJSUFFIX"
38488
><CODE
38489
CLASS="envar"
38490
>$SHOBJSUFFIX</CODE
38491
></A
38492
>.
38493
</P
38494
></DD
38495
><DT
38496
><A
38497
NAME="t-sgilink"
38498
></A
38499
><TT
38500
CLASS="literal"
38501
>sgilink</TT
38502
></DT
38503
><DD
38504
><P
38505
>&#13;Sets construction variables for the SGI linker.
38506
</P
38507
><P
38508
>&#13;Sets:  <A
38509
HREF="#cv-LINK"
38510
><CODE
38511
CLASS="envar"
38512
>$LINK</CODE
38513
></A
38514
>, <A
38515
HREF="#cv-RPATHPREFIX"
38516
><CODE
38517
CLASS="envar"
38518
>$RPATHPREFIX</CODE
38519
></A
38520
>, <A
38521
HREF="#cv-RPATHSUFFIX"
38522
><CODE
38523
CLASS="envar"
38524
>$RPATHSUFFIX</CODE
38525
></A
38526
>, <A
38527
HREF="#cv-SHLINKFLAGS"
38528
><CODE
38529
CLASS="envar"
38530
>$SHLINKFLAGS</CODE
38531
></A
38532
>.
38533
</P
38534
></DD
38535
><DT
38536
><A
38537
NAME="t-sunar"
38538
></A
38539
><TT
38540
CLASS="literal"
38541
>sunar</TT
38542
></DT
38543
><DD
38544
><P
38545
>&#13;Sets construction variables for the Sun library archiver.
38546
</P
38547
><P
38548
>&#13;Sets:  <A
38549
HREF="#cv-AR"
38550
><CODE
38551
CLASS="envar"
38552
>$AR</CODE
38553
></A
38554
>, <A
38555
HREF="#cv-ARCOM"
38556
><CODE
38557
CLASS="envar"
38558
>$ARCOM</CODE
38559
></A
38560
>, <A
38561
HREF="#cv-ARFLAGS"
38562
><CODE
38563
CLASS="envar"
38564
>$ARFLAGS</CODE
38565
></A
38566
>, <A
38567
HREF="#cv-LIBPREFIX"
38568
><CODE
38569
CLASS="envar"
38570
>$LIBPREFIX</CODE
38571
></A
38572
>, <A
38573
HREF="#cv-LIBSUFFIX"
38574
><CODE
38575
CLASS="envar"
38576
>$LIBSUFFIX</CODE
38577
></A
38578
>, <A
38579
HREF="#cv-SHLINK"
38580
><CODE
38581
CLASS="envar"
38582
>$SHLINK</CODE
38583
></A
38584
>, <A
38585
HREF="#cv-SHLINKCOM"
38586
><CODE
38587
CLASS="envar"
38588
>$SHLINKCOM</CODE
38589
></A
38590
>, <A
38591
HREF="#cv-SHLINKFLAGS"
38592
><CODE
38593
CLASS="envar"
38594
>$SHLINKFLAGS</CODE
38595
></A
38596
>.
38597
</P
38598
><P
38599
>&#13;Uses:  <A
38600
HREF="#cv-ARCOMSTR"
38601
><CODE
38602
CLASS="envar"
38603
>$ARCOMSTR</CODE
38604
></A
38605
>, <A
38606
HREF="#cv-SHLINKCOMSTR"
38607
><CODE
38608
CLASS="envar"
38609
>$SHLINKCOMSTR</CODE
38610
></A
38611
>.
38612
</P
38613
></DD
38614
><DT
38615
><A
38616
NAME="t-suncXX"
38617
></A
38618
><TT
38619
CLASS="literal"
38620
>sunc++</TT
38621
></DT
38622
><DD
38623
><P
38624
>&#13;Sets construction variables for the Sun C++ compiler.
38625
</P
38626
><P
38627
>&#13;Sets:  <A
38628
HREF="#cv-CXX"
38629
><CODE
38630
CLASS="envar"
38631
>$CXX</CODE
38632
></A
38633
>, <A
38634
HREF="#cv-CXXVERSION"
38635
><CODE
38636
CLASS="envar"
38637
>$CXXVERSION</CODE
38638
></A
38639
>, <A
38640
HREF="#cv-SHCXX"
38641
><CODE
38642
CLASS="envar"
38643
>$SHCXX</CODE
38644
></A
38645
>, <A
38646
HREF="#cv-SHCXXFLAGS"
38647
><CODE
38648
CLASS="envar"
38649
>$SHCXXFLAGS</CODE
38650
></A
38651
>, <A
38652
HREF="#cv-SHOBJPREFIX"
38653
><CODE
38654
CLASS="envar"
38655
>$SHOBJPREFIX</CODE
38656
></A
38657
>, <A
38658
HREF="#cv-SHOBJSUFFIX"
38659
><CODE
38660
CLASS="envar"
38661
>$SHOBJSUFFIX</CODE
38662
></A
38663
>.
38664
</P
38665
></DD
38666
><DT
38667
><A
38668
NAME="t-suncc"
38669
></A
38670
><TT
38671
CLASS="literal"
38672
>suncc</TT
38673
></DT
38674
><DD
38675
><P
38676
>&#13;Sets construction variables for the Sun C compiler.
38677
</P
38678
><P
38679
>&#13;Sets:  <A
38680
HREF="#cv-CXX"
38681
><CODE
38682
CLASS="envar"
38683
>$CXX</CODE
38684
></A
38685
>, <A
38686
HREF="#cv-SHCCFLAGS"
38687
><CODE
38688
CLASS="envar"
38689
>$SHCCFLAGS</CODE
38690
></A
38691
>, <A
38692
HREF="#cv-SHOBJPREFIX"
38693
><CODE
38694
CLASS="envar"
38695
>$SHOBJPREFIX</CODE
38696
></A
38697
>, <A
38698
HREF="#cv-SHOBJSUFFIX"
38699
><CODE
38700
CLASS="envar"
38701
>$SHOBJSUFFIX</CODE
38702
></A
38703
>.
38704
</P
38705
></DD
38706
><DT
38707
><A
38708
NAME="t-sunlink"
38709
></A
38710
><TT
38711
CLASS="literal"
38712
>sunlink</TT
38713
></DT
38714
><DD
38715
><P
38716
>&#13;Sets construction variables for the Sun linker.
38717
</P
38718
><P
38719
>&#13;Sets:  <A
38720
HREF="#cv-RPATHPREFIX"
38721
><CODE
38722
CLASS="envar"
38723
>$RPATHPREFIX</CODE
38724
></A
38725
>, <A
38726
HREF="#cv-RPATHSUFFIX"
38727
><CODE
38728
CLASS="envar"
38729
>$RPATHSUFFIX</CODE
38730
></A
38731
>, <A
38732
HREF="#cv-SHLINKFLAGS"
38733
><CODE
38734
CLASS="envar"
38735
>$SHLINKFLAGS</CODE
38736
></A
38737
>.
38738
</P
38739
></DD
38740
><DT
38741
><A
38742
NAME="t-swig"
38743
></A
38744
><TT
38745
CLASS="literal"
38746
>swig</TT
38747
></DT
38748
><DD
38749
><P
38750
>&#13;Sets construction variables for the SWIG interface generator.
38751
</P
38752
><P
38753
>&#13;Sets:  <A
38754
HREF="#cv-SWIG"
38755
><CODE
38756
CLASS="envar"
38757
>$SWIG</CODE
38758
></A
38759
>, <A
38760
HREF="#cv-SWIGCFILESUFFIX"
38761
><CODE
38762
CLASS="envar"
38763
>$SWIGCFILESUFFIX</CODE
38764
></A
38765
>, <A
38766
HREF="#cv-SWIGCOM"
38767
><CODE
38768
CLASS="envar"
38769
>$SWIGCOM</CODE
38770
></A
38771
>, <A
38772
HREF="#cv-SWIGCXXFILESUFFIX"
38773
><CODE
38774
CLASS="envar"
38775
>$SWIGCXXFILESUFFIX</CODE
38776
></A
38777
>, <A
38778
HREF="#cv-SWIGFLAGS"
38779
><CODE
38780
CLASS="envar"
38781
>$SWIGFLAGS</CODE
38782
></A
38783
>, <A
38784
HREF="#cv-SWIGINCPREFIX"
38785
><CODE
38786
CLASS="envar"
38787
>$SWIGINCPREFIX</CODE
38788
></A
38789
>, <A
38790
HREF="#cv-SWIGINCSUFFIX"
38791
><CODE
38792
CLASS="envar"
38793
>$SWIGINCSUFFIX</CODE
38794
></A
38795
>, <A
38796
HREF="#cv-SWIGPATH"
38797
><CODE
38798
CLASS="envar"
38799
>$SWIGPATH</CODE
38800
></A
38801
>, <A
38802
HREF="#cv-_SWIGINCFLAGS"
38803
><CODE
38804
CLASS="envar"
38805
>$_SWIGINCFLAGS</CODE
38806
></A
38807
>.
38808
</P
38809
><P
38810
>&#13;Uses:  <A
38811
HREF="#cv-SWIGCOMSTR"
38812
><CODE
38813
CLASS="envar"
38814
>$SWIGCOMSTR</CODE
38815
></A
38816
>.
38817
</P
38818
></DD
38819
><DT
38820
><A
38821
NAME="t-tar"
38822
></A
38823
><TT
38824
CLASS="literal"
38825
>tar</TT
38826
></DT
38827
><DD
38828
><P
38829
>&#13;Sets construction variables for the <SPAN
38830
CLASS="application"
38831
>tar</SPAN
38832
> archiver.
38833
</P
38834
><P
38835
>&#13;Sets:  <A
38836
HREF="#cv-TAR"
38837
><CODE
38838
CLASS="envar"
38839
>$TAR</CODE
38840
></A
38841
>, <A
38842
HREF="#cv-TARCOM"
38843
><CODE
38844
CLASS="envar"
38845
>$TARCOM</CODE
38846
></A
38847
>, <A
38848
HREF="#cv-TARFLAGS"
38849
><CODE
38850
CLASS="envar"
38851
>$TARFLAGS</CODE
38852
></A
38853
>, <A
38854
HREF="#cv-TARSUFFIX"
38855
><CODE
38856
CLASS="envar"
38857
>$TARSUFFIX</CODE
38858
></A
38859
>.
38860
</P
38861
><P
38862
>&#13;Uses:  <A
38863
HREF="#cv-TARCOMSTR"
38864
><CODE
38865
CLASS="envar"
38866
>$TARCOMSTR</CODE
38867
></A
38868
>.
38869
</P
38870
></DD
38871
><DT
38872
><A
38873
NAME="t-tex"
38874
></A
38875
><TT
38876
CLASS="literal"
38877
>tex</TT
38878
></DT
38879
><DD
38880
><P
38881
>&#13;Sets construction variables for the TeX formatter and typesetter.
38882
</P
38883
><P
38884
>&#13;Sets:  <A
38885
HREF="#cv-BIBTEX"
38886
><CODE
38887
CLASS="envar"
38888
>$BIBTEX</CODE
38889
></A
38890
>, <A
38891
HREF="#cv-BIBTEXCOM"
38892
><CODE
38893
CLASS="envar"
38894
>$BIBTEXCOM</CODE
38895
></A
38896
>, <A
38897
HREF="#cv-BIBTEXFLAGS"
38898
><CODE
38899
CLASS="envar"
38900
>$BIBTEXFLAGS</CODE
38901
></A
38902
>, <A
38903
HREF="#cv-LATEX"
38904
><CODE
38905
CLASS="envar"
38906
>$LATEX</CODE
38907
></A
38908
>, <A
38909
HREF="#cv-LATEXCOM"
38910
><CODE
38911
CLASS="envar"
38912
>$LATEXCOM</CODE
38913
></A
38914
>, <A
38915
HREF="#cv-LATEXFLAGS"
38916
><CODE
38917
CLASS="envar"
38918
>$LATEXFLAGS</CODE
38919
></A
38920
>, <A
38921
HREF="#cv-MAKEINDEX"
38922
><CODE
38923
CLASS="envar"
38924
>$MAKEINDEX</CODE
38925
></A
38926
>, <A
38927
HREF="#cv-MAKEINDEXCOM"
38928
><CODE
38929
CLASS="envar"
38930
>$MAKEINDEXCOM</CODE
38931
></A
38932
>, <A
38933
HREF="#cv-MAKEINDEXFLAGS"
38934
><CODE
38935
CLASS="envar"
38936
>$MAKEINDEXFLAGS</CODE
38937
></A
38938
>, <A
38939
HREF="#cv-TEX"
38940
><CODE
38941
CLASS="envar"
38942
>$TEX</CODE
38943
></A
38944
>, <A
38945
HREF="#cv-TEXCOM"
38946
><CODE
38947
CLASS="envar"
38948
>$TEXCOM</CODE
38949
></A
38950
>, <A
38951
HREF="#cv-TEXFLAGS"
38952
><CODE
38953
CLASS="envar"
38954
>$TEXFLAGS</CODE
38955
></A
38956
>.
38957
</P
38958
><P
38959
>&#13;Uses:  <A
38960
HREF="#cv-BIBTEXCOMSTR"
38961
><CODE
38962
CLASS="envar"
38963
>$BIBTEXCOMSTR</CODE
38964
></A
38965
>, <A
38966
HREF="#cv-LATEXCOMSTR"
38967
><CODE
38968
CLASS="envar"
38969
>$LATEXCOMSTR</CODE
38970
></A
38971
>, <A
38972
HREF="#cv-MAKEINDEXCOMSTR"
38973
><CODE
38974
CLASS="envar"
38975
>$MAKEINDEXCOMSTR</CODE
38976
></A
38977
>, <A
38978
HREF="#cv-TEXCOMSTR"
38979
><CODE
38980
CLASS="envar"
38981
>$TEXCOMSTR</CODE
38982
></A
38983
>.
38984
</P
38985
></DD
38986
><DT
38987
><A
38988
NAME="t-tlib"
38989
></A
38990
><TT
38991
CLASS="literal"
38992
>tlib</TT
38993
></DT
38994
><DD
38995
><P
38996
>&#13;Sets construction variables for the Borlan
38997
<SPAN
38998
CLASS="application"
38999
>tib</SPAN
39000
> library archiver.
39001
</P
39002
><P
39003
>&#13;Sets:  <A
39004
HREF="#cv-AR"
39005
><CODE
39006
CLASS="envar"
39007
>$AR</CODE
39008
></A
39009
>, <A
39010
HREF="#cv-ARCOM"
39011
><CODE
39012
CLASS="envar"
39013
>$ARCOM</CODE
39014
></A
39015
>, <A
39016
HREF="#cv-ARFLAGS"
39017
><CODE
39018
CLASS="envar"
39019
>$ARFLAGS</CODE
39020
></A
39021
>, <A
39022
HREF="#cv-LIBPREFIX"
39023
><CODE
39024
CLASS="envar"
39025
>$LIBPREFIX</CODE
39026
></A
39027
>, <A
39028
HREF="#cv-LIBSUFFIX"
39029
><CODE
39030
CLASS="envar"
39031
>$LIBSUFFIX</CODE
39032
></A
39033
>.
39034
</P
39035
><P
39036
>&#13;Uses:  <A
39037
HREF="#cv-ARCOMSTR"
39038
><CODE
39039
CLASS="envar"
39040
>$ARCOMSTR</CODE
39041
></A
39042
>.
39043
</P
39044
></DD
39045
><DT
39046
><A
39047
NAME="t-yacc"
39048
></A
39049
><TT
39050
CLASS="literal"
39051
>yacc</TT
39052
></DT
39053
><DD
39054
><P
39055
>&#13;Sets construction variables for the <SPAN
39056
CLASS="application"
39057
>yacc</SPAN
39058
> parse generator.
39059
</P
39060
><P
39061
>&#13;Sets:  <A
39062
HREF="#cv-YACC"
39063
><CODE
39064
CLASS="envar"
39065
>$YACC</CODE
39066
></A
39067
>, <A
39068
HREF="#cv-YACCCOM"
39069
><CODE
39070
CLASS="envar"
39071
>$YACCCOM</CODE
39072
></A
39073
>, <A
39074
HREF="#cv-YACCFLAGS"
39075
><CODE
39076
CLASS="envar"
39077
>$YACCFLAGS</CODE
39078
></A
39079
>, <A
39080
HREF="#cv-YACCHFILESUFFIX"
39081
><CODE
39082
CLASS="envar"
39083
>$YACCHFILESUFFIX</CODE
39084
></A
39085
>, <A
39086
HREF="#cv-YACCHXXFILESUFFIX"
39087
><CODE
39088
CLASS="envar"
39089
>$YACCHXXFILESUFFIX</CODE
39090
></A
39091
>, <A
39092
HREF="#cv-YACCVCGFILESUFFIX"
39093
><CODE
39094
CLASS="envar"
39095
>$YACCVCGFILESUFFIX</CODE
39096
></A
39097
>.
39098
</P
39099
><P
39100
>&#13;Uses:  <A
39101
HREF="#cv-YACCCOMSTR"
39102
><CODE
39103
CLASS="envar"
39104
>$YACCCOMSTR</CODE
39105
></A
39106
>.
39107
</P
39108
></DD
39109
><DT
39110
><A
39111
NAME="t-zip"
39112
></A
39113
><TT
39114
CLASS="literal"
39115
>zip</TT
39116
></DT
39117
><DD
39118
><P
39119
>&#13;Sets construction variables for the <SPAN
39120
CLASS="application"
39121
>zip</SPAN
39122
> archiver.
39123
</P
39124
><P
39125
>&#13;Sets:  <A
39126
HREF="#cv-ZIP"
39127
><CODE
39128
CLASS="envar"
39129
>$ZIP</CODE
39130
></A
39131
>, <A
39132
HREF="#cv-ZIPCOM"
39133
><CODE
39134
CLASS="envar"
39135
>$ZIPCOM</CODE
39136
></A
39137
>, <A
39138
HREF="#cv-ZIPCOMPRESSION"
39139
><CODE
39140
CLASS="envar"
39141
>$ZIPCOMPRESSION</CODE
39142
></A
39143
>, <A
39144
HREF="#cv-ZIPFLAGS"
39145
><CODE
39146
CLASS="envar"
39147
>$ZIPFLAGS</CODE
39148
></A
39149
>, <A
39150
HREF="#cv-ZIPSUFFIX"
39151
><CODE
39152
CLASS="envar"
39153
>$ZIPSUFFIX</CODE
39154
></A
39155
>.
39156
</P
39157
><P
39158
>&#13;Uses:  <A
39159
HREF="#cv-ZIPCOMSTR"
39160
><CODE
39161
CLASS="envar"
39162
>$ZIPCOMSTR</CODE
39163
></A
39164
>.
39165
</P
39166
></DD
39167
></DL
39168
></DIV
39169
></DIV
39170
><DIV
39171
CLASS="appendix"
39172
><HR><H1
39173
><A
39174
NAME="app-tasks"
39175
></A
39176
>Appendix D. Handling Common Tasks</H1
39177
><P
39178
>&#13;There is a common set of simple tasks that many build configurations rely
39179
on as they become more complex. Most build tools have special
39180
purpose constructs for performing these tasks, but since <TT
39181
CLASS="filename"
39182
>SConscript</TT
39183
>
39184
files are <SPAN
39185
CLASS="application"
39186
>Python</SPAN
39187
> scripts, you can use more flexible built-in <SPAN
39188
CLASS="application"
39189
>Python</SPAN
39190
>
39191
services to perform these tasks. This appendix lists a number of these
39192
tasks and how to implement them in <SPAN
39193
CLASS="application"
39194
>Python</SPAN
39195
>.
39196
</P
39197
><DIV
39198
CLASS="example"
39199
><A
39200
NAME="AEN9591"
39201
></A
39202
><P
39203
><B
39204
>Example D-1. Wildcard globbing to create a list of filenames</B
39205
></P
39206
><PRE
39207
CLASS="programlisting"
39208
>&#13;import glob
39209
files = glob.glob(wildcard)
39210
</PRE
39211
></DIV
39212
><DIV
39213
CLASS="example"
39214
><A
39215
NAME="AEN9594"
39216
></A
39217
><P
39218
><B
39219
>Example D-2. Filename extension substitution</B
39220
></P
39221
><PRE
39222
CLASS="programlisting"
39223
>&#13;import os.path
39224
filename = os.path.splitext(filename)[0]+extension
39225
</PRE
39226
></DIV
39227
><DIV
39228
CLASS="example"
39229
><A
39230
NAME="AEN9597"
39231
></A
39232
><P
39233
><B
39234
>Example D-3. Appending a path prefix to a list of filenames</B
39235
></P
39236
><PRE
39237
CLASS="programlisting"
39238
>&#13;import os.path
39239
filenames = [os.path.join(prefix, x) for x in filenames]
39240
</PRE
39241
><P
39242
>or in Python 1.5.2:</P
39243
><PRE
39244
CLASS="programlisting"
39245
>&#13;import os.path
39246
new_filenames = [] 
39247
for x in filenames:
39248
    new_filenames.append(os.path.join(prefix, x))
39249
</PRE
39250
></DIV
39251
><DIV
39252
CLASS="example"
39253
><A
39254
NAME="AEN9602"
39255
></A
39256
><P
39257
><B
39258
>Example D-4. Substituting a path prefix with another one</B
39259
></P
39260
><PRE
39261
CLASS="programlisting"
39262
>&#13;if filename.find(old_prefix) == 0:
39263
    filename = filename.replace(old_prefix, new_prefix)
39264
</PRE
39265
><P
39266
>or in Python 1.5.2:</P
39267
><PRE
39268
CLASS="programlisting"
39269
>&#13;import string
39270
if string.find(filename, old_prefix) == 0:
39271
    filename = string.replace(filename, old_prefix, new_prefix)      
39272
</PRE
39273
></DIV
39274
><DIV
39275
CLASS="example"
39276
><A
39277
NAME="AEN9607"
39278
></A
39279
><P
39280
><B
39281
>Example D-5. Filtering a filename list to exclude/retain only a specific set
39282
of extensions</B
39283
></P
39284
><PRE
39285
CLASS="programlisting"
39286
>&#13;import os.path
39287
filenames = [x for x in filenames if os.path.splitext(x)[1] in extensions]
39288
</PRE
39289
><P
39290
>or in Python 1.5.2:</P
39291
><PRE
39292
CLASS="programlisting"
39293
>&#13;import os.path
39294
new_filenames = []
39295
for x in filenames:
39296
    if os.path.splitext(x)[1] in extensions:
39297
        new_filenames.append(x)
39298
</PRE
39299
></DIV
39300
><DIV
39301
CLASS="example"
39302
><A
39303
NAME="AEN9612"
39304
></A
39305
><P
39306
><B
39307
>Example D-6. The "backtick function": run a shell command and capture the
39308
output</B
39309
></P
39310
><PRE
39311
CLASS="programlisting"
39312
>import os
39313
output = os.popen(command).read()
39314
</PRE
39315
></DIV
39316
></DIV
39317
></DIV
39318
><H3
39319
CLASS="FOOTNOTES"
39320
>Notes</H3
39321
><TABLE
39322
BORDER="0"
39323
CLASS="FOOTNOTES"
39324
WIDTH="100%"
39325
><TR
39326
><TD
39327
ALIGN="LEFT"
39328
VALIGN="TOP"
39329
WIDTH="5%"
39330
><A
39331
NAME="FTN.AEN380"
39332
HREF="#AEN380"
39333
><SPAN
39334
CLASS="footnote"
39335
>[1]</SPAN
39336
></A
39337
></TD
39338
><TD
39339
ALIGN="LEFT"
39340
VALIGN="TOP"
39341
WIDTH="95%"
39342
><P
39343
>In programming parlance,
39344
     the <TT
39345
CLASS="filename"
39346
>SConstruct</TT
39347
> file is
39348
     <SPAN
39349
CLASS="emphasis"
39350
><I
39351
CLASS="emphasis"
39352
>declarative</I
39353
></SPAN
39354
>,
39355
     meaning you tell <SPAN
39356
CLASS="application"
39357
>SCons</SPAN
39358
> what you want done
39359
     and let it figure out the order in which to do it,
39360
     rather than strictly <SPAN
39361
CLASS="emphasis"
39362
><I
39363
CLASS="emphasis"
39364
>imperative</I
39365
></SPAN
39366
>,
39367
     where you specify explicitly the order in
39368
     which to do things.
39369
     </P
39370
></TD
39371
></TR
39372
><TR
39373
><TD
39374
ALIGN="LEFT"
39375
VALIGN="TOP"
39376
WIDTH="5%"
39377
><A
39378
NAME="FTN.AEN983"
39379
HREF="#AEN983"
39380
><SPAN
39381
CLASS="footnote"
39382
>[2]</SPAN
39383
></A
39384
></TD
39385
><TD
39386
ALIGN="LEFT"
39387
VALIGN="TOP"
39388
WIDTH="95%"
39389
><P
39390
>&#13;      This easily-overlooked distinction between
39391
      how <SPAN
39392
CLASS="application"
39393
>SCons</SPAN
39394
> decides if the target itself must be rebuilt
39395
      and how the target is then used to decide if a different
39396
      target must be rebuilt is one of the confusing
39397
      things that has led to the <CODE
39398
CLASS="function"
39399
>TargetSignatures</CODE
39400
>
39401
      and <CODE
39402
CLASS="function"
39403
>SourceSignatures</CODE
39404
> functions being
39405
      replaced by the simpler <CODE
39406
CLASS="function"
39407
>Decider</CODE
39408
> function.
39409
      </P
39410
></TD
39411
></TR
39412
><TR
39413
><TD
39414
ALIGN="LEFT"
39415
VALIGN="TOP"
39416
WIDTH="5%"
39417
><A
39418
NAME="FTN.AEN3111"
39419
HREF="#AEN3111"
39420
><SPAN
39421
CLASS="footnote"
39422
>[3]</SPAN
39423
></A
39424
></TD
39425
><TD
39426
ALIGN="LEFT"
39427
VALIGN="TOP"
39428
WIDTH="95%"
39429
><P
39430
>&#13;      Actually, the MD5 signature is used as the name of the file
39431
      in the shared cache directory in which the contents are stored.
39432
      </P
39433
></TD
39434
></TR
39435
></TABLE
39436
></BODY
39437
></HTML
39438
>