(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=') (Lit_Other '=')} {(DQ (--verbose))} {(Lit_Other ']')} ) (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=') (Lit_Other '=')} {(DQ (-v))} {(Lit_Other ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(shift)} {(1)}) (command.FuncDef name: debug body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(DQ ($ VSub_Star '$*'))}) terminator: <Op_Semi ';'> ) ] spids: [67] ) spids: [63 66] ) ] spids: [16777215 57] ) ] else_action: [ (command.FuncDef name: debug body: (command.BraceGroup children: [(command.Sentence child:(C {(Lit_Other ':')}) terminator:<Op_Semi ';'>)] spids: [84] ) spids: [80 83] ) ] spids: [78 91] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('Usage: ') ($ VSub_Number '$0') (' <private_libdir>'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 107] ) ] spids: [16777215 123] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:UNAME spids:[126]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(uname)} {(-s)})]) left_token: <Left_CommandSub '$('> spids: [128 132] ) ) } spids: [126] ) ] spids: [126] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$UNAME'))} {(Lit_Other '=')} {(DQ (Linux))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SHLIB_EXT spids:[155]) op: Equal rhs: {(DQ (so))} spids: [155] ) ] spids: [155] ) ] spids: [16777215 152] ) (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$UNAME'))} {(Lit_Other '=')} {(DQ (Darwin))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SHLIB_EXT spids:[180]) op: Equal rhs: {(DQ (dylib))} spids: [180] ) ] spids: [180] ) ] spids: [160 177] ) ] else_action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ("WARNING: Could not autodetect platform type ('uname -s' == ") ($ VSub_Name '$UNAME') ('); assuming Linux') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:UNAME spids:[200]) op: Equal rhs: {(DQ (Linux))} spids: [200] ) ] spids: [200] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SHLIB_EXT spids:[206]) op: Equal rhs: {(DQ (so))} spids: [206] ) ] spids: [206] ) ] spids: [185 211] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:private_libdir spids:[214]) op: Equal rhs: {($ VSub_Number '$1')} spids: [214] ) ] spids: [214] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-f)} {(DQ ($ VSub_Name '$private_libdir') (/libarpack.) ($ VSub_Name '$SHLIB_EXT'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ('ERROR: Could not open ') ($ VSub_Name '$private_libdir') (/libarpack.) ($ VSub_Name '$SHLIB_EXT') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(2)}) ] spids: [16777215 235] ) ] spids: [16777215 255] ) (command.FuncDef name: find_shlib body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lib_path spids:[265]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [265] ) ] spids: [265] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-f)} {(DQ ($ VSub_Name '$lib_path'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$UNAME'))} {(Lit_Other '=')} {(DQ (Linux))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Pipeline children: [ (C {(ldd)} {(DQ ($ VSub_Name '$lib_path'))}) (C {(grep)} {($ VSub_Number '$2')}) (C {(cut)} {(-d) (SQ <' '>)} {(-f3)}) (C {(xargs)}) ] negated: F ) ] spids: [16777215 304] ) ] else_action: [ (command.Pipeline children: [ (C {(otool)} {(-L)} {(DQ ($ VSub_Name '$lib_path'))}) (C {(grep)} {($ VSub_Number '$2')}) (C {(cut)} {(-d) (SQ <' '>)} {(-f1)}) (C {(xargs)}) ] negated: F ) ] spids: [335 371] ) ] spids: [16777215 284] ) ] spids: [16777215 374] ) ] spids: [262] ) spids: [258 261] ) (command.FuncDef name: private_libname body: (command.BraceGroup children: [ (C {(echo)} { (DQ ($ VSub_Name '$private_libdir') (/lib) ($ VSub_Number '$1') (.) ($ VSub_Name '$SHLIB_EXT') ) } ) ] spids: [383] ) spids: [379 382] ) (command.ForEach iter_name: lib iter_words: [{(arpack)} {(lapack)}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(-f)} { (DQ ($ VSub_Name '$private_libdir') (/lib) ($ VSub_Name '$lib') (.) ($ VSub_Name '$SHLIB_EXT') ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGFORTRAN_PATH spids:[444]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(find_shlib)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(private_libname)} {($ VSub_Name '$lib')}) ] ) left_token: <Left_CommandSub '$('> spids: [449 453] ) ) } {(libgfortran)} ) ] ) left_token: <Left_CommandSub '$('> spids: [445 457] ) } spids: [444] ) ] spids: [444] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGCC_PATH spids:[460]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(find_shlib)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(private_libname)} {($ VSub_Name '$lib')}) ] ) left_token: <Left_CommandSub '$('> spids: [465 469] ) ) } {(libgcc_s)} ) ] ) left_token: <Left_CommandSub '$('> spids: [461 473] ) } spids: [460] ) ] spids: [460] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBQUADMATH_PATH spids:[476]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(find_shlib)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(private_libname)} {($ VSub_Name '$lib')}) ] ) left_token: <Left_CommandSub '$('> spids: [481 485] ) ) } {(libquadmath)} ) ] ) left_token: <Left_CommandSub '$('> spids: [477 489] ) } spids: [476] ) ] spids: [476] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGFORTRAN_DIRS spids:[501]) op: Equal rhs: { (DQ ($ VSub_Name '$LIBGFORTRAN_DIRS') (' ') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(dirname)} {($ VSub_Name '$LIBGFORTRAN_PATH')})] ) left_token: <Left_CommandSub '$('> spids: [505 509] ) ) } spids: [501] ) ] spids: [501] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGFORTRAN_DIRS spids:[513]) op: Equal rhs: { (DQ ($ VSub_Name '$LIBGFORTRAN_DIRS') (' ') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(dirname)} {($ VSub_Name '$LIBGCC_PATH')})] ) left_token: <Left_CommandSub '$('> spids: [517 521] ) ) } spids: [513] ) ] spids: [513] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGFORTRAN_DIRS spids:[525]) op: Equal rhs: { (DQ ($ VSub_Name '$LIBGFORTRAN_DIRS') (' ') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(dirname)} {($ VSub_Name '$LIBQUADMATH_PATH')})] ) left_token: <Left_CommandSub '$('> spids: [529 533] ) ) } spids: [525] ) ] spids: [525] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGFORTRAN_SONAMES spids:[542]) op: Equal rhs: { (DQ ($ VSub_Name '$LIBGFORTRAN_SONAMES') (' ') (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(basename)} {(DQ ($ VSub_Name '$LIBGFORTRAN_PATH'))}) ] ) left_token: <Left_CommandSub '$('> spids: [546 552] ) ) } spids: [542] ) ] spids: [542] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGCC_SONAMES spids:[556]) op: Equal rhs: { (DQ ($ VSub_Name '$LIBGCC_SONAMES') (' ') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(basename)} {(DQ ($ VSub_Name '$LIBGCC_PATH'))})] ) left_token: <Left_CommandSub '$('> spids: [560 566] ) ) } spids: [556] ) ] spids: [556] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBQUADMATH_SONAMES spids:[570]) op: Equal rhs: { (DQ ($ VSub_Name '$LIBQUADMATH_SONAMES') (' ') (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(basename)} {(DQ ($ VSub_Name '$LIBQUADMATH_PATH'))}) ] ) left_token: <Left_CommandSub '$('> spids: [574 580] ) ) } spids: [570] ) ] spids: [570] ) ] spids: [16777215 433] ) ] spids: [16777215 584] ) ] spids: [413 586] ) spids: [407 411] ) (command.FuncDef name: uniquify body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Number '$1'))}) (C {(tr)} {(DQ (' '))} {(DQ (Lit_Other '\\') (n))}) (C {(sort)}) (C {(uniq)}) (C {(grep)} {(-v)} {(SQ <'^$'>)}) (C {(tr)} {(DQ (Lit_Other '\\') (n))} {(DQ (' '))}) ] negated: F ) ] spids: [596] ) spids: [592 595] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LIBGFORTRAN_DIRS spids:[652]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(uniquify)} {(DQ ($ VSub_Name '$LIBGFORTRAN_DIRS'))})] ) left_token: <Left_CommandSub '$('> spids: [653 659] ) } spids: [652] ) ] spids: [652] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SONAMES spids:[661]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(uniquify)} { (DQ ($ VSub_Name '$LIBGFORTRAN_SONAMES') (' ') ($ VSub_Name '$LIBGCC_SONAMES') (' ') ($ VSub_Name '$LIBQUADMATH_SONAMES') ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [663 673] ) ) } spids: [661] ) ] spids: [661] ) (C {(debug)} {(DQ ('Discovered traces of libgfortran within ') ($ VSub_Name '$LIBGFORTRAN_DIRS'))}) (C {(debug)} {(DQ ('Got SONAMES of ') ($ VSub_Name '$SONAMES'))}) (command.ForEach iter_name: soname iter_words: [{($ VSub_Name '$SONAMES')}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: dir iter_words: [{($ VSub_Name '$LIBGFORTRAN_DIRS')}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(KW_Bang '!')} {(-f)} { (DQ ($ VSub_Name '$private_libdir') (/) ($ VSub_Name '$soname')) } {(Lit_Other ']')} ) (C {(Lit_Other '[')} {(-f)} {(DQ ($ VSub_Name '$dir') (/) ($ VSub_Name '$soname'))} {(Lit_Other ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(cp)} {(-v)} {(DQ ($ VSub_Name '$dir') (/) ($ VSub_Name '$soname'))} {(DQ ($ VSub_Name '$private_libdir'))} ) (C {(chmod)} {(755)} {(DQ ($ VSub_Name '$private_libdir') (/) ($ VSub_Name '$soname'))} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$UNAME'))} {(Lit_Other '=')} {(DQ (Darwin))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(install_name_tool)} {(-id)} {(DQ ('@rpath/') ($ VSub_Name '$soname'))} {(DQ ($ VSub_Name '$private_libdir') (/) ($ VSub_Name '$soname'))} ) ] spids: [16777215 795] ) ] spids: [16777215 814] ) ] spids: [16777215 749] ) ] spids: [16777215 817] ) ] spids: [715 820] ) spids: [711 713] ) ] spids: [703 822] ) spids: [699 701] ) (command.FuncDef name: change_linkage body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lib_path spids:[848]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [848] ) ] spids: [848] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-f)} {(DQ ($ VSub_Name '$lib_path'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(debug)} {(DQ (' ') ($ VSub_Name '$lib_path') (" doesn't exist, skipping"))}) (command.ControlFlow token:<ControlFlow_Return return>) ] spids: [16777215 874] ) ] spids: [16777215 889] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:soname spids:[897]) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [897] ) ] spids: [897] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$UNAME'))} {(Lit_Other '=')} {(DQ (Darwin))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:old_link spids:[924]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(find_shlib)} {(DQ ($ VSub_Name '$lib_path'))} {(DQ ($ VSub_Name '$soname'))} ) ] ) left_token: <Left_CommandSub '$('> spids: [925 935] ) } spids: [924] ) ] spids: [924] ) (C {(echo)} {(DQ (' ') ($ VSub_Name '$old_link'))}) (C {(install_name_tool)} {(-change)} {(DQ ($ VSub_Name '$old_link'))} {(DQ ('@rpath/') ($ VSub_Name '$soname'))} {(DQ ($ VSub_Name '$lib_path'))} ) ] spids: [16777215 921] ) ] else_action: [ (C {(patchelf)} {(--set-rpath)} {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (ORIGIN)} {(DQ ($ VSub_Name '$lib_path'))} ) ] spids: [964 982] ) ] spids: [841] ) spids: [837 840] ) (command.ForEach iter_name: lib iter_words: [{(libopenblas)} {(libarpack)} {(libcholmod)} {(liblapack)} {($ VSub_Name '$SONAMES')}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: lib_path iter_words: [{($ VSub_Name '$private_libdir') (/) ($ VSub_Name '$lib') (Lit_Other '*')}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: soname iter_words: [{($ VSub_Name '$SONAMES')}] do_arg_iter: F body: (command.DoGroup children: [ (C {(debug)} { (DQ ('changing linkage of ') ($ VSub_Name '$lib_path') (' to ') ($ VSub_Name '$soname') ) } ) (C {(change_linkage)} {(DQ ($ VSub_Name '$lib_path'))} {(DQ ($ VSub_Name '$soname'))} ) ] spids: [1058 1082] ) spids: [1054 1056] ) ] spids: [1042 1085] ) spids: [1035 1040] ) ] spids: [1019 1087] ) spids: [1007 1017] ) ] )