aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/envconfig.py
AgeCommit message (Collapse)AuthorFilesLines
2020-09-16envconfig: fix return type of get_env_var_pairDylan Baker1-4/+2
It doesn't return (None, None), it returns just None.
2020-09-13external-project: New module to build configure/make projectsXavier Claessens1-0/+1
This adds an experimental meson module to build projects with other build systems. Closes: #4316
2020-09-08typing: Fix code reviewDaniel Mensinger1-5/+5
2020-09-08typing: fix code reviewDaniel Mensinger1-5/+5
2020-09-08typing: fix envconfig typingDaniel Mensinger1-1/+1
2020-08-30Be stricter when detecting Windows/CygwinChristoph Reiter1-2/+2
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-01machine-files: deprecate the paths sectionDylan Baker1-40/+0
2020-06-29envconfig: Add [constants] section in machine filesXavier Claessens1-28/+1
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-19envconfig: Add support SuperH SH-4Dylan Baker1-2/+3
Fixes: #7358
2020-06-10Updated to resolve issue identifying SGI CPUs on IRIX systemsEric Dodd1-1/+5
2020-05-11Add AVR to cpu families. Closes #7085.Jussi Pakkanen1-0/+1
2020-05-07envconfig: Always honor PKG_CONFIG_PATHDylan Baker1-1/+1
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-04-21switch python2 %s for python3 .formatMichael1-5/+5
2020-04-10Recognize Hurd as platform/OSPino Toscano1-0/+6
2020-03-23Revert "Naturally use env vars a bit more to match Autoconf"Jussi Pakkanen1-2/+2
This reverts commit 097dfc085e6a1bb3c670880134a52dcfca504be7.
2020-03-23Naturally use env vars a bit more to match AutoconfJohn Ericson1-2/+2
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-23Fix legacy env var support with crossJohn Ericson1-49/+65
Fix #3969
2020-03-21-Add xc16 and c2000 C,Cpp toolchain supportalanNz1-0/+3
2020-03-17envconfig: Make compiler and linker environment variables matchDylan Baker1-7/+23
2020-01-23Add m68k to known cpus for Motorola 68000 series processorsDylan Baker1-0/+1
Fixes #6492
2020-01-22environment: Replace LD with <LANG>LDDylan Baker1-1/+9
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-22envconfig: add pkg_config_libdir propertyStéphane Cerveau1-0/+6
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-15envconfig: s390x is 64bitDylan Baker1-0/+1
s390 is the 31/32bit variant, s390x is the 64 bit.
2020-01-15Add s390 to list of known architecturesDylan Baker1-0/+1
Fixes #6411
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-32/+32
2019-12-02Allow selecting the dynamic linkerDylan Baker1-0/+2
This uses the normal meson mechanisms, an LD environment variable or via cross/native files. Fixes: #6057
2019-11-06Fix typos found by codespellWolfgang Stöggl1-1/+1
- Typos were found by codespell v1.16.0
2019-10-20Fix all flake8 warningsDaniel Mensinger1-2/+0
2019-10-15envconfig: Add Alpha CPU familyMatt Turner1-0/+2
2019-09-26envconfig: Add MicroBlaze CPU familyNathan Rossi1-0/+1
Add the CPU family for the MicroBlaze processor. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
2019-09-05mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy1-3/+3
2019-08-27envconfig: make MachineInfo.is_windows and is_cygwin match mesonlibDylan Baker1-2/+2
The mesonlib versions are slightly more specific in what they accept.
2019-08-27envconfig: Add missing MachineInfo is_<os> methodsDylan Baker1-0/+13
mesonlib defines is_sunos, is_dragonflybsd, and is_freebsd, which MachineInfo does not. This should be corrected.
2019-08-23NetBSD detection in envconfig.MachineInfonia1-0/+6
2019-08-05Add basic Webassembly support via Emscripten.Jussi Pakkanen1-0/+3
2019-07-06check that compiler name is not blank or emptyMichael Hirsch, Ph.D1-2/+2
pep8
2019-07-05env: Do not return empty tool env varsMarvin Scholz1-0/+4
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-06-13tvOS: added support AppleTVOSRoman Shpuntov1-2/+2
2019-05-16Make `PerMachine` and `MachineChoice` have just `build` and `host`John Ericson1-35/+1
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-02envconfig: mingw is also WindowsRoss Burton1-2/+2
Also change the same idiom for Darwin to use a set().
2019-05-02mesonlib: Make a few type annotations stringsDylan Baker1-3/+3
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-02Add some type annotations and fix lintsJohn Ericson1-2/+2
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-04-22envconfig: Add type annotationsDylan Baker1-54/+54
2019-04-22envconfig: simplify exception handling.Dylan Baker1-10/+6
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-03-20envconfig: remove unused parse_datafile()Ross Burton1-10/+0
The cross-file cleanup meant this function is no longer used, so remove it.
2019-03-14envconfig: Store whether the cpu_familiy is 64 bitDylan Baker1-0/+13
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-02-27Sync up initialization logic with Properties and BinaryTableJohn Ericson1-6/+27
1. They (and the others) all use PerMachineDefaultable. It's not the best class, but consistency come first. (It and all of them can be improved accross the board later.) 2. They use `None` as the default argument so as not to mutate what's effectively a global variables. (Thanks @dcbaker!) 3. They have a `fallback` field to centralize authority on when environment variables should be consulted.
2019-02-27Move some configuration classes out of environment.pyJohn Ericson1-0/+397
First of all, I'd like compilers and other modules that environment.py currently imports to be able to take these without creating hard-to-follow module cycles. Second of all, environment.py's exact purpose seems a bit obscured. Splitting the data types (and basic pure functions) from the more complex logic that infers that data seems like a good way to separate concerns.