When installing Meson, distutils may choose to put shim scripts in the
`PATH` that only set up the egg requirements before launching the real
`meson.py` contained in the egg.
This means that `__file__` points to the real `meson.py` file, but
launching it directly is doomed to fail as it's missing the metadata
contained in the shim to set up the path egg, resulting in errors when
trying to import the `mesonbuild` module.
A similar issue affects Meson when installed as a zipapp, with the
current code going great lengths to figure out how to relaunch itself.
Using `argv[0]` avoids these issues as it gives us the way the current
executable has been launched, so we are pretty much guaranteed that
using it will create another instance of the same executable. We only
need to resolve relative paths as the current working directory may
get changed before re-launching the script, and using `realpath()` for
that saves us the trouble of manually resolving links and getting caught
in endless loops.
This also mean that `meson_script_file` no longer necessarily point to a
absolute file, so rename it to `_launcher` which hopefully would be less
prone to inducing false assumptions.
With C/C++, on Windows you don't need to pass any arguments for a static
library to be PIC. On UNIX platforms you need to pass -fPIC.
Other languages such as D have compiler-specific PIC arguments required
for PIC support in static libraries on UNIX platforms.
This kwarg allows people to specify which static libraries should be
built with PIC support. This is usually used for static libraries that
will be linked into shared libraries.
W: 31, 4: Duplicate key 'HAVE_UNSETENV' in dictionary (duplicate-key)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* tools/ac_converter: fix undefined variable 'func'
E:283,11: Undefined variable 'func' (undefined-variable)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* tools/ac_converter: use spaces properly in HAVE_SOCKET
C: 97, 0: Exactly one space required after comma
'HAVE_SOCKET' : ('socket',' sys/socket.h'),
^ (bad-whitespace)
This also might cause some issue after conversion.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reuse the standard evaluate_codeblock() parsing since it does proper
error handling, and also handles, for instance, lists in string
arguments (flatten), etc. properly.
We need to declare more variables in advance now, but that should be ok.