Commit Graph

5915 Commits

Author SHA1 Message Date
Ting-Wei Lan cb36add970 gnome: Distinguish between internal and external linker flags
When an older version of the library being built is installed in the
same prefix as external dependencies, we have to be careful to construct
the linker or compiler command line. If a -L flag from external
dependencoes comes before a -L flag pointing to builddir, it is possible
for the linker to load older libraries from the installation prefix
instead of the newly built ones, which is likely to cause undefined
reference error.

Since the order of dependencies is not significant, we cannot expect
internal dependencies to appear before external dependencies when
recursively iterating the list of dependencies. To make it harder to
make mistakes, linker flags come from internal and external
dependencies are now stored in different order sets. Code using
_get_dependencies_flags are expected to follow the order when
constructing linker command line:

  1. Internal linker flags
  2. LDFLAGS set by users
  3. External linker flags

It is similar to what automake and libtool do for autotools projects.
2018-07-01 21:54:09 +00:00
Christopher Dunn cb2e4877da Debug-log pkg-config calls
resolves #3607
2018-07-01 17:00:33 +00:00
Andrei Alexeyev f7f5e2a725 Don't let build_always take precedence over build_by_default (#3816)
* Don't let build_always take precedence over build_by_default

* Test for proper interaction of build_by_default with build_always

Fixes #3815
2018-07-01 16:55:38 +00:00
Jussi Pakkanen dc683218a4
Proper error message for non-found exe in run_target. Closes #3818 2018-07-01 19:45:03 +03:00
Nirbheek Chauhan 7b2a07bcf9 custom targets: Only add a dependency on absolute path external programs
If the external program is a string that is meant to be searched in
PATH, we can't add a dependency on it at configure time because we don't
know where it will be at compile time.
2018-07-01 13:59:48 +00:00
Nirbheek Chauhan ec29f19c12 Add a helper for fetching of binaries from cross files
A number of cases have to be taken care of while doing this, so
refactor it into a helper on ExternalProgram and use it everywhere.

