Refactor GL related code in MAGIC of building ewebkit2

In MAGIC, it merged ugly so that we can't build this in host
This patch make building on host possible