Gov. Deval Patrick has signed a bill authorizing the state to borrow up to $177 million for improvements to the state’s military bases. The measure approved by lawmakers earlier this month would include $9 million in immediate funding for military and civilian runway upgrades at the Barnes Air National Guard Base and adjacent Westfield-Barnes Regional Airport. The bill also authorizes nearly $3 million for energy and communications upgrades at Hanscom Air Force Base. An additional $100,000 would allow for the relocation of the National Guard’s Military Museum from Worcester to Concord.