summaryrefslogtreecommitdiffstats
path: root/waftools/checks
Commit message (Collapse)AuthorAgeFilesLines
* build: add check_preprocessorNiklas Haas2021-11-031-1/+18
| | | | | This can be used to do things like query the values of preprocessor defines like version macros, among other potential uses.
* build: lua 5.1/5.2: use generic version namesAvi Halachmi (:avih)2021-10-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TL;DR: use --lua=XXX for pkg-config name XXX, e.g. --lua=lua-5.1 . For unversioned 'lua.pc', use the name luadef51/luadef52 . Autodetection remains the same (5.2 names, luajit, 5.1 names). The old names are still supported, but not auto-detected. Before this patch, if one wanted to choose a specific lua version when more than one is installed, then the names were a mess, e.g. 51obsd is also the name detected on Arch linux, and other (distro) names are also not unique to a specific distro/platform. So to ask mpv to choose the package name (specifically, the pkg-config file name), one needs to look at the mpv sources and find the (arbitrary) distro name which has the same lua version naming as they do on their own system, e.g. --lua=51obsd on Arch. This is a pain. Now we add generic names: - luadef51/luadef52 - generic pkg-config lua.pc (version is inside). - lua* - exactly the pkg-config name, e.g. --lua=lua-51 for lua-51.pc (the names are curated, e.g. --lua=foo won't detect foo.pc). - The legacy names (e.g. 51deb) are still supported, but undocumented, and the new generic names take precedence during auto-detection. The fact that the generic names all start with "lua" has an additional benefit that it shows right after "lua" at the output of mpv -v, while the old names start with numbers, so they're first at the list, making it hard to understand that e.g. "51obsd" is the lua version. None of these names are actually used at the mpv code. The C code checks the version using the lua headers (LUA_VERSION_NUM).
* build: lua version: sanitize id before storage (no-op)Avi Halachmi (:avih)2021-10-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | The lua version names which are autodetected/chosen (such as "51deb") are used for two things: - as key for storing the pkg-config compile/link flags. - as ID for config.h and elsewhere - they're sanitized to use "_". Due to some inconsistensies, if the sanitized ID is different than the original name, then the compile/link flags are stored with the original name as key, while the retrieval happens with the sanitized ID - and therefore fails to find the correct flags. The solution is to use the original name only for display purpose at the output of configure, while using the sanitized version for everything else, so that storage and retrieval use the same key. Currently there's no issue and the patch has no effect, because the sanitizer considers all the current names as valid IDs. However, the next commit will add names which the sanitizer modifies, such as "lua-5.1", so this commit makes such names work too.
* mac: drop build support for swift versions earlier than version 4.1der richter2021-01-131-11/+13
| | | | | | | | | | | | this drops support for swift <4.1 and with this support for xcode <=9.2. this was the last setup that is officially working on macOS 10.12. our old legacy build macOS 10.12 + xcode 9.2 is replaced by macOS 10.13 + xcode 9.4.1 with swift 4.1. the macOS 10.13 + xcode 10.1 VM is replaced by the latest macOS 10.14 + xcode 11.3.1 VM. this is the oldest version officially supported by Apple. this is in preparations for the following commit.
* Revert "build: recognize Lua 5.1 on Arch Linux"Philip Sequeira2020-12-221-1/+0
| | | | | | | The existing "51obsd" is identical, and can be used to explicitly select Lua 5.1 on Arch if necessary. This reverts commit 36e569b242a2825b861f8f4bcef9f2ce520bc6d3.
* build: recognize Lua 5.1 on Arch LinuxPhilip Sequeira2020-12-081-0/+1
|
* build: link against single EGL providerJan Palus2020-05-141-1/+28
| | | | | when building with rpi EGL is provided by librcmegl library and libEGL should not be linked then
* build: fallback to default pc file locations on rpiJan Palus2020-05-141-1/+6
|
* build: pick up Lua 5.2 by defaultwm42020-02-291-4/+4
| | | | | | | | | | | | Previously: 5.1 > 5.2 > luajit Now: 5.2 > luajit > 5.1 I randomly decided that this should be done, since I suspect most environments will prefer the highest Lua version anyway. There is not much of a point picking the older one by default. Maybe 5.1 should be dropped fully, but considering we need to stay compatible with luajit, there is no particular incentive for this.
* *.py: cosmetic changesjnozsc2020-02-271-1/+1
|
* build: add check for macOS SDK versionder richter2019-07-211-1/+12
| | | | | this provides an easy way to check for a specific macOS SDK version and with that the availability of features.
* build: bump minimum swift version to 3.0.2Akemi2019-04-021-1/+1
| | | | | | | | | | #6299 reported problems with earlier 3.0.x swift versions. i tested with 3.0.2/SDK 10.12.2 and just assumed it also works with the older 3.0.x swift and 10.12.x SDK versions. due to the unstable nature of swift there were slight API differences that caused build problems. since swift is bundled with the SDK we just bump the minimum swift version.
* build: slightly adjust swift check output messages on failder richter2019-04-021-3/+7
| | | | to make it consistent with the other checks and their output messages.
* build: use StrictVersion for swift version comparisonAkemi2019-04-021-3/+3
|
* wayland: use xdg-decoration if availableemersion2018-11-191-1/+1
|
* build: pass include paths as a list instead of a string in cocoa checkAkemi2018-10-281-1/+1
| | | | | | when passed as a string check_cc tries to split that string, since it assumes that several include paths can be passed to it. instead we just use a list to make it unambiguous.
* add swift as main dependency so all dependencies can be disabled easilyAkemi2018-09-301-0/+2
|
* build: check for Swift version and disable dependencies if neededAkemi2018-09-301-1/+8
|
* Revert "ao_openal: enable building on OSX"Michael Hoang2018-08-261-12/+1
| | | | | | This reverts commit af6126adbe61fb2b6cc780025246d33df93072e6. Apple's OpenAL support is ridiculously out of date, revert back to just using OpenAL Soft on macOS (fixes #4645).
* build: manually add standard library search paths for linkingAkemi2018-06-121-1/+11
| | | | | | | | | | | this reverts commit a174566 since the actually reason for failing has been found. the isysroot flag overwrites the framework and library search paths. though we only need to overwrite the former and there is no way to just overwrite that one. we manually add the standard library search paths to the very end of the linking command, so it won't interfere with the search paths extracted by waf. Fixes #5791
* waf: require wayland-protocols >= 1.14Rostislav Pehlivanov2018-05-201-1/+1
| | | | Needed for the new xdg-wm tiling enums.
* build: bump wayland-protocols requirement to 1.12+Jan Ekström2018-04-291-1/+1
| | | | The stable xdg-shell protocol is only available from this version.
* build: fix dependency check on macOSAkemi2018-02-161-9/+1
| | | | | | | 235eb60 added a needed linking flag, but too soon. this lead to some of the configure checks to fail. add the flag in our build phase. Fixes #5528
* cocoa-cb: initial implementation via opengl-cb APIAkemi2018-02-121-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is meant to replace the old and not properly working vo_gpu/opengl cocoa backend in the future. the problems are various shortcomings of Apple's opengl implementation and buggy behaviour in certain circumstances that couldn't be properly worked around. there are also certain regressions on newer macOS versions from 10.11 onwards. - awful opengl performance with a none layer backed context - huge amount of dropped frames with an early context flush - flickering of system elements like the dock or volume indicator - double buffering not properly working with a none layer backed context - bad performance in fullscreen because of system optimisations all the problems were caused by using a normal opengl context, that seems somewhat abandoned by apple, and are fixed by using a layer backed opengl context instead. problems that couldn't be fixed could be properly worked around. this has all features our old backend has sans the wid embedding, the possibility to disable the automatic GPU switching and taking screenshots of the window content. the first was deemed unnecessary by me for now, since i just use the libmpv API that others can use anyway. second is technically not possible atm because we have to pre-allocate our opengl context at a time the config isn't read yet, so we can't get the needed property. third one is a bit tricky because of deadlocking and it needed to be in sync, hopefully i can work around that in the future. this also has at least one additional feature or eye-candy. a properly working fullscreen animation with the native fs. also since this is a direct port of the old backend of the parts that could be used, though with adaptions and improvements, this looks a lot cleaner and easier to understand. some credit goes to @pigoz for the initial swift build support which i could improve upon. Fixes: #5478, #5393, #5152, #5151, #4615, #4476, #3978, #3746, #3739, #2392, #2217
* build: fix linking to dev SDK on macOSAkemi2018-02-121-1/+21
| | | | | | | | | on macOS mpv was linked to the system SDK which didn't cause any problems as long as the system SDK was the same as the dev SDK. though it started to cause linking warnings when a new xcode version with the SDK for the next macOS was installed. in the worst case it could also cause linking errors. to fix this we explicitly set the SDK path to the SDK that is used for building instead.
* wayland_common: rewrite from scratchRostislav Pehlivanov2017-10-032-3/+16
| | | | | | | | | | | | The wayland code was written more than 4 years ago when wayland wasn't even at version 1.0. This commit rewrites everything in a more modern way, switches to using the new xdg v6 shell interface which solves a lot of bugs and makes mpv tiling-friedly, adds support for drag and drop, adds support for touchscreens, adds support for KDE's server decorations protocol, and finally adds support for the new idle-inhibitor protocol. It does not yet use the frame callback as a main rendering loop driver, this will happen with a later commit.
* Revert "build: rpi: rely on pkgconfig for compiler flags"wm42017-08-151-22/+1
| | | | | | | | | This reverts commit ea40fa36eef15384b4c0218fb102f92f5cd1cdff. This caused strange runtime failure on Raspbian (when running mpv, vc_dispmanx_display_open() returned 0, while other dispmanx using programs were fine). The problem must have been something about the compiler flags, maybe linking order or set of include paths.
* build: simplify OSS checks and remove changes by "bugmen0t"wm42017-06-221-27/+1
| | | | | | | | | | | | | | | | | | The user bugmen0t was apparently a shared github account with publicly available login. Thus, we can't get LGPL relicensing permission from the people who used this account. To relicense successfully, we have to remove all their changes. This commit should remove 20d1fc13, f26fb009, defbe48d. It also should remove whatever test fragments were copied from the ancient configure, as well as some configure logic (potentially that device path stuff). I think this change still preserves the most important use-cases of OSS: BSDs, and the Linux OSS emulation (the latter for testing only). According to an OSS user, the 4front checks were probably broken anyway. The SunAudio stuff was probably for (Open)Solaris, which is dead. ao_oss.c itself will remain GPL, and still contains bugmen0t changes.
* build: remove checks for libGLwm42017-04-261-1/+0
| | | | | | We don't need to link against libGL directly, nor do we need OpenGL headers. The only thing we need is the windowing interop stuff, such as libEGL.
* build: rely on internal GL headers for rpi checkIlya Tumaykin2017-04-261-4/+0
| | | | | Since mpv ships all the required OpenGL defines now, rpi check doesn't need to check system GL headers.
* waftools/checks/generic: hacks for linking against static/shared libskwkam2017-01-281-5/+18
| | | | | | | | | | | | When mpv is being linked against static libraries which have shared libraries as dependencies, linker will throw error because pkg-config with --static flag will return shared libraries which will be placed under the -Wl,-Bstatic section, while pkg-config without --static flag will omit the private libraries required to link the static library. With this function users can modify the wscript to insert the dependencies when necessary. For example, linking FFmpeg with shared OpenSSL and zlib: 'func': check_pkg_config_mixed(['crypto','ssl','z'], 'libavcodec')
* wscript: add LIBRARY_PATH for library detectionkwkam2017-01-281-0/+2
| | | | | | MinGW GCC seems to ignore LIBRARY_PATH which causes problem when some libraries not using pkg-config were installed to local directory
* build: rpi: rely on pkgconfig for compiler flagsIlya Tumaykin2017-01-281-1/+27
| | | | | | | | | | | | | | | | | Upstream provides pkgconfig files for quite some time now [1,2]. Use them to determine the required flags instead of hard coding. This makes cross-compilation easy, which I dare to say is important for many raspberry-pi users. This also prevents picking libEGL and libGLESv2 from mesa when they are present, which can happen with the current code. Good distros should put these pkgconfig files into default pkg-config search path or populate PKG_CONFIG_PATH for users. However, be nice to everybody and manually look into '/opt/vc/lib/pkgconfig' just in case. Hence the PKG_CONFIG_PATH mangling. [1]: https://github.com/raspberrypi/userland/issues/245 [2]: https://github.com/raspberrypi/userland/commit/05d60a01d53dca363bb4286594db1826ffff8762
* ao_openal: enable building on OSXJosh de Kock2016-09-211-1/+12
| | | | Signed-off-by: Josh de Kock <josh@itanimul.li>
* build: Do not link to libGL for egl-drmQuentin Glidic2016-05-201-2/+8
| | | | Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
* build: also use the iconv check on freebsdq662016-05-101-1/+1
| | | | This is necessary to make mpv build out of box on FreeBSD.
* build: add special openbsd case for iconv checkStefano Pigozzi2016-02-011-1/+5
| | | | Fixes #2710
* waf: add "lua51" ("51obsd") to list of possible lua namesDmitrij D. Czarkoff2016-01-111-0/+1
|
* build: remove useless classStefano Pigozzi2015-07-262-15/+10
|
* build: check for lua52Christian Hesse2015-05-131-0/+1
| | | | | | | Arch linux is about to update to lua 5.3.x, but lua 5.2.x will be provided by package lua52, which contains pkg-config file lua52.pc. Signed-off-by: wm4 <wm4@nowhere>
* lua: reject Lua 5.3wm42015-04-011-1/+1
| | | | | | | | | | | | | | It simply doesn't work, and is hard to make work. Lua 5.3 is a different language from 5.1 and 5.2, and is different enough to make adding support a major issue. Most importantly, 5.3 introduced integer types, which completely mess up any code which deals with numbers. I tried to make this a compile time check, but failed. Still at least try to avoid selecting the 5.3 pkg-config package when the generic "lua" name is used (why can't Lua upstream just provide an official .pc file...). Maybe this actually covers all cases. Fixes #1729 (kind of).
* build: make vdpau and dxva2 checks nicerwm42015-03-061-2/+2
| | | | | | Using check_statement() with an empty statement just to check for the header is quite a hack. Fix check_headers() (so it takes a "use" parameter), and use it for the checks instead.
* build: move QuartzCore linking to the cocoa checkStefano Pigozzi2015-02-251-1/+1
| | | | | It's needed for the DisplayLink functions so it must be enabled for the basic cocoa code.
* build: print pkg-config query on failureStefano Pigozzi2015-02-211-0/+2
|
* win32: drop hacks for possibly broken static pthreads-win32 linkingwm42015-01-111-1/+0
| | | | | | | | | | | | We now use threads and other pthread API a lot, and not always we use it from threads created with pthread_create() (or the main thread). As I understand, with static linking we would have to use pthread_win32_thread_attach/detach_np() every time we enter or leave a foreign thread. We don't do this, and it's not feasible either, so it's just broken. This still should work with dynamic pthreads-win32. The MinGW pthread implementation should be unaffected from all of this.
* win32: request UTF-16 API variants, Vista+ APIs, and COM C macroswm42015-01-071-1/+1
| | | | | Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code.
* win32: add native wrappers for pthread functionswm42015-01-011-0/+6
| | | | | | | Off by default, use --enable-win32-internal-pthreads . This probably still needs a lot more testing. It also won't work on Windows XP.
* build: give precedence to Lua52 over LuaJITStefano Pigozzi2014-12-021-2/+1
| | | | | LuaJIT ships with a broken .pc file on OS X (see #1110), and leaving Lua52 last was done only to improve libquvi interoperability.
* build: fix Lua detectionStefano Pigozzi2014-10-251-2/+4
| | | | | | | | | | | | | We need to manually define the flag since we are using a separate identifier for each of the Lua checks. This was done before 9b45b48 by the composed check with a define_key (see waftools/checks/generic.py). The pkg-config check was the only one to not redefine a define key because Waf already does that automatically when we call the generated function with the same identifier as the generator function. Now if they are called with two different arguments we will get two different definitions. Fixes #1218
* Drop libquvi supportwm42014-10-251-23/+3
| | | | | | | | | | | No development activity (or even any sign of life) for almost a year. A replacement based on youtube-dl will probably be provided before the next mpv release. Ask on the IRC channel if you want to test. Simplify the Lua check too: libquvi linking against a different Lua version than mpv was a frequent issue, but with libquvi gone, no direct dependency uses Lua, and such a clash is rather unlikely.
* build: add a check_program checkStefano Pigozzi2014-09-031-1/+6
| | | | | | | | | | | | | | | | | | | This wraps waf's find_program in our own check boilerplate code so that it can be used in the declarative dependencies section of the wscript. Can be used like this: }, { 'name': 'sed', 'desc': 'sed program', 'func': check_program('sed', 'SED'), }, { First argument is the program name, and the second is the waf variable name where the program path will be stored. In this example we will be able to refer to sed with ${{SED}} when creating waf Tasks in wscript_build. /cc @giselher: I think you need this for wayland-scanner.
* build: use -pthread when availableStefano Pigozzi2014-04-271-0/+13
| | | | | | | | | | | | Our code currently tries to link -lpthread and adds stuff like -D_REENTRANT based on the target platform. GCC actually supports to just pass a -pthread compiler and linker flag that will automatically enable threading and define the correct symbols for the platform, so let's try to just use that as our first choice. clang also supports -pthread but it must be used only as a compiler flag, so we also take care of that scenario with this commit.
* Detect Lua on FreeBSDGrzegorz Blach2014-01-151-0/+2
|
* build: fix cocoa configure check on OS X 10.7Stefano Pigozzi2014-01-021-1/+12
| | | | | It failed because the 10.7 SDK doesn't natively support array and dictionary subscripting.
* build: support multiple headers in check_statementStefano Pigozzi2013-12-261-4/+7
| | | | This feature will be used in the next commit.
* build: prefer 4Front OSS to native implementationsbugmen0t2013-12-071-0/+7
| | | | | | | | | | | | | | | | If sys/soundcard.h is actually linux/soundcard.h then it supports only OSSv3 API. This may happen when OSSLIBDIR == /usr while forgetting to replace sys/soundcard.h from glibc. However, after fa620ff waf prefers native implementation which is inferior on Linux. To fix try making waf prefer oss-audio-4front. It's quite unusual to have 4Front OSS installed where native implementation is superior, anyway. Signed-off-by: bugmen0t <@> Make the false positives path also undef the 4Front define. Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com> Fixes #396
* build: fix regression in cross-compilation [2]Stefano Pigozzi2013-12-061-1/+1
| | | | Fixup commit for 5cb8439015f5. getattr only works on dot notation.
* build: fix regression in cross-compilationStefano Pigozzi2013-12-051-1/+1
| | | | Regression was introduced in bf90317ad in an attempt to fix the Lua check.
* build: remove execute kwarg to check_cc when cross-compilingStefano Pigozzi2013-12-042-3/+10
| | |