ninja: refactor some duplicated code in generating a description string
ninja: refactor some duplicated code in generating a description string

This code will get more complicated with cross-compiling, so refactoring
it first so I don't have more cut and paste.

Review URL: http://codereview.chromium.org/7762007

git-svn-id: e7e1075985beda50ea81ac4472467b4f6e91fc78@1020 78cadc50-ecff-11dd-a971-7dbc132099af

ryfx/gyp,Chilledheart/gyp,openpeer/webrtc-gyp,IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp,msc-/gyp,adblockplus/gyp,geekboxzone/lollipop_external_chromium_org_tools_gyp,mumble-voip/libmumble-gyp,ttyangf/pdfium_gyp,MIPS/external-chromium_org-tools-gyp,sport-monkey/GYP,Jack-Q/GYP-copy,sloanyang/gyp,Danath/gyp,svn2github/kgyp,carlTLR/gyp,svn2github/kgyp,sanyaade-teachings/gyp,Chilledheart/gyp,mgamer/gyp,trafi/gyp,duanhjlt/gyp,ttyangf/pdfium_gyp,bnq4ever/gypgoogle,msc-/gyp,ttyangf/gyp,enkripsi/gyp,springmeyer/gyp,okumura/gyp,mgamer/gyp,okumura/gyp,android-ia/platform_external_chromium_org_tools_gyp,brson/gyp,sdklite/gyp,Chilledheart/gyp,springmeyer/gyp,MIPS/external-chromium_org-tools-gyp,alexcrichton/gyp,bnoordhuis/gyp,Danath/gyp,lukeweber/gyp-override,turbulenz/gyp,ttyangf/gyp,chromium/gyp,msc-/gyp,ryfx/gyp,sdklite/gyp,omasanori/gyp,yinquan529/platform-external-chromium_org-tools-gyp,trafi/gyp,cchamberlain/gyp,carlTLR/gyp,LazyCodingCat/gyp,enkripsi/gyp,yjhjstz/gyp,bpsinc-native/src_tools_gyp,lianliuwei/gyp,azunite/gyp_20150930,dougbeal/gyp,LazyCodingCat/gyp,Chilledheart/gyp,saghul/gyn,alexcrichton/gyp,azunite/gyp_20150930,pyokagan/gyp,Danath/gyp,bnq4ever/gypgoogle,AOSPU/external_chromium_org_tools_gyp,turbulenz/gyp,chromium/gyp,Danath/gyp,duanhjlt/gyp,ttyangf/gyp,sanyaade-teachings/gyp,mapbox/gyp,mgamer/gyp,clar/gyp,okwasi/gyp,enkripsi/gyp,tarc/gyp,pyokagan/gyp,ttyangf/pdfium_gyp,bdarnell/gyp,android-ia/platform_external_chromium_org_tools_gyp,bnq4ever/gypgoogle,okumura/gyp,IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp,AWhetter/gyp,dougbeal/gyp,turbulenz/gyp,bnq4ever/gypgoogle,pandaxcl/gyp,erikge/watch_gyp,mgamer/gyp,kevinchen3315/gyp-git,mkrautz/gyp-libmumble,erikge/watch_gyp,IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp,sport-monkey/GYP,yangrongwei/gyp,springmeyer/gyp,LazyCodingCat/gyp,okwasi/gyp,bpsinc-native/src_tools_gyp,turbulenz/gyp,AOSPU/external_chromium_org_tools_gyp,IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp,azunite/gyp_20150930,enkripsi/gyp,cchamberlain/gyp,brson/gyp,azunite/gyp_20150930,sanyaade-teachings/gyp,bdarnell/gyp,svn2github/gyp,bulldy80/gyp_unofficial,mumble-voip/libmumble-gyp,saghul/gyn,LazyCodingCat/gyp,yangrongwei/gyp,carlTLR/gyp,Omegaphora/external_chromium_org_tools_gyp,mistydemeo/gyp,msc-/gyp,sloanyang/gyp,azunite/gyp,mistydemeo/gyp,kevinchen3315/gyp-git,Omegaphora/external_chromium_org_tools_gyp,bnoordhuis/gyp,clar/gyp,lukeweber/gyp-override,mkrautz/gyp-libmumble,trafi/gyp,duanhjlt/gyp,azunite/gyp,openpeer/webrtc-gyp,bulldy80/gyp_unofficial,Phuehvk/gyp,springmeyer/gyp,channing/gyp,yjhjstz/gyp,carlTLR/gyp,amoikevin/gyp,pyokagan/gyp,cysp/gyp,msc-/gyp,erikge/watch_gyp,Jack-Q/GYP-copy,erikge/watch_gyp,mistydemeo/gyp,sdklite/gyp,bpsinc-native/src_tools_gyp,pyokagan/gyp,lukeweber/gyp-override,yinquan529/platform-external-chromium_org-tools-gyp,alexcrichton/gyp,channing/gyp,svn2github/gyp,mumble-voip/libmumble-gyp,xin3liang/platform_external_chromium_org_tools_gyp,bnoordhuis/gyp,ttyangf/gyp,amoikevin/gyp,cysp/gyp,sport-monkey/GYP,mkrautz/gyp-libmumble,tarc/gyp,saghul/gyn,pandaxcl/gyp,cchamberlain/gyp,adblockplus/gyp,MIPS/external-chromium_org-tools-gyp,yinquan529/platform-external-chromium_org-tools-gyp,mumble-voip/libmumble-gyp,xin3liang/platform_external_chromium_org_tools_gyp,bulldy80/gyp_unofficial,azunite/gyp,springmeyer/gyp,svn2github/gyp,Danath/gyp,dougbeal/gyp,cchamberlain/gyp,svn2github/gyp,omasanori/gyp,brson/gyp,sloanyang/gyp,bulldy80/gyp_unofficial,sanyaade-teachings/gyp,bulldy80/gyp_unofficial,azunite/gyp_20150930,clar/gyp,amoikevin/gyp,mapbox/gyp,adblockplus/gyp,yjhjstz/gyp,bnq4ever/gypgoogle,xin3liang/platform_external_chromium_org_tools_gyp,mgamer/gyp,bdarnell/gyp,dougbeal/gyp,luvit/gyp,sanyaade-teachings/gyp,turbulenz/gyp,geekboxzone/lollipop_external_chromium_org_tools_gyp,enkripsi/gyp,yangrongwei/gyp,bdarnell/gyp,tarc/gyp,sport-monkey/GYP,kevinchen3315/gyp-git,pyokagan/gyp,saghul/gyn,Jack-Q/GYP-copy,Phuehvk/gyp,ryfx/gyp,AWhetter/gyp,chromium/gyp,kevinchen3315/gyp-git,azunite/gyp,sport-monkey/GYP,yinquan529/platform-external-chromium_org-tools-gyp,adblockplus/gyp,chromium/gyp,mapbox/gyp,geekboxzone/lollipop_external_chromium_org_tools_gyp,Phuehvk/gyp,openpeer/webrtc-gyp,amoikevin/gyp,Jack-Q/GYP-copy,mkrautz/gyp-libmumble,sloanyang/gyp,yjhjstz/gyp,sdklite/gyp,erikge/watch_gyp,cysp/gyp,dougbeal/gyp,cysp/gyp,AWhetter/gyp,AOSPU/external_chromium_org_tools_gyp,android-ia/platform_external_chromium_org_tools_gyp,Omegaphora/external_chromium_org_tools_gyp,bpsinc-native/src_tools_gyp,openpeer/webrtc-gyp,Phuehvk/gyp,LazyCodingCat/gyp,pandaxcl/gyp,omasanori/gyp,ttyangf/pdfium_gyp,lukeweber/gyp-override,mapbox/gyp,Phuehvk/gyp,okwasi/gyp,azunite/gyp,chromium/gyp,mistydemeo/gyp,AOSPU/external_chromium_org_tools_gyp,lianliuwei/gyp,svn2github/kgyp,xin3liang/platform_external_chromium_org_tools_gyp,adblockplus/gyp,sdklite/gyp,clar/gyp,channing/gyp,trafi/gyp,saghul/gyn,pandaxcl/gyp,geekboxzone/lollipop_external_chromium_org_tools_gyp,bnoordhuis/gyp,duanhjlt/gyp,AWhetter/gyp,carlTLR/gyp,luvit/gyp,okwasi/gyp,Jack-Q/GYP-copy,ttyangf/gyp,bnoordhuis/gyp,cchamberlain/gyp,svn2github/gyp,svn2github/kgyp,yjhjstz/gyp,omasanori/gyp,duanhjlt/gyp,openpeer/webrtc-gyp,mapbox/gyp,ttyangf/pdfium_gyp,MIPS/external-chromium_org-tools-gyp,Chilledheart/gyp,lianliuwei/gyp,luvit/gyp,okumura/gyp,yangrongwei/gyp,brson/gyp,amoikevin/gyp,svn2github/kgyp,android-ia/platform_external_chromium_org_tools_gyp,clar/gyp,tarc/gyp,AWhetter/gyp,trafi/gyp,pandaxcl/gyp,ryfx/gyp,channing/gyp,lianliuwei/gyp,cysp/gyp,alexcrichton/gyp,luvit/gyp,ryfx/gyp,tarc/gyp,Omegaphora/external_chromium_org_tools_gyp