It appears there was advanced communcation between the spanish governement and the axis powers iabout the possibility of spain entering the war on the axis side in exchange for French morrocco, but terms could not be agreed.
The following website
http://www.ibiblio.org/pha/policy/1940/400808a.html
contains details of documents which talk about fortifications on the Canary Islands to stop a surprise attack by the british.
So it is likely the fortifications were put in place by the spanish government. Indeed one letter from Serrano Su�er, spanish minsiter of foreign affairs, to Ribentrop, german minister of foreirgn affairs, states
"We have in the Canary Islands four batteries, an important group of pursuit planes and machine-gun nests, all of which dispose of the possibility of an English or American landing. One of the bravest generals of our army departed yesterday to take command of the Grand Canary."
Just to confuse matters Hitler in a letter to Franco writes "we have already made batteries available for the Canary Islands" so the batteries may have indeed come form Germany.