EU leaders agree a conditional deal to help other nations fight global warming, ahead of the Copenhagen climate summit.