Fearful of an expanding extremist threat, countries that for years have relied heavily on U.S. intelligence are quickly building up their own capabilities with new technology, new laws and—in at...