With the switch to meson, the problem previously fixed in #1822 came
back. The build system might pick up the installed hexchat-config.h
instead of using the header in the source directory, as the compiler
arguments would be in the order of "-I${prefix}/include -I..".
It seems that the c_args in meson are always put to the front of the
compiler arguments, in order to be able to override any include paths
from dependencies. However, this was not the intention here, so perl
should also be modeled as a dependency. This ensures that the arguments
with local include directories come first.
This was accidentally left behind, expose it beind an option as
with the old build system but default to false now. Enough time
has passed and only distros that care about it can enable it.
Quick rundown of benefits:
- Much faster:
- Autotools (with autogen): 22 seconds
- Meson: 7 seconds
- Meson (with ccache): 2 seconds
- Simpler:
- ~1000 lines smaller
- Single simple language
- Potentially better Windows (Visual Studio) support
What is not done:
- Complete Windows support
- OSX support (easy)
Closes#2013Closes#1937Closes#1803
MAC_OS_X_VERSION_MAX_ALLOWED reflects the currently running OS X version
more closely than MAC_OS_X_VERSION_MIN_REQUIRED, given it's defined as
max(current_version, MAC_OS_X_VERSION_MIN_REQUIRED).
Additionally, we should check if MAC_OS_X_VERSION_10_9 is actually
defined, otherwise the whole macro logic breaks apart.
When hexchat is already installed into a non-default prefix, a new build
could pick up ${prefix}/include/hexchat-plugin.h from the installed
version instead of the local header, as configuration variables such as
$(GLIB_CFLAGS) would point to -I${prefix}/include.
Reordering the includes and moving -I arguments to CPPFLAGS prevents
this, as it ensures the local directories are always searched first.
This was no problem when compiling for /usr or /usr/local as these
directories in the compiler search path are always searched last.
Closes#1822
Use the (deprecated) Gestalt functionality for fetching the fine-grained
OS X version number on 10.9 and lower.
The newer NSOperatingSystemVersion structure is only available on
10.10+.