When linking against a python with shared libraries, this script ONLY asked for the LD flags, not any additional libraries. This could result in a condition where required libraries (such as libutil on Centos 6.7 against Python 2.7) are not loaded and the load of the plugin thus fails. This change asks the python being linked against which libraries it was linked using, and then ensures those are also linked against by the python plugin for weechat.
With this option, the python plugin will be built and linked with Python 3
(if found, or Python 2 as fallback).
This option it not (yet) recommended, because many scripts are working only
with Python 2.x. It should be used only to tests scripts with Python 3.x
in WeeChat.
Note that Python 2.x is still the only Python compiled if found:
Python 3.x is not auto-detected by cmake neither configure.
Many official Python scripts will not load/run with Python 3.x,
so Python 2.x (2.7 or 2.6) is still the recommended version.