Commit Graph

52 Commits

Author SHA1 Message Date
Jussi Pakkanen d27bad7d6d
Merge pull request #8011 from dcbaker/submit/post-python36-cleanups
Python 3.6 cleanups
2020-11-22 04:28:19 +02:00
Dylan Baker 954219f39e envconfig: use debug for "using * from environment variables messages
These are spammy, and being in the debug log is probably better anyway.
2020-11-21 07:55:10 -08:00
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Daniel Mensinger 7e58f33376
cmake: Add cross compilation support 2020-10-13 17:04:19 +02:00
Dylan Baker a4a53237f1 envconfig: fix return type of get_env_var_pair
It doesn't return (None, None), it returns just None.
2020-09-16 01:32:19 +03:00
Xavier Claessens 9d338200da external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other
build systems.

Closes: #4316
2020-09-13 13:54:47 -04:00
Daniel Mensinger 4253bf6281
typing: Fix code review 2020-09-08 20:15:59 +02:00
Daniel Mensinger e681235e5f
typing: fix code review 2020-09-08 20:15:58 +02:00
Daniel Mensinger ca1878ffb5
typing: fix envconfig typing 2020-09-08 20:15:57 +02:00
Christoph Reiter 0710ad18d9 Be stricter when detecting Windows/Cygwin
This removes the check for "mingw" for platform.system(). The only case I know
where "mingw" is return is if using a msys Python under a msys2 mingw environment.
This combination is not really supported by meson and will result in weird errors,
so remove the check.

The second change is checking sys.platform for cygwin instead of platform.system().
The former is document to return "cygwin", while the latter is not and just
returns uname().

While under Cygwin it uname() always starts with "cygwin" it's not hardcoded in MSYS2
and starts with the environment name. Using sys.platform is safer here.

Fixes #7552
2020-08-30 23:37:46 +03:00
Dylan Baker 601789cc7c machine-files: deprecate the paths section 2020-08-01 22:00:06 -07:00
Xavier Claessens 1c8731a100 envconfig: Add [constants] section in machine files
Machine files already supports `+` operator as an implementation detail,
since it's using eval(). Now make it an officially supported feature and
add a way to define constants that are used while evaluating an entry
value.
2020-06-29 20:16:21 +03:00
Dylan Baker b384f82b9a envconfig: Add support SuperH SH-4
Fixes: #7358
2020-06-19 10:56:09 -07:00
Eric Dodd 71d68a940b Updated to resolve issue identifying SGI CPUs on IRIX systems 2020-06-10 22:16:14 +03:00
Jussi Pakkanen 630a003746 Add AVR to cpu families. Closes #7085. 2020-05-11 14:56:56 -07:00
Dylan Baker 247eecc8fc envconfig: Always honor PKG_CONFIG_PATH
The comment for this code is correct, but the code itself isn't. The way
it's implemented in a cross compile we don't look at PKG_CONFIG_PATH at
all.

Fixes: #7062
2020-05-07 00:01:33 +03:00
Michael c53b637959 switch python2 %s for python3 .format 2020-04-21 00:16:21 +03:00
Pino Toscano a441836773 Recognize Hurd as platform/OS 2020-04-10 11:29:35 -07:00
Jussi Pakkanen 7924e5f9c2 Revert "Naturally use env vars a bit more to match Autoconf"
This reverts commit 097dfc085e.
2020-03-23 18:07:24 +02:00
John Ericson 097dfc085e Naturally use env vars a bit more to match Autoconf
PR #6363 made it so our interpretation of env vars no longer clashed
with Autoconf's: if both Meson and Autoconf would read and env var, both
would do the same things with the value they read.

However, there were still cases that autoconf would read an env var when
meson wouldn't:

 - Autoconf would use `CC` in cross builds too

 - Autoconf would use `CC_FOR_BUILD` in native builds too.

There's no reason Meson can't also do this--if native cross files
overwrite rather than replace env vars, cross files can also overwrite
rather than replace env vars.

Because variables like `CC` are so ubiquitous, and because ignoring them
in cross builds just makes those builds liable to break (and things more
complicated in general), we bring Meson's behavior in line with
Autoconf's.
2020-03-23 17:51:36 +02:00
John Ericson 3a4388e51d Fix legacy env var support with cross
Fix #3969
2020-03-23 17:51:36 +02:00
alanNz 7460292810 -Add xc16 and c2000 C,Cpp toolchain support 2020-03-21 00:47:24 +02:00
Dylan Baker 9074c7f8a4 envconfig: Make compiler and linker environment variables match 2020-03-17 10:40:39 -07:00
Dylan Baker 8c1221b437 Add m68k to known cpus for Motorola 68000 series processors
Fixes #6492
2020-01-23 00:20:01 +02:00
Dylan Baker 730a7b296f environment: Replace LD with <LANG>LD
The rust code is ugly, because rust is annoying. It doesn't invoke a
linker directly (unless that linker is link.exe or lld-link.exe),
instead it invokes the C compiler (gcc or clang usually) to do it's
linking. Meson doesn't have good abstractions for this, though we
probably should because some of the D compilers do the same thing.
Either that or we should just call the c compiler directly, like vala
does.

This changes the public interface for meson, which we don't do unless we
absolutely have to. In this case I think we need to do it. A fair number
of projects have already been using 'ld' in their cross/native files to
get the ld binary and call it directly in custom_targets or generators,
and we broke that. While we could hit this problem again names like
`c_ld` and `cpp_ld` are far less likely to cause collisions than `ld`.
Additionally this gives a way to set the linker on a per-compiler basis,
which is probably in itself very useful.

