Firefighters in Portugal are battling to contain wildfires engulfing thousands of hectares amid soaring temperatures.