Commit Graph

270 Commits

Author SHA1 Message Date
Janne Grunau 663517d233 detect 'arm64' as aarch64 CPU family
OpenBSD uses arm64 as identifier for the 64-bit ARM architecture.
Refs #1578.
2019-04-01 13:58:05 -07:00
Paolo Bonzini 826ddec4c6 improve log for ninja detection
Print "Found samurai-x.y" when samu is found instead of ninja,
and do not print "Found ninja-1.8-1.8" when NINJA points to
/usr/bin/ninja-1.8.
2019-03-26 22:18:37 +02:00
Paolo Bonzini 6b9b118bf5 support a NINJA environment variable
This can be useful to test a local ninja version (for example while developing
changes to ninja or samurai) without modifying the PATH.

The ninja binary that is detected is then hardcoded in the build.ninja
rules for scan-build and clean, so that it is always used until reconfiguration.
2019-03-26 22:18:37 +02:00
François Revol 31d7255553 Properly detect 'bepc' as 'x86' CPU for Haiku 2019-03-26 22:02:55 +02:00
John Ericson 3037ade41d Inline check_compilers
This function is used just once. It also seems all policy and no
mechanism (it raises, it calls the same function to do all the work
twice in a simple way). This makes it seem to be as a good candidate for
inlining.

`environment` and `coredata` are woefully intertwined and while this
change doesn't fix that, but at least it makes it easier to follow.
2019-03-24 13:33:27 +02:00
Ross Burton 65e59c84a1 mesonbuild: allow multiple --cross-file options
Just like --native-file, allow multiple --cross-file options.  This is mostly
unifying the logic between cross_files and config_files.
2019-03-20 10:06:17 +00:00
Ross Burton d57dd1092e load_configs: generalise the search path
Instead of hard-coding the fact that load_configs() searches for files under
meson/native, pass in the subdirectory allowing the cross-file code to use the
same logic.
2019-03-19 19:16:30 +00:00
Jussi Pakkanen 44dd5535f0
Merge pull request #4724 from jon-turney/lib-machine-always
Fix linking when cross-compiling and a windows resource is first object
2019-03-19 20:39:34 +02:00
jrl64 969e291835 A more verbose RE Definiton in search_version. Closes #5020 2019-03-11 20:29:30 +02:00
Antoine Jacoutot 7bc04996c0 environment: support OpenBSD in detect_objc_compiler
We need to match the "clang --version" output on OpenBSD:
$ clang --version | head -1
OpenBSD clang version 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1)
2019-03-11 11:37:02 +00:00
Jussi Pakkanen 38a3c30bc5 Fix javac version lookup in JDK11. Closes #4322. 2019-03-05 11:25:21 +02:00
John Ericson c2db7a9cee Sync up initialization logic with Properties and BinaryTable
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-27 13:10:16 -08:00
John Ericson 2622e9ec32 Move some configuration classes out of environment.py
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.
2019-02-27 13:10:16 -08:00
John Ericson 8c6d6393f2 Remove redundant definition of `cflags_mapping`
It seems this was erroneously coppied in `54b6afa67`.
2019-02-26 15:44:06 +00:00
Dylan Baker b5d847e38c allow paths to be set in the cross file
Just like the previous patch, but for cross files

Fixes #1433
2019-02-11 12:50:32 -08:00
Dylan Baker 5b896ed70b allow setting directory locations in a native file
This allows the person running configure (either a developer, user, or
distro maintainer) to keep a configuration of where various kinds of
files should end up.
2019-02-11 12:50:32 -08:00
Dylan Baker b50899419c environment: Add class for storing directories from cross and config files 2019-02-11 12:09:25 -08:00
Jussi Pakkanen 902aaf2ce6
Merge pull request #4626 from Ericson2314/consolidate-properties
Go through coreutils.compiler_options.{build.host.target}
2019-02-04 23:06:46 +01:00
Jussi Pakkanen e26b5a119e
Merge pull request #4835 from obilaniu/cudaimprovements
CUDA support improvements
2019-02-04 20:33:26 +01:00
John Ericson 19f81d3e33 Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.

Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so

 - The logic is cross-agnostic, i.e. there are no conditions affected by
   `is_cross_build()`.

 - Compiler args for both the build and host machines can always be
   controlled by the command line.

 - Compiler args for both machines can always be controlled separately.
