Add macro allowing to set variable and update list of required definition.
Add macro allowing to set variable and update list of required definition.

This macro will minimize error while defining variable that should
also be added to the list of required definition to allow the
both compile and run test to work as expected.

While updating the code, I also notice that there was a typo associated
with the "_NETBSD_SOURCE" definition. The variable _NETBSD_SOURCE was
set but the definition -DNETBSD_SOURCE=1 was set.

Also add an informational message indicating if XOPEN_SOURCE related
definition are set or not.

thewtex/python-cmake-buildsystem,davidsansome/python-cmake-buildsystem,python-cmake-buildsystem/python-cmake-buildsystem,adrianbroher/python-cmake-buildsystem,msmolens/python-cmake-buildsystem,thewtex/python-cmake-buildsystem,jcfr/python-cmake-buildsystem,chuckatkins/python-cmake-buildsystem