Commit Graph

11 Commits

Author SHA1 Message Date
Philip Sequeira f4c39c74d4 build: sort dependencies (to make build deterministic)
Fixes #7855.
2020-09-18 02:02:49 +00:00
jnozsc 611c92ef1d *.py: cosmetic changes 2020-02-27 21:36:21 +01:00
wm4 acb28e922b build: use unified dependency expressions instead of weird fields
Instead of "deps", "deps_neg", and "deps_any" fields, just have a single
"deps" field, which changes from an array to a string. The string is now
an expression, which can contain the operators &&, ||, !, and allows
grouping with ( ).

It's probably overkill. If it gets a maintenance burden, we can switch
to specifiying the dep expressions as ASTs (or maybe eval()-able Python
expressions), and we could simplify the code that determines the reason
why a dependency is not fulfilled. The latter involves a complicated
conversion of the expression AST to DNF.

The parser is actually pretty simple, and pretty much follows:
https://en.wikipedia.org/wiki/Shunting_yard_algorithm
2017-09-18 22:35:37 +02:00
wm4 7eca787571 build: change how some OS specific source files are selected
In a bunch of cases, we emulate highly platform specific APIs on a
higher level across all OSes, such as IPC, terminal, subprocess
handling, and more. We have source files for each OS, and they implement
all the same mpv internal API.

Selecting which source file to use on an OS can be tricky, because there
is partially overlapping and emulated APIs (consider Cygwin on Windows).
Add a pick_first_matching_dep() function to make this slightly easier
and more structured.

Also add dummy backends in some cases, to deal with APIs not being
available.

Clarify the Windows dependency identifiers, as these are the most
confusing.
2017-06-29 10:30:16 +02:00
Thomas Nagy d38baa65ca build: Set a default error message for #3692
This change will prevent annoying exceptions from
appearing when error messages are missing.
2016-10-21 17:11:26 +02:00
Stefano Pigozzi d0e19b659e build: make sure the HAVE_ key is undefined on failure
Some particular checks can define the HAVE_ key on their own. To make sure
they work correctly when composed (with compose_checks) we force the HAVE_
key to be undefined if a check fails.
2015-08-19 00:15:41 +02:00
Stefano Pigozzi a3a453b69b build: remove useless class 2015-07-26 15:00:47 +02:00
Stefano Pigozzi 6565c0d979 build: make deps_neg work with multiple dependencies
Previous code only worked id len(deps_neg) was 1.
2013-11-29 23:31:17 +01:00
Stefano Pigozzi e8677aa363 build: make --disable-gl disable all the gl backends
Fixes #369
2013-11-28 09:06:43 +01:00
Stefano Pigozzi 38b7eede1e build: store dependencies as lists
In Python sets are unordered, so iterating them after converting to a list
always leads to different results. The code iterated on them to collect all
the flags to pass to the compiler, and since the order of the flags changed,
waf would rebuild all of the C files. Seems like in Python 2 this worked as
expected by pure chance.

This commit stores the sets as lists, and converts them to sets when the set
operations are needed.

Fixes #363
2013-11-24 14:31:14 +01:00
Stefano Pigozzi 7e2edad8ef switch the build system to waf
This commit adds a new build system based on waf. configure and Makefile
are deprecated effective immediately and someday in the future they will be
removed (they are still available by running ./old-configure).

You can find how the choice for waf came to be in `DOCS/waf-buildsystem.rst`.
TL;DR: we couldn't get the same level of abstraction and customization with
other build systems we tried (CMake and autotools).

For guidance on how to build the software now, take a look at README.md
and the cross compilation guide.

CREDITS:
This is a squash of ~250 commits. Some of them are not by me, so here is the
deserved attribution:

 - @wm4 contributed some Windows fixes, renamed configure to old-configure
   and contributed to the bootstrap script. Also, GNU/Linux testing.
 - @lachs0r contributed some Windows fixes and the bootstrap script.
 - @Nikoli contributed a lot of testing and discovered many bugs.
 - @CrimsonVoid contributed changes to the bootstrap script.
2013-11-21 21:22:36 +01:00