Fix a compiler warning.
Move Qt detection to configure.ac as it is different between core and plugins.