Commit Graph

72 Commits

Author SHA1 Message Date
Samay Sharma 2c1ac8ac1d Add LLVM_CONFIG support 2022-08-30 15:06:51 -04:00
Daniel Mensinger 7c320e60f1 cmake: Change assertion into a more useful error (fixes #9925) 2022-08-04 15:23:36 -04:00
Artturin 8a8ab9a8e0 envconfig: add more binutils variables
follow standard variables and allow distributions to remove some entries from their cross-files

ex:
f23acdd24b/common/build-style/meson.sh (L50-L54)

variables chosen from the variables nixos sets
ea0f14a502/pkgs/build-support/bintools-wrapper/setup-hook.sh (L58)

sorted alphabetically
2022-07-31 18:57:53 -04:00
Dylan Baker 9ee0de427c envconfig: use $PKG_CONFIG for pkg-config find_program as well as pkgconfig
It looks like internally we use pkgconfig, even though the installed
name is pkg-config. This fixes `tests cases/common/44 pkgconfig-gen`,
which will ignore PKG_CONFIG and select the wrong pkg-config binary if
you have $PKG_CONFIG set.
2022-03-22 15:15:29 +02:00
Eli Schwartz a009eacc65
treewide: string-quote the first argument to T.cast
Using future annotations, type annotations become strings at runtime and
don't impact performance. This is not possible to do with T.cast though,
because it is a function argument instead of an annotation.

Quote the type argument everywhere in order to have the same effect as
future annotations. This also allows linters to better detect in some
cases that a given import is typing-only.
2022-03-07 19:01:04 -05:00
William Toohey b4d9b2551c Genericise TI compiler and add MSP430 support 2022-02-02 16:45:05 +02:00
Eli Schwartz 4b351aef26
first pass at migrating to dataclasses
In some cases, init variables that accept None as a sentinel and
immediately overwrite with [], are migrated to dataclass field
factories. \o/

Note: dataclasses by default cannot provide eq methods, as they then
become unhashable. In the future we may wish to opt into declaring them
frozen, instead/additionally.
2022-01-10 18:36:57 -05:00
Rafael Silva 26f188fb36 add ft32 cpu family 2021-12-17 17:47:21 +02:00
Dylan Baker ba85c71750 modules/gnome: use envconfig for VAPIGEN
we have a mechanism for doing "this could be an environment variable"
let's use that.
2021-11-01 12:24:25 -07:00
Jussi Pakkanen 4840c86ec9 Add sccache support. 2021-10-25 19:59:49 -04:00
Daniel Mensinger 66b32a4591 holders: Introduce HoldableObject 2021-06-18 23:48:33 +02:00
Randy Yates d7cb58e57d add cpu family csky 2021-05-18 23:17:12 +03:00
Tristan Partin 4c13aa30a1 dependency: Add JDK system dependency
The JDK system dependency is important for detecting JDK include paths
that may be useful when developing a JNI interface.
2021-04-12 10:43:11 -07:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Xiaotian Wu 233afde4cc add loongarch support 2021-02-06 15:16:04 +00:00
Antonin Décimo 39ede12aa5 Fix misspells
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13 12:53:10 -05:00
Dylan Baker 0076db6ff9 move get_env_var_pair to environment
This is only used in environment, so it should live there too.
2021-01-11 11:15:07 -08:00
Dylan Baker f3fcbba1f8 boost: default machine file properties to env var values
This both moves the env reading to configuration time, which is useful,
and also simplifies the implementation of the boost dependency. The
simplification comes from being able to delete basically duplicated code
since the values will be in the Properties if they exist at all.
2021-01-11 11:15:07 -08:00
Dylan Baker e7a5c75285 Move BinaryTable environment lookups to Environment
This means that all the env lookups are done once, at initial configure
time. This has all of the expected advantages.
2021-01-11 11:15:07 -08:00
Dylan Baker 38c7a7590c pull env to program mappings out of BinaryType class
These really aren't pivotal to that class, and they're used outside of
it. In a follow up patch they're not going to be used inside it at all.
2021-01-11 11:15:07 -08:00
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