2019-02-02 13:59:14 -05:00
Nirbheek Chauhan 310b518921 env: Add a repr() for MachineInfo
Makes it easier to debug with print()
2019-01-31 20:36:49 +00:00
Nirbheek Chauhan bd8eff7438 qtdep: Look for QMAKE env var again + sprinkle debug
We used to look for the QMAKE env var in earlier versions of Meson,
start looking for it again.
2019-02-01 00:14:09 +05:30
Olexa Bilaniuk 4199e61389 Better NVCC version detection. 2019-01-31 04:26:37 -05:00
John Ericson 940c6de3ae Overhaul pkg-config and CMake lookup, fixing the latter
First, I noticed there was a dangling use of now-removed cross_info in
the CMake lookup. No tests had caught this, but it means that CMake deps
were totally broken. [It also meant that CMake could not be specified
from a native file.]

In a previous of mine PR which removed cross_info, I overhauled finding
pkg-config a bit so that the native and cross paths were shared. I
noticed that the CMake code greatly resembled the pkg-config code, so I
set about fixing it to match.

I then realized I could refactor things further, separating caching,
finding alternatives, and validating them, while also making the
validations less duplicated. So I ended up changing pkg config lookup a
lot too (and CMake again, to keep matching).

Overall, I think I have the proper ideom for tool lookup now, repated in
two places. I think it would make sense next to share this logic between
these two, compilers, static linkers, and any other tool similarly
specifiable. Either the `BinaryTable` class in environment.py, or a new
class for `Compiler` and friends to subclass, would be good candidates
for this.
2019-01-30 00:12:47 +02:00
Michael Hirsch, Ph.D 8636f31d9c BUGFIX: broken/missing Fortran code/unit tests 2019-01-27 20:57:21 +02:00
Jussi Pakkanen e1b50309df All the fixes needed to make work against current master. 2019-01-21 23:59:20 +02:00
Beau Johnston 54b6afa675 added cuda compiler 2019-01-21 23:35:38 +02:00
Michael Hirsch, Ph.D 72486afd08 Add PGI C and C++ compilers (#4803) 2019-01-21 20:09:36 +02:00
Michael Hirsch, Ph.D b40c1af900
Flang Fortran compiler added. 2019-01-16 17:06:43 -05:00
Daniel Mensinger af38722f89 mintro: Introspection interpreter refactoring (#4733)
* Fixed spelling

* Merged the Buildoptions and Projectinfo interpreter

* Moved detect_compilers to Environment

* Added removed test case

* Split detect_compilers and moved even more code into Environment

* Moved set_default_options to coredata

* Small code simplification in mintro.run

* Move cmd_line_options back to `environment`

We don't actually wish to persist something this unstructured, so we
shouldn't make it a field on `coredata`. It would also be data
denormalization since the information we already store in coredata
depends on the CLI args.
2019-01-16 23:42:54 +02:00
Michael Hirsch, Ph.D fff88b354a restore PGI compile functioning 2019-01-15 20:27:31 +02:00
Antoine Jacoutot e02b79dc1e OpenBSD: register machine cpu "macppc" as cpu_family "ppc"
On OpenBSD, the main PowerPC machine is known as macppc, while the processor
family is powerpc:
$ uname -{m,p}
macppc powerpc
$ echo 'import platform; print (platform.machine())' | python3
macppc
$ echo 'import platform; print (platform.processor())' | python3
powerpc

This allows for e.g. GLib configure to properly detect that cpu:
Build machine cpu family: ppc
Build machine cpu: macppc
While it failed before with: WARNING: Unknown CPU family 'macppc' <snip>
2019-01-13 14:23:16 +02:00
John Ericson 8165fa6ad0 Fix finding the static linker for native compiler in cross build
Native ar and cross ar are not the same!
2019-01-10 23:04:41 +02:00
Jussi Pakkanen 198de0de5d Report parisc64 as parisc. Closes #4714. 2019-01-09 00:13:57 +02:00
Daniel Mensinger 9c214f4a70
Fixed buildoptions form source 2019-01-06 12:19:34 +01:00
Daniel Mensinger d4ac832bf6
Split the monolithic introspection file into chunks 2019-01-06 12:19:29 +01:00
Jon Turney a223b20bb6
Fix linking when cross-compiling and a windows resource is first object
It appears that LIB/LINK default to the host architecture if they can't
guess it from the first object.  With the MSVC toolchain, resource files
are (usually) compiled to an arch-neutral .res format.  Always
explicitly provide a '/MACHINE:' argument to avoid it guessing
incorrectly when cross-compiling.
2019-01-05 20:22:13 +00:00
John Ericson e147054d6f Get rid of `ConfigData` 2019-01-02 16:22:47 -05:00
John Ericson edb3585b65 Simplify config file checking code, inlining `_ok_type` 2019-01-02 16:22:47 -05:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00
John Ericson dbf080afe9 Get rid of `need_cross_compiler`
Building a cross compiler (`build == host != target`) is not cross
compiling. As such, it doesn't make sense to handle it under
`is_cross_build`.

(N.B. Building a standard library for a cross compiler would require
cross compiling, but Meson has support to do such a thing as part of a
compiler build currently.)
2019-01-02 16:11:02 -05:00
Daniel Mensinger c033af914a
Disable mlog and don't require build directory for environment 2018-12-29 23:55:45 +01:00
Daniel Mensinger 10ce5deb71
Introspection refactoring 2018-12-29 23:55:45 +01:00
Jussi Pakkanen 3d7c32a34e
Merge pull request #4451 from jon-turney/simplify-x86-msvc-test
Simplify x86 msvc test
2018-12-29 18:43:13 +02:00
Jussi Pakkanen 131459bd05 Add Renesas RL78 CPU family. Closes #4606. 2018-12-11 20:56:35 +02:00
Jon Turney 4da68b7ba9
Try to handle ARM64 in detect_windows_arch()
Putative changes to handle Windows on ARM64, which can also run x86 code
under WOW64
2018-12-06 13:27:12 +00:00
Jon Turney f3b5c3c27d
Simplify test for x86 targeted MSVC cross-compiler
We can't just do compiler.has_builtin_define('_M_IX86'), because the
VisualStudioCCompiler class doesn't implement has_builtin_define(), and
getting the compiler to disgorge it's builtin defines isn't easy...

But we can now use the target we stored when we identifed the compiler.

Also update comment appropriately
2018-12-06 13:26:51 +00:00
Jon Turney a872b925ea
Store the target architecture for CL-like compilers
Store the MSVC compiler target architecture ('x86', 'x64' or 'ARM' (this
is ARM64, I believe)), rather than just if it's x64 or not.

The regex used for target architecture should be ok, based on this list
of [1] version outputs, but we assume x86 if no match, for safety's
sake.

[1] https://stackoverflow.com/a/1233332/1951600

Also detect arch even if cl outputs version to stdout.

Ditto for clang-cl

Future work: is_64 is now only used in get_instruction_set_args()
2018-12-06 13:25:16 +00:00
Nirbheek Chauhan 0b3a607fd8 Correctly detect 32-bit arm userland on 64-bit arm
This is the same case as 32-bit x86 on x86_64.

Closes https://github.com/mesonbuild/meson/issues/4586
2018-12-05 19:39:01 +02:00
Nirbheek Chauhan 579b5bba12 Reorganize cpu detection code to be more consistent
Use a single point of exit for the detect_cpu* functions, and factor
out the compiler define code into a helper function.
2018-12-05 19:39:01 +02:00