www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - SCons bugfix - dmd.py

Hi all.

I use scons to build my d project. There are several bugs was found during usage
(LIBPATH didn't work, linker fail if not default compiler options was set). So,
here my first mite for D community: fixed dmd.py file. Hope it will be useful to
somebody.

I'll e-mail modifications to scons author tommorow, maybe it will avaible as
builtin file in future version.


begin 0644 dmd.py
M(B(B4T-O;G,N5&]O;"YD;60*"E1O;VPM<W!E8VEF:6, :6YI=&EA;&EZ871I
M;VX 9F]R('1H92!$:6=I=&%L($UA<G, 1"!C;VUP:6QE<BX**&AT='`Z+R]D
M:6=I=&%L;6%R<RYC;VTO9"D*"D-O9&5D(&)Y($%N9'D 1G)I97-E;B`H86YD
M>4!I:V%G86UE<RYC;VTI"C$U($YO=F5M8F5R(#(P,#,*"D)U9V9I>&5S. H)
M+2!&:7AE9"!B=6< =VET:"!,24)0051(('=A<R!I9VYO<F5D+ H)("!B>2!6
M:6-T;W( *&%K82!N86EL*2!.86MO<GEA:V]V.R`X(&9E8G)U<F%R>2`R,#`U
M" DM($9I>&5D(&)U9R!W:71H(&QI;FL 9F%I;'1U<F4 :68 1$9,04=3('=A
M<VXG="!E;7!T>0H)("!B>2!6:6-T;W( *&%K82!N86EL*2!.86MO<GEA:V]V
M.R`X(&9E8G)U<F%R>2`R,#`U" I#;VUP:6QE<B!V87)I86)L97,Z"B` ("!$
M0R`M(%1H92!N86UE(&]F('1H92!$(&-O;7!I;&5R('1O('5S92X ($1E9F%U
M;'1S('1O(&1M9"X*("` ($10051(("T 3&ES="!O9B!P871H<R!T;R!S96%R
M8V  9F]R(&EM<&]R="!M;V1U;&5S+ H ("` 1%9%4E-)3TY3("T 3&ES="!O
M9B!V97)S:6]N('1A9W, =&\ 96YA8FQE('=H96X 8V]M<&EL:6YG+ H ("` 
M1$1%0E5'("T 3&ES="!O9B!D96)U9R!T86=S('1O(&5N86)L92!W:&5N(&-O
M;7!I;&EN9RX*"DQI;FME<B!R96QA=&5D('9A<FEA8FQE<SH*("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D('1O(&1O('-O
M+"!S=6)J96-T('1O"B, =&AE(&9O;&QO=VEN9R!C;VYD:71I;VYS. HC"B, 
M5&AE(&%B;W9E(&-O<'ER:6=H="!N;W1I8V4 86YD('1H:7, <&5R;6ES<VEO
M;B!N;W1I8V4 <VAA;&P 8F4 :6YC;'5D960*(R!I;B!A;&P 8V]P:65S(&]R
M('-U8G-T86YT:6%L('!O<G1I;VYS(&]F('1H92!3;V9T=V%R92X*(PHC(%1(
M12!33T945T%212!)4R!04D]6241%1"`B05, 25,B+"!7251(3U54(%=!4E)!
M3E19($]&($%.60HC($M)3D0L($584%)%4U, 3U( 24U03$E%1"P 24Y#3%5$
M24Y'($)55"!.3U0 3$E-251%1"!43R!42$4*(R!705)204Y42453($]&($U%
M4D-(04Y404))3$E462P 1DE43D534R!&3U( 02!005)424-53$%2(%!54E!/
M4T4 04Y$"B, 3D].24Y&4DE.1T5-14Y4+B!)3B!.3R!%5D5.5"!32$%,3"!4
M2$4 05542$]24R!/4B!#3U!94DE'2%0 2$],1$524R!"10HC($Q)04),12!&
M3U( 04Y9($-,04E-+"!$04U!1T53($]2($]42$52($Q)04))3$E462P 5TA%
M5$A%4B!)3B!!3B!!0U1)3TX*(R!/1B!#3TY44D%#5"P 5$]25"!/4B!/5$A%
M4E=)4T4L($%225-)3D< 1E)/32P 3U54($]&($]2($E.($-/3DY%0U1)3TX*
M(R!7251((%1(12!33T945T%212!/4B!42$4 55-%($]2($]42$52($1%04Q)
M3D=3($E.(%1(12!33T945T%212X*(PH*7U]R979I<VEO;E]?(#T (B]H;VUE
M+W-C;VYS+W-C;VYS+V)R86YC:"XP+V)A<V5L:6YE+W-R8R]E;F=I;F4O4T-O
M;G,O5&]O;"]D;60N<'D ,"XY-BXQ+D0P,#$ ,C`P-"\P."\R,R`P.3HU-3HR
M.2!K;FEG:'0B" II;7!O<G0 ;W,*:6UP;W)T('-T<FEN9PH*:6UP;W)T(%-#
M;VYS+E1O;VP*:6UP;W)T(%-#;VYS+E-C86YN97(N1`II;7!O<G0 4T-O;G,N
M0G5I;&1E< II;7!O<G0 4T-O;G,N1&5F875L=',*:6UP;W)T(%-#;VYS+E5T
M:6P*"B, 061A<'1E9"!F<F]M(&,K*RYP>0ID968 :7-$*'-O=7)C92DZ"B` 
M("!I9B!N;W0 <V]U<F-E. H ("` ("` (')E='5R;B`P" H ("` 9F]R(', 
M:6X <V]U<F-E. H ("` ("` (&EF(',N<V]U<F-E<SH*("` ("` ("` ("` 
M97AT(#T ;W,N<&%T:"YS<&QI=&5X="AS='(H<RYS;W5R8V5S6S!=*2E;,5T*
M("` ("` ("` ("` :68 97AT(#T]("<N9"<Z"B` ("` ("` ("` ("` ("!R
M971U<FX ,0H ("` <F5T=7)N(#`*"G-M87)T7VQI;FL /2![?0H*<VUA<G1?
M;&EB(#T >WT*"F1E9B!D3&EB<RAT87)G970L('-O=7)C92P 96YV+"!F;W)?
M<VEG;F%T=7)E*3H*("` ("(B(E-E87)C:"!L:6)S(&EN($Q)0E!!5$ L(&EF
M(&YO="!F;W5N9"!R96QY(&]N(&QI;FME<BXB(B(*("` (')E="`](%M=" H 
M("` :68 ;F]T(&5N=BYH87-?:V5Y*"=,24)0051()RD ;W( ;F]T(&5N=BYH
M87-?:V5Y*"=,24)3)RDZ"B` ("` ("` <F5T=7)N(')E=`H*("` (&9O<B!L
M:6( :6X 96YV6R=,24)3)UTZ"B` ("` ("` ;&EB9FYA;64 /2!E;G9;)T1,
M24),24Y+4%)%1DE8)UT *R!L:6( *R!E;G9;)T1,24),24Y+4U5&1DE8)UT*
M("` ("` ("!L:6)P871H(#T 96YV+D9I;F1&:6QE*&QI8F9N86UE+"!E;G9;
M)TQ)0E!!5$ G72D*("` ("` ("!I9B!L:6)P871H. H ("` ("` ("` ("!R
M970N87!P96YD*&QI8G!A=& I"B` ("` ("` 96QS93H*("` ("` ("` ("` 
M<F5T+F%P<&5N9"AL:6)F;F%M92D*"B` ("!R971U<FX <F5T" H*9&5F(&=E
M;F5R871E*&5N=BDZ"B` ("!G;&]B86P <VUA<G1?;&EN:PH ("` 9VQO8F%L
M('-M87)T7VQI8 H*("` ('-T871I8U]O8FHL('-H87)E9%]O8FH /2!30V]N
M<RY4;V]L+F-R96%T94]B:D)U:6QD97)S*&5N=BD*"B` ("!S=&%T:6-?;V)J
M+F%D9%]A8W1I;VXH)RYD)RP )R1$0T]-)RD*("` ('-H87)E9%]O8FHN861D
M7V%C=&EO;B G+F0G+"`G)$1#3TTG*0H ("` <W1A=&EC7V]B:BYA9&1?96UI
M='1E<B G+F0G+"!30V]N<RY$969A=6QT<RY3=&%T:6-/8FIE8W1%;6ET=&5R
M*0H ("` <VAA<F5D7V]B:BYA9&1?96UI='1E<B G+F0G+"!30V]N<RY$969A
M=6QT<RY3:&%R961/8FIE8W1%;6ET=&5R*0H*("` (&5N=ELG1$,G72`]("=D
M;60G"B` ("!E;G9;)T1#3TTG72`]("<D1$, )%]$24Y#1DQ!1U, )%]$5D52
M1DQ!1U, )%]$1$5"54=&3$%'4R`D7T1&3$%'4R`M8R`M;V8D5$%21T54("13
M3U520T53)PH ("` 96YV6R=?1$E.0T9,04=3)UT /2`G)"  )'M?8V]N8V%T
M*$1)3D-04D5&25 L($10051(+"!$24Y#4U5&1DE8+"!?7V5N=E]?+"!21&ER
M<RE]("`D*2<*("` (&5N=ELG7T1615)&3$%'4R==(#T )R0H("1[7V-O;F-A
M="A$5D524%)%1DE8+"!$5D524TE/3E,L($1615)3549&25 L(%]?96YV7U\I
M?2` )"DG"B` ("!E;G9;)U]$1$5"54=&3$%'4R==(#T )R0H("1[7V-O;F-A
M="A$1$5"54=04D5&25 L($1$14)51RP 1$1%0E5'4U5&1DE8+"!?7V5N=E]?
M*7T )"DG"B` ("!E;G9;)U]$1DQ!1U,G72`]("<D*"`D>U]C;VYC870H1$9,
M04=04D5&25 L($1&3$%'4RP 1$9,04=3549&25 L(%]?96YV7U\I?2`D*2<*
M"B` ("!E;G9;)T10051()UT /2!;)R,O)UT*("` (&5N=ELG1$9,04=3)UT 
M/2!;70H ("` 96YV6R=$5D524TE/3E,G72`](%M="B` ("!E;G9;)T1$14)5
M1R==(#T 6UT*"B` ("`C($%D9"!T:&4 <&%T:"!T;R!T:&4 <W1A;F1A<F0 
M;&EB<F%R>2X*("` (", 5&AI<R!I<R!M97)E;'D 9F]R('1H92!C;VYV96YI
M96YC92!O9B!T:&4 9&5P96YD96YC>2!S8V%N;F5R+ H ("` 9&UD7W!A=&  
M/2!E;G8N5VAE<F5)<R G9&UD)RD*("` (&EF(&1M9%]P871H. H ("` ("` 
M('  /2!S=')I;F<N<FEN9&5X*&1M9%]P871H+"`G9&UD)RD*("` ("` ("!P
M:&]B;W-$:7( /2!D;61?<&%T:%LZ>%T *R`G+RXN+W-R8R]P:&]B;W,G"B` 
M("` ("` :68 ;W,N<&%T:"YI<V1I<BAP:&]B;W-$:7(I. H ("` ("` ("` 
M("!E;G8N07!P96YD*$10051((#T 6W!H;V)O<T1I<ETI" H ("` 96YV6R=$
M24Y#4%)%1DE8)UT /2`G+4DG"B` ("!E;G9;)T1)3D-3549&25 G72`]("<G
M"B` ("!E;G9;)T1615)04D5&25 G72`]("<M=F5R<VEO;CTG"B` ("!E;G9;
M)T1615)3549&25 G72`]("<G"B` ("!E;G9;)T1$14)51U!2149)6"==(#T 
M)RUD96)U9STG"B` ("!E;G9;)T1$14)51U-51D9)6"==(#T )R<*("` (&5N
M=ELG1$9,04=04D5&25 G72`]("<M)PH ("` 96YV6R=$1DQ!1U-51D9)6"==
M(#T )R<*("` (&5N=ELG1$9)3$53549&25 G72`]("<N9"<*"B` ("`C($YE
M960 =&\ =7-E('1H92!$:6=I=&%L($UA<G, ;&EN:V5R+VQI8B!O;B!W:6YD
M;W=S+ H ("` (R`J;FEX(&-A;B!J=7-T('5S92!'3E4 ;&EN:RX*("` (&EF
M(&5N=ELG4$Q!5$9/4DTG72`]/2`G=VEN,S(G. H ("` ("` (&5N=ELG1$Q)
M3DLG72`]("<D1$,G"B` ("` ("` 96YV6R=$3$E.2T-/32==(#T )R1$3$E.
M2R`M;V8D5$%21T54("133U520T53("1$3$E.2T9,04=3("1?1$Q)3DM,24)&
M3$%'4R<*("` ("` ("!E;G9;)T1,24(G72`]("=L:6(G"B` ("` ("` 96YV
M6R=$3$E"0T]-)UT /2`G)$1,24( )%]$3$E"1DQ!1U, +6, )%1!4D=%5"`D
M4T]54D-%4R`D7T1,24Y+3$E"1DQ!1U,G" H ("` ("` (&5N=ELG7T1,24Y+
M3$E"1DQ!1U,G72`](&1,:6)S"B` ("` ("` (V5N=ELG7T1,24Y+3$E"1DQ!
M1U,G72`]("<D*"`D>U]C;VYC870H1$Q)0DQ)3DM04D5&25 L(%]$3$E"4RP 
M1$Q)0DQ)3DM3549&25 L(%]?96YV7U\L(%)$:7)S*7T )"DG"B` ("` ("` 
M96YV6R=?1$Q)0D9,04=3)UT /2`G)"  )'M?8V]N8V%T*$1,24)&3$%'4%)%
M1DE8+"!$3$E"1DQ!1U,L($1,24)&3$%'4U5&1DE8+"!?7V5N=E]?*7T )"DG
M"B` ("` ("` 96YV6R=$3$E.2T9,04=3)UT /2!;70H ("` ("` (&5N=ELG
M1$Q)0DQ)3DM04D5&25 G72`]("<G"B` ("` ("` 96YV6R=$3$E"3$E.2U-5
M1D9)6"==(#T )RYL:6(G"B` ("` ("` 96YV6R=$3$E"1DQ!1U!2149)6"==
M(#T )RTG"B` ("` ("` 96YV6R=$3$E"1DQ!1U-51D9)6"==(#T )R<*("` 
M("` ("!E;G9;)T1,24Y+1DQ!1U!2149)6"==(#T )RTG"B` ("` ("` 96YV
M6R=$3$E.2T9,04=3549&25 G72`]("<G" H ("` ("` (%-#;VYS+E1O;VPN
M8W)E871E4W1A=&EC3&EB0G5I;&1E<BAE;G8I" H ("` ("` (", 0F%S:6-A
M;&QY+"!W92!H:6IA8VL =&AE(&QI;FL 86YD(&%R(&)U:6QD97)S('=I=&  
M;W5R(&]W;BX*("` ("` ("`C('1H97-E(&)U:6QD97)S(&-H96-K(&9O<B!T
M:&4 <')E<V5N8V4 ;V8 1"!S;W5R8V4L(&%N9"!S=V%P(&]U=`H ("` ("` 
M(", =&AE('-Y<W1E;2=S(&1E9F%U;'1S(&9O<B!T:&4 1&EG:71A;"!-87)S
M('1O;VQS+B` 268 =&AE<F4G<R!N;R!$"B` ("` ("` (R!S;W5R8V4L('1H
M96X =V4 <VEL96YT;'D <F5T=7)N('1H92!P<F5V:6]U<R!S971T:6YG<RX*
M("` ("` ("!L:6YK8V]M(#T 96YV+F=E=" G3$E.2T-/32<I"B` ("` ("` 
M=')Y. H ("` ("` ("` ("!E;G9;)U--05)47TQ)3DM#3TTG72`]('-M87)T
M7VQI;FM;;&EN:V-O;5T*("` ("` ("!E>&-E<'0 2V5Y17)R;W(Z"B` ("` 
M("` ("` (&1E9B!?<VUA<G1,:6YK*'-O=7)C92P =&%R9V5T+"!E;G8L(&9O
M<E]S:6=N871U<F4L"B` ("` ("` ("` ("` ("` ("` ("` ("` (&1E9F%U
M;'1,:6YK97(];&EN:V-O;2DZ"B` ("` ("` ("` ("` ("!I9B!I<T0H<V]U
M<F-E*3H*("` ("` ("` ("` ("` ("` ("!R971U<FX )R1$3$E.2T-/32<*
M("` ("` ("` ("` ("` (&5L:68 ;&5N*'-O=7)C92D /3T ,#H ("` ("` 
M("` ("` ("` ("` (`H ("` ("` ("` ("` ("` ("` (')E='5R;B`B96-H
M;R`B"B` ("` ("` ("` ("` ("!E;'-E. H ("` ("` ("` ("` ("` ("` 
M(')E='5R;B!D969A=6QT3&EN:V5R"B` ("` ("` ("` (&5N=ELG4TU!4E1?
M3$E.2T-/32==(#T <VUA<G1?;&EN:UML:6YK8V]M72`](%]S;6%R=$QI;FL*
M"B` ("` ("` 87)C;VT /2!E;G8N9V5T*"=!4D-/32<I"B` ("` ("` =')Y
M. H ("` ("` ("` ("!E;G9;)U--05)47T%20T]-)UT /2!S;6%R=%]L:6);
M87)C;VU="B` ("` ("` 97AC97!T($ME>45R<F]R. H ("` ("` ("` ("!D
M968 7W-M87)T3&EB*'-O=7)C92P =&%R9V5T+"!E;G8L(&9O<E]S:6=N871U
M<F4L"B` ("` ("` ("` ("` ("` ("` ("` ("!D969A=6QT3&EB/6%R8V]M
M*3H*("` ("` ("` ("` ("` (&EF(&ES1"AS;W5R8V4I. H ("` ("` ("` 
M("` ("` ("` (')E='5R;B`G)$1,24)#3TTG"B` ("` ("` ("` ("` ("!E
M;&EF(&QE;BAS;W5R8V4I(#T](#`Z"B` ("` ("` ("` ("` ("` ("` <F5T
M=7)N(")E8VAO("(*("` ("` ("` ("` ("` (&5L<V4Z"B` ("` ("` ("` 
M("` ("` ("` <F5T=7)N(&1E9F%U;'1,:6(*("` ("` ("` ("` 96YV6R=3
M34%25%]!4D-/32==(#T <VUA<G1?;&EB6V%R8V]M72`](%]S;6%R=$QI8 H*
M("` ("` ("`C($ET(&ES('=O<G1H(&YO=&EN9R!T:&%T('1H92!F:6YA;"!S
M<&%C92!I;B!T:&5S92!S=')I;F=S(&ES"B` ("` ("` (R!A8G-O;'5T96QY
M('!I=F]T86PN("!30V]N<R!S965S('1H97-E(&%S(&%C=&EO;G, 86YD(&YO
M="!G96YE<F%T;W)S"B` ("` ("` (R!I9B!I="!I<R!N;W0 =&AE<F4N("AV
M97)Y(&)A9"D*("` ("` ("!E;G9;)T%20T]-)UT /2`G)%--05)47T%20T]-
M("<*("` ("` ("!E;G9;)TQ)3DM#3TTG72`]("<D4TU!4E1?3$E.2T-/32`G
M"B` ("!E;'-E.B`C(&%S<W5M:6YG(&QI;G5X"B` ("` ("` ;&EN:V-O;2`]
M(&5N=BYG970H)TQ)3DM#3TTG*0H ("` ("` ('1R>3H*("` ("` ("` ("` 
M96YV6R=334%25%],24Y+0T]-)UT /2!S;6%R=%]L:6YK6VQI;FMC;VU="B` 
M("` ("` 97AC97!T($ME>45R<F]R. H ("` ("` ("` ("!D968 7W-M87)T
M3&EN:RAS;W5R8V4L('1A<F=E="P 96YV+"!F;W)?<VEG;F%T=7)E+`H ("` 
M("` ("` ("` ("` ("` ("` ("` ("!D969A=6QT3&EN:V5R/6QI;FMC;VTI
M. H ("` ("` ("` ("` ("` :68 :7-$*'-O=7)C92DZ"B` ("` ("` ("` 
M("` ("` ("` =')Y. H ("` ("` ("` ("` ("` ("` ("` ("!L:6)S(#T 
M96YV6R=,24)3)UT*("` ("` ("` ("` ("` ("` ("!E>&-E<'0 2V5Y17)R
M;W(Z"B` ("` ("` ("` ("` ("` ("` ("` (&QI8G, /2!;70H ("` ("` 
M("` ("` ("` ("` (&EF("=P:&]B;W,G(&YO="!I;B!L:6)S. H ("` ("` 
M("` ("` ("` ("` ("` ("!E;G8N07!P96YD*$Q)0E, /2!;)W!H;V)O<R==
M*0H ("` ("` ("` ("` ("` ("` (&EF("=P=&AR96%D)R!N;W0 :6X ;&EB
M<SH*("` ("` ("` ("` ("` ("` ("` ("` 96YV+D%P<&5N9"A,24)3(#T 
M6R=P=&AR96%D)UTI"B` ("` ("` ("` ("` ("!R971U<FX 9&5F875L=$QI
M;FME< H ("` ("` ("` ("!E;G9;)U--05)47TQ)3DM#3TTG72`]('-M87)T
M7VQI;FM;;&EN:V-O;5T /2!?<VUA<G1,:6YK" H ("` ("` (&5N=ELG3$E.
M2T-/32==(#T )R1334%25%],24Y+0T]-("<*"F1E9B!E>&ES=',H96YV*3H*
=("` (')E='5R;B!E;G8N1&5T96-T*"=D;60G*0IE
`
end
Feb 08 2005