Fixes #6442
2020-01-22 23:39:33 +02:00
Stéphane Cerveau 958df63dac envconfig: add pkg_config_libdir property
In order to unify the use of sysroot in the cross-file,
the pkg_config_libdir can now be passed directly in the file.
2020-01-22 15:42:13 -05:00
Dylan Baker b092aaff06 envconfig: s390x is 64bit
s390 is the 31/32bit variant, s390x is the 64 bit.
2020-01-15 09:56:13 -08:00
Dylan Baker 3b691a89bd Add s390 to list of known architectures
Fixes #6411
2020-01-15 09:56:13 -08:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Dylan Baker ef9aeb188e Allow selecting the dynamic linker
This uses the normal meson mechanisms, an LD environment variable or via
cross/native files.

Fixes: #6057
2019-12-02 16:39:06 -08:00
Wolfgang Stöggl f037e7ef45 Fix typos found by codespell
- Typos were found by codespell v1.16.0
2019-11-06 09:55:30 -05:00
Daniel Mensinger 80ec5e9d28 Fix all flake8 warnings 2019-10-20 17:44:43 +03:00
Matt Turner 20519a0e1a envconfig: Add Alpha CPU family 2019-10-15 21:47:58 +03:00
Nathan Rossi 2dd5e695c7 envconfig: Add MicroBlaze CPU family
Add the CPU family for the MicroBlaze processor.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
2019-09-26 20:28:42 +03:00
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +03:00
Dylan Baker fe645a0a9e envconfig: make MachineInfo.is_windows and is_cygwin match mesonlib
The mesonlib versions are slightly more specific in what they accept.
2019-08-27 21:07:12 +03:00
Dylan Baker d3a7537346 envconfig: Add missing MachineInfo is_<os> methods
mesonlib defines is_sunos, is_dragonflybsd, and is_freebsd, which
MachineInfo does not. This should be corrected.
2019-08-27 21:07:12 +03:00
nia e085aa089f NetBSD detection in envconfig.MachineInfo 2019-08-23 13:10:25 -07:00
Jussi Pakkanen f41bdae368 Add basic Webassembly support via Emscripten. 2019-08-05 19:31:32 +03:00
Michael Hirsch, Ph.D 324c5b9aae check that compiler name is not blank or empty
pep8
2019-07-06 00:28:58 +03:00
Marvin Scholz 0bf5c27b64 env: Do not return empty tool env vars
A compiler or other tool with an empty string as name does not make
sense as it anyway can not be used and causes a failure later in
parse_entry.

Fix #5451
2019-07-05 20:58:33 +03:00
Roman Shpuntov 3b17344b11 tvOS: added support AppleTVOS 2019-06-13 21:31:03 +03:00
John Ericson 957d8e051c Make `PerMachine` and `MachineChoice` have just `build` and `host`
Meson itself *almost* only cares about the build and host platforms. The
exception is it takes a `target_machine` in the cross file and exposes
it to the user; but it doesn't do anything else with it. It's therefore
overkill to put target in `PerMachine` and `MachineChoice`. Instead, we
make a `PerThreeMachine` only for the machine infos.

Additionally fix a few other things that were bugging me in the process:

 - Get rid of `MachineInfos` class. Since `envconfig.py` was created, it
   has no methods that couldn't just got on `PerMachine`

 - Make `default_missing` and `miss_defaulting` work functionally. That
   means we can just locally bind rather than bind as class vars the
   "unfrozen" configuration. This helps prevent bugs where one forgets
   to freeze a configuration.
2019-05-16 00:27:57 +03:00
Ross Burton ae9a6417fe envconfig: mingw is also Windows
Also change the same idiom for Darwin to use a set().
2019-05-02 14:03:08 -07:00
Dylan Baker edb1229a48 mesonlib: Make a few type annotations strings
Mypy know what to do with these and isn't confused, but some versions of
python 3.5 (at least 3.5.2) can't handle these annotations. By making
them strings the python interpreter wont try to evaluate them.

Fixes #5326
2019-05-02 23:38:36 +03:00
John Ericson 4c2617a9c6 Add some type annotations and fix lints
Some things, like `method[...](...)` or `x: ... = ...` python 3.5
doesn't support, so I made a comment instead with the intention that it
can someday be made into a real annotation.
2019-05-02 10:58:23 -07:00
Dylan Baker 205cf95f99 envconfig: Add type annotations 2019-04-22 13:49:50 -07:00
Dylan Baker b8ec23b69d envconfig: simplify exception handling.
Currently this takes a return value, and in the error case sets it,
then has a separate if to hanle that. Instead just set the return
value in the error handler.
2019-04-22 13:49:50 -07:00
Ross Burton c6abca289b envconfig: remove unused parse_datafile()
The cross-file cleanup meant this function is no longer used, so remove it.
2019-03-20 20:55:32 +02:00
Dylan Baker 914056f68a envconfig: Store whether the cpu_familiy is 64 bit
We'll need this in the llvm-config logic to determine the right
llvm-config to call on Fedora 30+, but this feels like the sort of
information that might be useful elsewhere. This does not expose this
information as part of the public API, it's only accessible at the
python layer.
2019-03-14 23:35:26 +02:00