#!/bin/sh # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language governing rights and limitations under the # License. # # The Original Code is the MSVC wrappificator. # # The Initial Developer of the Original Code is # Timothy Wall . # Portions created by the Initial Developer are Copyright (C) 2009 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Daniel Witte # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), # in which case the provisions of the GPL or the LGPL are applicable instead # of those above. If you wish to allow use of your version of this file only # under the terms of either the GPL or the LGPL, and not to allow others to # use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under # the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** # # GCC-compatible wrapper for cl.exe and ml.exe. Arguments are given in GCC # format and translated into something sensible for cl or ml. # global args_orig := $ifsjoin(Argv) global args := '"-nologo -W3'" global static_crt := '' global debug_crt := '' global cl := '"cl'" global ml := '"ml'" global safeseh := '"-safeseh'" global output := '' while [ $# -gt 0 ] { matchstr $1 { -fexceptions { # Don't enable exceptions for now. #args="$args -EHac" shift 1 } -m32 { shift 1 } -m64 { global ml := '"ml64'" # "$MSVC/x86_amd64/ml64" global safeseh := '' shift 1 } -clang-cl { global cl := '"clang-cl'" global safeseh := '' shift 1 } -O0 { global args := ""$args -Od"" shift 1 } -O* { # Runtime error checks (enabled by setting -RTC1 in the -DFFI_DEBUG # case below) are not compatible with optimization flags and will # cause the build to fail. Therefore, drop the optimization flag if # -DFFI_DEBUG is also set. matchstr $args_orig { *-DFFI_DEBUG* { global args := $args } * { # The ax_cc_maxopt.m4 macro from the upstream autoconf-archive # project doesn't support MSVC and therefore ends up trying to # use -O3. Use the equivalent "max optimization" flag for MSVC # instead of erroring out. matchstr $1 { -O3 { global args := ""$args -O2"" } * { global args := ""$args $1"" } } global opt := '"true'" } } shift 1 } -g { # Enable debug symbol generation. global args := ""$args -Zi"" shift 1 } -DFFI_DEBUG { # Enable runtime error checks. global args := ""$args -RTC1"" global defines := ""$defines $1"" shift 1 } -DUSE_STATIC_RTL { # Link against static CRT. global static_crt := '1' shift 1 } -DUSE_DEBUG_RTL { # Link against debug CRT. global debug_crt := '1' shift 1 } -c { global args := ""$args -c"" global args := $[echo $args | sed 's%/Fe%/Fo%g] global single := '"-c'" shift 1 } -D*=* { global name := $[echo $1|sed 's/-D\([^=][^=]*\)=.*/\1/g] global value := $[echo $1|sed 's/-D[^=][^=]*=//g] global args := ""$args -D$(name)='$value'"" global defines := ""$defines -D$(name)='$value'"" shift 1 } -D* { global args := ""$args $1"" global defines := ""$defines $1"" shift 1 } -I { global args := ""$args -I$2"" global includes := ""$includes -I$2"" shift 2 } -I* { global args := ""$args $1"" global includes := ""$includes $1"" shift 1 } -W|-Wextra { # TODO map extra warnings shift 1 } -Wall { # -Wall on MSVC is overzealous, and we already build with -W3. Nothing # to do here. shift 1 } -pedantic { # libffi tests -pedantic with -Wall, so drop it also. shift 1 } -Werror { global args := ""$args -WX"" shift 1 } -W* { # TODO map specific warnings shift 1 } -S { global args := ""$args -FAs"" shift 1 } -o { global outdir := $[dirname $2] global base := $[basename $2|sed 's/\.[^.]*//g] if test -n $single { global output := ""-Fo$2"" } else { global output := ""-Fe$2"" } if test -n $assembly { global args := ""$args $output"" } else { global args := ""$args $output -Fd$outdir/$base -Fp$outdir/$base -Fa$outdir/$base"" } shift 2 } *.S { global src := $1 global assembly := '"true'" shift 1 } *.c { global args := ""$args $1"" shift 1 } * { # Assume it's an MSVC argument, and pass it through. global args := ""$args $1"" shift 1 } } } # If -Zi is specified, certain optimizations are implicitly disabled # by MSVC. Add back those optimizations if this is an optimized build. # NOTE: These arguments must come after all others. if test -n $opt { global args := ""$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"" } if test -n $static_crt { global md := '-MT' } else { global md := '-MD' } if test -n $debug_crt { global md := ""$(md)d"" } if test -n $assembly { if test -z $outdir { global outdir := '".'" } global ppsrc := ""$outdir/$[basename $src|sed 's/.S$/.asm/g]"" echo "$cl -nologo -EP $includes $defines $src > $ppsrc" $cl -nologo -EP $includes $defines $src > $ppsrc || exit $Status global output := $[echo $output | sed 's%/F[dpa][^ ]*%%g] global args := ""-nologo $safeseh $single $output $ppsrc"" echo "$ml $args" eval "\"$ml\" $args" global result := $Status # required to fix ml64 broken output? #mv *.obj $outdir } else { global args := ""$md $args"" echo "$cl $args" # Return an error code of 1 if an invalid command line parameter is passed # instead of just ignoring it. eval "(\"$cl\" $args 2>&1 1>&3 | \ awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1" global result := $Status } exit $result (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:args_orig) op:Equal rhs:{($ VSub_At "$@")} spids:[126])] spids: [126] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:args) op:Equal rhs:{(DQ ("-nologo -W3"))} spids:[129])] spids: [129] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:static_crt) op:Equal rhs:{(SQ )} spids:[134])] spids: [134] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:debug_crt) op:Equal rhs:{(SQ )} spids:[136])] spids: [136] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:cl) op:Equal rhs:{(DQ (cl))} spids:[138])] spids: [138] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:ml) op:Equal rhs:{(DQ (ml))} spids:[143])] spids: [143] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:safeseh) op:Equal rhs:{(DQ (-safeseh))} spids:[148])] spids: [148] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:output) op:Equal rhs:{(SQ )} spids:[153])] spids: [153] ) (While cond: [(C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-gt)} {(0)} {(Lit_Other "]")})] body: (DoGroup children: [ (Case to_match: {($ VSub_Number "$1")} arms: [ (case_arm pat_list: [{(-fexceptions)}] action: [(C {(shift)} {(1)})] spids: [179 180 196 -1] ) (case_arm pat_list: [{(-m32)}] action: [(C {(shift)} {(1)})] spids: [199 200 208 -1] ) (case_arm pat_list: [{(-m64)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ml) op: Equal rhs: {(DQ (ml64))} spids: [215] ) ] spids: [215] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:safeseh) op: Equal rhs: {(SQ )} spids: [224] ) ] spids: [224] ) (C {(shift)} {(1)}) ] spids: [211 212 232 -1] ) (case_arm pat_list: [{(-clang-cl)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cl) op: Equal rhs: {(DQ (clang-cl))} spids: [239] ) ] spids: [239] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:safeseh) op: Equal rhs: {(SQ )} spids: [245] ) ] spids: [245] ) (C {(shift)} {(1)}) ] spids: [235 236 253 -1] ) (case_arm pat_list: [{(-O0)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -Od"))} spids: [260] ) ] spids: [260] ) (C {(shift)} {(1)}) ] spids: [256 257 272 -1] ) (case_arm pat_list: [{(-O) (Lit_Other "*")}] action: [ (Case to_match: {($ VSub_Name "$args_orig")} arms: [ (case_arm pat_list: [{(Lit_Other "*") (-DFFI_DEBUG) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args"))} spids: [309] ) ] spids: [309] ) ] spids: [303 306 315 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Case to_match: {($ VSub_Number "$1")} arms: [ (case_arm pat_list: [{(-O3)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -O2"))} spids: [349] ) ] spids: [349] ) ] spids: [345 346 356 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" ") ($ VSub_Number "$1"))} spids: [363] ) ] spids: [363] ) ] spids: [359 360 371 -1] ) ] spids: [338 342 374] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt) op: Equal rhs: {(DQ (true))} spids: [377] ) ] spids: [377] ) ] spids: [318 319 383 -1] ) ] spids: [296 300 386] ) (C {(shift)} {(1)}) ] spids: [275 277 394 -1] ) (case_arm pat_list: [{(-g)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -Zi"))} spids: [405] ) ] spids: [405] ) (C {(shift)} {(1)}) ] spids: [397 398 417 -1] ) (case_arm pat_list: [{(-DFFI_DEBUG)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -RTC1"))} spids: [428] ) ] spids: [428] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:defines) op: Equal rhs: {(DQ ($ VSub_Name "$defines") (" ") ($ VSub_Number "$1"))} spids: [435] ) ] spids: [435] ) (C {(shift)} {(1)}) ] spids: [420 421 448 -1] ) (case_arm pat_list: [{(-DUSE_STATIC_RTL)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:static_crt) op: Equal rhs: {(1)} spids: [459] ) ] spids: [459] ) (C {(shift)} {(1)}) ] spids: [451 452 468 -1] ) (case_arm pat_list: [{(-DUSE_DEBUG_RTL)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:debug_crt) op: Equal rhs: {(1)} spids: [479] ) ] spids: [479] ) (C {(shift)} {(1)}) ] spids: [471 472 488 -1] ) (case_arm pat_list: [{(-c)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -c"))} spids: [495] ) ] spids: [495] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$args")}) (C {(sed)} {(SQ <"s%/Fe%/Fo%g">)}) ] negated: False ) ] ) left_token: spids: [504 516] ) ) } spids: [502] ) ] spids: [502] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:single) op: Equal rhs: {(DQ (-c))} spids: [520] ) ] spids: [520] ) (C {(shift)} {(1)}) ] spids: [491 492 531 -1] ) (case_arm pat_list: [{(-D) (Lit_Other "*") (Lit_Other "=") (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Number "$1")}) (C {(sed)} {(SQ <"s/-D\\([^=][^=]*\\)=.*/\\1/g">)}) ] negated: False ) ] ) left_token: spids: [543 553] ) ) } spids: [541] ) ] spids: [541] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:value) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Number "$1")}) (C {(sed)} {(SQ <"s/-D[^=][^=]*=//g">)}) ] negated: False ) ] ) left_token: spids: [559 569] ) ) } spids: [557] ) ] spids: [557] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: { (DQ ($ VSub_Name "$args") (" -D") (${ VSub_Name name) ("='") ($ VSub_Name "$value") ("'") ) } spids: [573] ) ] spids: [573] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:defines) op: Equal rhs: { (DQ ($ VSub_Name "$defines") (" -D") (${ VSub_Name name) ("='") ($ VSub_Name "$value") ("'") ) } spids: [586] ) ] spids: [586] ) (C {(shift)} {(1)}) ] spids: [534 538 604 -1] ) (case_arm pat_list: [{(-D) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" ") ($ VSub_Number "$1"))} spids: [612] ) ] spids: [612] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:defines) op: Equal rhs: {(DQ ($ VSub_Name "$defines") (" ") ($ VSub_Number "$1"))} spids: [620] ) ] spids: [620] ) (C {(shift)} {(1)}) ] spids: [607 609 633 -1] ) (case_arm pat_list: [{(-I)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -I") ($ VSub_Number "$2"))} spids: [640] ) ] spids: [640] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:includes) op: Equal rhs: {(DQ ($ VSub_Name "$includes") (" -I") ($ VSub_Number "$2"))} spids: [648] ) ] spids: [648] ) (C {(shift)} {(2)}) ] spids: [636 637 661 -1] ) (case_arm pat_list: [{(-I) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" ") ($ VSub_Number "$1"))} spids: [669] ) ] spids: [669] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:includes) op: Equal rhs: {(DQ ($ VSub_Name "$includes") (" ") ($ VSub_Number "$1"))} spids: [677] ) ] spids: [677] ) (C {(shift)} {(1)}) ] spids: [664 666 690 -1] ) (case_arm pat_list: [{(-W)} {(-Wextra)}] action: [(C {(shift)} {(1)})] spids: [693 696 708 -1] ) (case_arm pat_list: [{(-Wall)}] action: [(C {(shift)} {(1)})] spids: [711 712 728 -1] ) (case_arm pat_list: [{(-pedantic)}] action: [(C {(shift)} {(1)})] spids: [731 732 744 -1] ) (case_arm pat_list: [{(-Werror)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -WX"))} spids: [751] ) ] spids: [751] ) (C {(shift)} {(1)}) ] spids: [747 748 763 -1] ) (case_arm pat_list: [{(-W) (Lit_Other "*")}] action: [(C {(shift)} {(1)})] spids: [766 768 780 -1] ) (case_arm pat_list: [{(-S)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -FAs"))} spids: [787] ) ] spids: [787] ) (C {(shift)} {(1)}) ] spids: [783 784 799 -1] ) (case_arm pat_list: [{(-o)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:outdir) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {($ VSub_Number "$2")})] ) left_token: spids: [808 812] ) ) } spids: [806] ) ] spids: [806] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(basename)} {($ VSub_Number "$2")}) (C {(sed)} {(SQ <"s/\\.[^.]*//g">)}) ] negated: False ) ] ) left_token: spids: [818 828] ) ) } spids: [816] ) ] spids: [816] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$single"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output) op: Equal rhs: {(DQ (-Fo) ($ VSub_Number "$2"))} spids: [849] ) ] spids: [849] ) ] spids: [-1 845] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output) op: Equal rhs: {(DQ (-Fe) ($ VSub_Number "$2"))} spids: [859] ) ] spids: [859] ) ] spids: [856 866] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$assembly"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" ") ($ VSub_Name "$output"))} spids: [885] ) ] spids: [885] ) ] spids: [-1 882] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: { (DQ ($ VSub_Name "$args") (" ") ($ VSub_Name "$output") (" -Fd") ($ VSub_Name "$outdir") (/) ($ VSub_Name "$base") (" -Fp") ($ VSub_Name "$outdir") (/) ($ VSub_Name "$base") (" -Fa") ($ VSub_Name "$outdir") (/) ($ VSub_Name "$base") ) } spids: [896] ) ] spids: [896] ) ] spids: [893 916] ) (C {(shift)} {(2)}) ] spids: [802 803 924 -1] ) (case_arm pat_list: [{(Lit_Other "*") (.S)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:src) op: Equal rhs: {($ VSub_Number "$1")} spids: [932] ) ] spids: [932] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:assembly) op: Equal rhs: {(DQ (true))} spids: [936] ) ] spids: [936] ) (C {(shift)} {(1)}) ] spids: [927 929 947 -1] ) (case_arm pat_list: [{(Lit_Other "*") (.c)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" ") ($ VSub_Number "$1"))} spids: [955] ) ] spids: [955] ) (C {(shift)} {(1)}) ] spids: [950 952 968 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" ") ($ VSub_Number "$1"))} spids: [979] ) ] spids: [979] ) (C {(shift)} {(1)}) ] spids: [971 972 992 -1] ) ] spids: [171 176 995] ) ] spids: [168 997] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$opt"))} {(Lit_Other "]")}) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$args") (" -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"))} spids: [1025] ) ] spids: [1025] ) ] spids: [-1 1022] ) ] spids: [-1 1031] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$static_crt"))} {(Lit_Other "]")}) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:md) op:Equal rhs:{(-MT)} spids:[1050])] spids: [1050] ) ] spids: [-1 1047] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:md) op:Equal rhs:{(-MD)} spids:[1056])] spids: [1056] ) ] spids: [1053 1059] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$debug_crt"))} {(Lit_Other "]")}) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:md) op: Equal rhs: {(DQ (${ VSub_Name md) (d))} spids: [1078] ) ] spids: [1078] ) ] spids: [-1 1075] ) ] spids: [-1 1086] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$assembly"))} {(Lit_Other "]")}) terminator: ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$outdir"))} {(Lit_Other "]")}) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:outdir) op: Equal rhs: {(DQ (.))} spids: [1121] ) ] spids: [1121] ) ] spids: [-1 1118] ) ] spids: [-1 1127] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ppsrc) op: Equal rhs: { (DQ ($ VSub_Name "$outdir") (/) (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(basename)} {($ VSub_Name "$src")}) (C {(sed)} {(SQ <"s/.S$/.asm/g">)}) ] negated: False ) ] ) left_token: spids: [1134 1144] ) ) } spids: [1130] ) ] spids: [1130] ) (C {(echo)} { (DQ ($ VSub_Name "$cl") (" -nologo -EP ") ($ VSub_Name "$includes") (" ") ($ VSub_Name "$defines") (" ") ($ VSub_Name "$src") (" > ") ($ VSub_Name "$ppsrc") ) } ) (AndOr children: [ (SimpleCommand words: [ {(DQ ($ VSub_Name "$cl"))} {(-nologo)} {(-EP)} {($ VSub_Name "$includes")} {($ VSub_Name "$defines")} {($ VSub_Name "$src")} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$ppsrc")} spids: [1177] ) ] ) (C {(exit)} {($ VSub_QMark "$?")}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$output")}) (C {(sed)} {(SQ <"s%/F[dpa][^ ]*%%g">)}) ] negated: False ) ] ) left_token: spids: [1190 1202] ) ) } spids: [1188] ) ] spids: [1188] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: { (DQ ("-nologo ") ($ VSub_Name "$safeseh") (" ") ($ VSub_Name "$single") (" ") ($ VSub_Name "$output") (" ") ($ VSub_Name "$ppsrc") ) } spids: [1206] ) ] spids: [1206] ) (C {(echo)} {(DQ ($ VSub_Name "$ml") (" ") ($ VSub_Name "$args"))}) (C {(eval)} { (DQ (EscapedLiteralPart token:) ($ VSub_Name "$ml") (EscapedLiteralPart token:) (" ") ($ VSub_Name "$args") ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_QMark "$?")} spids: [1240] ) ] spids: [1240] ) ] spids: [-1 1102] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Name "$md") (" ") ($ VSub_Name "$args"))} spids: [1255] ) ] spids: [1255] ) (C {(echo)} {(DQ ($ VSub_Name "$cl") (" ") ($ VSub_Name "$args"))}) (C {(eval)} { (DQ ("(") (EscapedLiteralPart token:) ($ VSub_Name "$cl") (EscapedLiteralPart token:) (" ") ($ VSub_Name "$args") (" 2>&1 1>&3 | ") (" awk '{print ") (EscapedLiteralPart token:) ("0} /D9002/ {error=1} END{exit error}' >&2) 3>&1") ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: {($ VSub_QMark "$?")} spids: [1297] ) ] spids: [1297] ) ] spids: [1252 1300] ) (C {(exit)} {($ VSub_Name "$result")}) ] )