Cubs agree to deal with former All-Star