West Ham have taken Marouane Chamakh on loan from Arsenal for the rest of the season with a view to a permanent deal.