1. Command is a list of len > 1, use it as-is
2. Command is a list of len == 1 (or a string), use as a string
3. If command is an absolute path, use it as-is
4. If command is not an absolute path, search for it
2018-07-01 13:59:48 +00:00
Nirbheek Chauhan ae8d044cb6 Allow command lists for find_program cross file overrides
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes https://github.com/mesonbuild/meson/issues/3737
2018-07-01 13:59:48 +00:00
Nirbheek Chauhan 6bdacba001
Getting-meson.md: Fix incorrect image link [skip ci] 2018-07-01 18:58:23 +05:30
Nirbheek Chauhan 2cbf7caf5c
Nirbheek/fix pkgconfig library dedup (#3813)
* Add a test case for bad de-dup of -framework args

https://github.com/mesonbuild/meson/issues/3800

* pkgconfig: Don't naively de-dup all arguments

Honestly don't know what I was smoking. Of course the `Libs:` field in
a pkg-config file can have arguments other than -l and -L

Closes https://github.com/mesonbuild/meson/issues/3800

* pkgconfig module: Fix needlessly aggressive de-dup
2018-07-01 12:31:31 +00:00
Jussi Pakkanen 76184bb6b8 Document merge workflow for contributors and maintainers. [skip ci] 2018-07-01 01:11:40 +03:00
Jussi Pakkanen 1f6247d118 Add missing file to manifest. [skip ci] 2018-06-30 23:21:16 +03:00
Jon Turney c151eb4967 Improve logging when dependency is anonymous
Various pieces of logging assume the dependency has a name, and aren't
grammatical if the dependency is '', so say it is anonymous instead.
2018-06-30 13:28:15 +00:00
Jon Turney fd4872ae77 More tests to cover missing fallback for a non-found dependency
Fix logic so we correctly raise an exception about missing fallback in the
case where the dependency is required.
2018-06-30 13:28:15 +00:00
Jon Turney 9efdcfbb8d Fix handling of dependency('', fallback: ['subproject', 'dep'])
Also extend a test case to cover this.
2018-06-30 13:28:15 +00:00
Bruce Richardson af546b52ca fix find_library when cross-compiling 32-bit on 64-bit systems
When find_library is used to find dependencies, meson checks all paths for
libraries with all prefixes that could match. This means that when we are
compiling with -m32 on a 64-bit system, meson will find 64-bit libraries and
assumes that they will work. Naturally that is not the case.

The obvious fix is to do a test link against those libraries, but the extra
wrinkle here is that we need to do a "whole link" so as to test the static
libs. A check with gcc+ld on linux shows that unless there are unresolved
symbols from the main.c file, the static library is never checked so we avoid
the error from an incompatible library.
2018-06-30 11:16:03 +00:00
Jussi Pakkanen bde99eb6c4 Warn if using Clang+asan+b_lundef. Closes #764. 2018-06-30 00:50:06 +03:00
Juergen Hoetzel e1eb84eb9e Add feature footer 2018-06-30 00:29:15 +03:00
Juergen Hoetzel 337301a766 Setup mode-specific `comment-start' and `'comment-end'
Get rid of meson.comment-dwim workaround.
2018-06-30 00:29:15 +03:00
Matthias Klumpp 7618fa81d3 d: Don't fail if -link-defaultlib is manually added to the LDC link args 2018-06-30 00:28:39 +03:00
Alberto Sartori 5715284177 add documentation of meson test --print-errorlogs (#3809) [skip ci] 2018-06-29 13:00:19 +00:00
Dylan Baker f3a8f9c34d Options: treat array option -Dopt= and -Dopt=[] as equivalent
Currently the former will be parsed as [''], while the latter is parsed
as [] in python. This makes for some obnoxious special handling
depending on what the user passes. This is even more obnoxious since for
string type arguments this doesn't require special handling.
2018-06-29 10:56:25 +00:00
Jussi Pakkanen 14fe0985f7 Add upgrade support to the MSI generator. [skip ci] 2018-06-28 00:13:01 +03:00
Marvin Scholz 3232806b08 Fix ExtraFrameworkDependency Framework detection
The name splitting was wrong and would not incorrectly handle folders
with two dots, like Foo.framework.dSYM and treat this as 'Foo' instead
of 'Foo.framework', which would lead to meson detecting dSYM bundles
as frameworks and try to use those like a framework, which is wrong.

Fix #3793
2018-06-27 01:17:15 +03:00
Jon Turney 8b12a71f22 Refine documentation for build_always [skip ci]
We mention this is equivalent to setting both build_by_default and
build_always_stale in the release note, and in the warning emitted when it's
used, but not in the reference manual.
2018-06-26 23:05:01 +03:00
Jussi Pakkanen ce7cdadd37 Fix glib build when using MSI installer. Closes #3762. 2018-06-26 23:01:52 +03:00
Xavier Claessens 32c22ec492 gtkdoc: Use generated types file if there is one
Closes: #3773.
2018-06-26 22:58:45 +03:00
Mathieu Duponchelle d784b5772a ArLinker: Use response files on Windows
ninja chokes when building FFmpeg's static libraries, as the
command line can be larger than 32000.

This was disabled on purpose in #1649, but the rsp syntax was
different: this commit makes it so the options and output file
are still passed on the command line, gcc-ar didn't work
otherwise.
2018-06-25 16:12:35 +00:00
Jussi Pakkanen 87871e7b95 Update documentation about compiler envvars and cross files. [skip ci] 2018-06-24 21:19:49 +03:00
Jussi Pakkanen c08c8117ab Warn if compiler envvars point to cross compilers. Closes #3782. 2018-06-24 21:19:49 +03:00
Jussi Pakkanen 1a6765e631 Return a better warning if compiled executable is invalid. 2018-06-24 21:19:49 +03:00
Alexandre Franke 2aa77c545b Write GNOME all uppercase
GNOME (all caps) is a registered trademark
2018-06-24 21:19:26 +03:00
Alexandre Franke 4378d58a4f Add Fractal 2018-06-24 21:19:26 +03:00
Niklas Claesson 9620755ff7 Print default option values that don't match the current value 2018-06-21 00:56:30 +03:00
Vasu Penugonda 7140afc0a8 Added ARMCLANG compiler support for C/C++ (#3717) 2018-06-21 00:55:39 +03:00
Jussi Pakkanen f3c01a3c4f
Merge pull request #3590 from mesonbuild/testcommand
Made install a top level Meson command.
2018-06-21 00:53:54 +03:00
Jussi Pakkanen c6431fe47e Added documentation. 2018-06-20 20:38:26 +03:00
Jussi Pakkanen 10b094c980 Make it work with current master. 2018-06-20 20:38:26 +03:00
Ross Burton 57b3f98586 gtkdochelper: pass CC to gtkdoc-scangobj
The helper is told what CC to use already, but doesn't pass it to
gtkdoc-scangobj.
2018-06-20 13:53:09 +00:00
Nirbheek Chauhan 86684ad798 Document environment() append/prepend/set with multiple values [skip ci]
Fixes https://github.com/mesonbuild/meson/issues/3761
2018-06-20 13:27:23 +00:00
Nirbheek Chauhan 59696234da gdbus_codegen: Only add autocleanup args if glib is new enough
Fixes https://github.com/mesonbuild/meson/issues/3766
2018-06-20 13:27:23 +00:00
Ross Burton ecde1789b2 Validate cpu_family (#3753)
* environment: validate cpu_family in cross file

* run_unittests: add unittest to ensure CPU family list in docs and environment matches

* run_unittests: skip compiler options test if not in a git repository

* environment: validate the detected cpu_family

* docs: add 32-bit PowerPC and 32/64-bit MIPS to CPU Families table

Names gathered by booting Linux in Qemu and running:

$ python3
import platform; platform.machine()

Partial fix for #3751
2018-06-20 12:45:44 +00:00
Nirbheek Chauhan 9fdf4d83e6 pkgconfig dep: Special-case D link arguments
The D compiler does not implement find_library(), so we can't resolve
these libraries to absolute paths. Keep the old behaviour till that
can be done.
2018-06-20 11:27:08 +00:00
Nirbheek Chauhan 58ae2c9a8c Rename clike_langs to clink_langs for clarity
D is not a 'c-like' language, but it can link to C libraries. The same
might be true of Rust in the future and Go when we add support for it.

This contains no functionality changes.
2018-06-20 11:27:08 +00:00
Nirbheek Chauhan d737488150 dependencies: Don't assume self.compiler is a C compiler
All dependencies were using find_library, has_header, get_define, etc on
self.compiler assuming that it's a compiler that outputs and consumes
C-like libraries. This is not true for D (and in the future, for Rust)
since although they can consume C libraries, they do not use the
C ecosystem.

For such purposes, we now have self.clib_compiler. Nothing uses
self.compiler anymore as a result, and it has been removed.
2018-06-20 11:27:08 +00:00
Nirbheek Chauhan ebda6ef9c8 ninjabackend: Obvious typo, missing space
I checked the original commit, and that space should not be there.
2018-06-20 04:20:50 +00:00
Xavier Claessens 99dd5f34de Downgrade unknown option from exception to warning
It used to be non-fatal warnings but recent command line refactor made
it fatal. It looks like GNOME continuous would break with this change.
To avoid delaying upcoming 0.47.0 release adoption, let's downgrade this
back to warning for now and reconsider after the release.
2018-06-19 20:29:57 +00:00
Xavier Claessens 737f61792c gtkdoc: Fix dependencies not being built before invoking gtkdoc
In GLib when running "ninja gio-doc" without doing a full build first,
it won't build libraries and the generated gio-scan.c gets linked
against system libgio instead.

This fix 2 bugs: gtkdoc() was not passing 'depends' variable down to
_get_dependencies_flags(), and many places had 'if depends' which is
False when 'depends' is an empty list and not only when it's None. There
is no reason for that argument to be optional, we always want to collect
dependencies.
2018-06-19 12:06:43 +00:00
Corentin Noël 4aa848d5d6 Properly name the targets 2018-06-19 03:22:18 +00:00
Corentin Noël 59f87e5cd1 Add more tests to ensure no future regression 2018-06-19 03:22:18 +00:00
Corentin Noël b58f71cd73 gdbus_codegen: Keep the same behavior for all GLib versions
previous version duplicated the outputs disallowing to select only the .c files or the .h files
The docbook output files weren't listed too.
2018-06-19 03:22:18 +00:00