From 7e2edad8efea55e8df1faa695d1389ef4e326d7c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 16 Jul 2013 13:28:28 +0200 Subject: 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. --- .gitignore | 6 + .travis.yml | 5 +- DOCS/crosscompile-mingw.txt | 6 +- DOCS/man/docutils.conf | 1 - DOCS/waf-buildsystem.rst | 151 ++ Makefile | 564 ----- README.md | 38 +- TOOLS/osxbundle.py | 20 +- TOOLS/osxbundle/mpv.app/Contents/Info.plist | 2 +- bootstrap.py | 28 + configure | 3620 --------------------------- old-configure | 3573 ++++++++++++++++++++++++++ old-makefile | 565 +++++ osdep/getch2.c | 1 - video/out/x11_common.c | 6 +- waftools/__init__.py | 2 + waftools/checks/__init__.py | 0 waftools/checks/custom.py | 119 + waftools/checks/generic.py | 134 + waftools/dependencies.py | 210 ++ waftools/detections/__init__.py | 0 waftools/detections/compiler.py | 57 + waftools/detections/cpu.py | 28 + waftools/detections/devices.py | 29 + waftools/features.py | 69 + waftools/fragments/cocoa.m | 11 + waftools/fragments/coreaudio.c | 15 + waftools/fragments/dvb.c | 10 + waftools/fragments/ebx.c | 12 + waftools/fragments/gl_x11.c | 9 + waftools/fragments/iconv.c | 30 + waftools/fragments/libavfilter.c | 7 + waftools/fragments/lua.c | 24 + waftools/fragments/lua_libquvi4.c | 3 + waftools/fragments/lua_libquvi9.c | 3 + waftools/fragments/mng.c | 7 + waftools/fragments/oss_audio.c | 11 + waftools/fragments/oss_audio_header.c | 13 + waftools/fragments/pthreads.c | 10 + waftools/fragments/pvr.c | 7 + waftools/fragments/vcd_windows.c | 7 + waftools/fragments/wasapi.c | 19 + waftools/fragments/xf86vm.c | 8 + waftools/fragments/xf86xk.c | 6 + waftools/generators/__init__.py | 0 waftools/generators/headers.py | 36 + waftools/generators/sources.py | 37 + waftools/inflectors.py | 26 + waftools/waf_customizations.py | 46 + wscript | 759 ++++++ wscript_build.py | 459 ++++ 51 files changed, 6585 insertions(+), 4224 deletions(-) create mode 100644 DOCS/waf-buildsystem.rst delete mode 100644 Makefile create mode 100755 bootstrap.py delete mode 100755 configure create mode 100755 old-configure create mode 100644 old-makefile create mode 100644 waftools/__init__.py create mode 100644 waftools/checks/__init__.py create mode 100644 waftools/checks/custom.py create mode 100644 waftools/checks/generic.py create mode 100644 waftools/dependencies.py create mode 100644 waftools/detections/__init__.py create mode 100644 waftools/detections/compiler.py create mode 100644 waftools/detections/cpu.py create mode 100644 waftools/detections/devices.py create mode 100644 waftools/features.py create mode 100644 waftools/fragments/cocoa.m create mode 100644 waftools/fragments/coreaudio.c create mode 100644 waftools/fragments/dvb.c create mode 100644 waftools/fragments/ebx.c create mode 100644 waftools/fragments/gl_x11.c create mode 100644 waftools/fragments/iconv.c create mode 100644 waftools/fragments/libavfilter.c create mode 100644 waftools/fragments/lua.c create mode 100644 waftools/fragments/lua_libquvi4.c create mode 100644 waftools/fragments/lua_libquvi9.c create mode 100644 waftools/fragments/mng.c create mode 100644 waftools/fragments/oss_audio.c create mode 100644 waftools/fragments/oss_audio_header.c create mode 100644 waftools/fragments/pthreads.c create mode 100644 waftools/fragments/pvr.c create mode 100644 waftools/fragments/vcd_windows.c create mode 100644 waftools/fragments/wasapi.c create mode 100644 waftools/fragments/xf86vm.c create mode 100644 waftools/fragments/xf86xk.c create mode 100644 waftools/generators/__init__.py create mode 100644 waftools/generators/headers.py create mode 100644 waftools/generators/sources.py create mode 100644 waftools/inflectors.py create mode 100644 waftools/waf_customizations.py create mode 100644 wscript create mode 100644 wscript_build.py diff --git a/.gitignore b/.gitignore index f4361056da..bf482108b7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.a *.d *.exe +*.pyc .depend /config.h @@ -25,3 +26,8 @@ /DOCS/man/*/mpv.out /DOCS/man/*/mpv.pdf /DOCS/man/*/mpv.toc + +/waf +/build +/.waf* +/.lock-waf_* diff --git a/.travis.yml b/.travis.yml index 4e497eea82..5fc66cd2f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,10 @@ branches: - ci before_install: ./travis-deps libass-stable $LIBAV -script: ./configure && make +script: + - ./bootstrap.py + - ./waf configure + - ./waf build notifications-policy: ¬ifications-policy on_success: change diff --git a/DOCS/crosscompile-mingw.txt b/DOCS/crosscompile-mingw.txt index 8ad59c693f..b971dffdc5 100644 --- a/DOCS/crosscompile-mingw.txt +++ b/DOCS/crosscompile-mingw.txt @@ -3,7 +3,7 @@ produce both 32 bit and 64 bit executables. MinGW-w64 is available from http://mingw-w64.sourceforge.net. You have to run mpv's configure with these arguments: - ./configure --enable-cross-compile --target=i686-w64-mingw32 + DEST_OS=win32 TARGET=i686-w64-mingw32 ./waf configure Using mingw-w64-cmake to setup a MinGW-w64 environment is recommended (this will also build mpv and its dependencies): https://github.com/lachs0r/mingw-w64-cmake @@ -44,8 +44,8 @@ make pthreads git clone https://github.com/mpv-player/mpv.git cd mpv export PATH=/opt/mingw/usr/bin/:$PATH -./configure --enable-cross-compile --target=i686-w64-mingw32 -make +DEST_OS=win32 TARGET=i686-w64-mingw32 ./waf configure +./waf build # This should work. Note however that MXE’s ffmpeg package might be very old # in order to avoid breaking e.g. xine-lib, so you might want to update that diff --git a/DOCS/man/docutils.conf b/DOCS/man/docutils.conf index cd6e3acd52..2e4d0dcf43 100644 --- a/DOCS/man/docutils.conf +++ b/DOCS/man/docutils.conf @@ -10,7 +10,6 @@ latex-preamble: \usepackage[usenames,dvipsnames]{xcolor} \makeatletter \renewcommand{\maketitle}{ \begin{center} - \includegraphics{etc/mpv-icon-8bit-64x64.png}\\ \vspace*{-1.5em} \begin{Huge} \@title diff --git a/DOCS/waf-buildsystem.rst b/DOCS/waf-buildsystem.rst new file mode 100644 index 0000000000..ca52531501 --- /dev/null +++ b/DOCS/waf-buildsystem.rst @@ -0,0 +1,151 @@ +waf build system overview +========================= + +mpv's new build system is based on waf and it should completly replace the +custom ./configure + Makefile based system inherited from MPlayer. + +Goals and the choice of waf +=========================== + +The new system comes with some goals, which can be summed up as: be as good as +the old one at what it did well (customizability) and fix some of it's major +shortcomings: + +1) The build system must be uniform in how it handles any single feature check. + Repetition and boilerplate have to be avoided. + + When adding a new feature using the old configure, one had to add a fair + amount of code to the shell script to do option parsing, detection of the + feature and declaration of variables for the Makefile to pickup. The worst + part is this pieces are spread apart in the configure and copy pasted for + any single case. That brings us to.. + +2) --enable-feature has to override the user and help him understand that he + has libraries missing and should install them for the feature to be enabled. + +3) Must be customizable, hackable, pleasant to the developer eyes and to work + with in general. + +4) Must have separate configuration and build steps. + +Goal 2 comes as a given on pretty much any build system, since autotools made +this behaviour very popular among users (and rightly so). + +Goal 1+3 were somewhat harder to accomplish as it looks like all of the build +systems we evaluated (waf included!) had problems with them. For reference we +had proof of concept build systems with waf, CMake and autotools. + +What puts waf apart from CMake and autotools, is that projects using it use +Python to program their build system. Also while the Waf Book shows really +simple API usages, you can write your own build system on top of waf that is +tailored to the project's specific needs. + +mpv's custom configure step on top of waf +========================================= + +To some extents mpv has a custom build system written on top of waf. This +document will not go over the standard waf behaviour as that is documented in +the ``Waf book``. + +All of the configuration process is handled with a declarative approach. Lists +of dictionaries define the checks, and some custom Python code traverses these +lists and depending on the check definition it calls into the actual waf API. + +A simple example using pkg-config would be:: + + { + 'name': '--vdpau', + 'desc': 'VDPAU acceleration', + 'deps': [ 'x11' ], + 'func': check_pkg_config('vdpau', '>= 0.2'), + } + +This defines a feature called ``vdpau`` which can be enabled or disabled by +the users with configure flags (that's the meaning of ``--``). This feature +depends on another feature whose name is ``x11``, and the autodetection check +consists of running ``pkg-config`` and looking for ``vdpau`` with version +``>= 0.2``. If the check succeds a ``#define HAVE_VDPAU 1`` will be added to +``config.h``, if not ``#define HAVE_VDPAU 0`` will be added. + +The defines names are automatically prepended with ``HAVE_``, capitalized and +special characters are replaced with underscores. This happens in +``waftools/inflectors.py``. + +Mandatory fields: +----------------- + +``name``: indicates the unique identifier used by the custom dependency code +to refer to a feature. If the unique identifier is prepended with ``--`` +the build system will also generate options for ``./waf configure`` so that +the feature can be enabled and disabled. + +``desc``: this is the textual representation of the feature used in the +interactions with the users. + +``func``: function that will perform the check. These functions are defined in +``waftools/checks``. The reusable checks are all functions that return +functions. The return functions will then be applied using waf's configuration +context. + +The source code for the reusable checks is a bit convoluted, but it should be +easy to pick up their usage from the ``wscript``. Their signature mirrors +the semantics of some of the shell functions used in mplayer. + +If someone expresses some interest, I will extend this document with official +documentation for each check function. + +Optional fields +--------------- + +``deps``: list of dependencies of this feature. It is a list of names of +other features as defined in the ``name`` field (minus the eventual leading +``--``). All of the dependencies must be satisfied. If they are not the check +will be skipped without even running ``func``. + +``deps_any``: like deps but it is satisfied even if only one of the dependencies +is satisfied. You can think of ``deps`` as a 'and' condition and ``deps_any`` +as a 'or' condition. + +``deps_neg``: like deps but it is satisfied when none of the dependencies is +satisfied. + +``req``: defaults to False. If set to True makes this feature a hard +dependency of mpv (configuration will fail if autodetection fails). If set to +True you must also provide ``fmsg``. + +``fmsg``: string with the failure message in case a required dependency is not +satisfied. + +``os_specific_checks``: this takes a dictionary that has ``os-`` dependencies +as keys (such as ``os-win32``), and by values has another dictionary that is +merged on top of the current feature definition only for that specific OS. +For example:: + + { + 'name': '--pthreads', + 'desc': 'POSIX threads', + 'func': check_pthreads, + 'os_specific_checks': { + 'os-win32': { + 'func': check_pthreads_w32_static. + } + } + } + +will override the value of ``func`` with ``check_pthreads_w32_static`` only +if the target OS of the build is Windows. + +mpv's custom build step on top of waf +===================================== + +Build step is pretty much vanilla waf. The only difference being that the list +of source files can contain both strings or tuples. If a tuple is found, +the second element in the tuple will the used to match the features detected +in the configure step (the ``name`` field described above). If this feature +was not enabled during configure, the source file will not be compiled in. + +All of the custom Python for this is inside the function ``filtered_sources`` +contained in the file ``waftools/dependencies.py``. + +Also ``dependencies_use`` and ``dependencies_includes`` collect cflags and +ldflags that were generated from the features checks in the configure step. diff --git a/Makefile b/Makefile deleted file mode 100644 index 9323b2e72a..0000000000 --- a/Makefile +++ /dev/null @@ -1,564 +0,0 @@ -# MPlayer Makefile -# -# copyright (c) 2008 Diego Biurrun -# Rewritten entirely from a set of Makefiles written by Arpi and many others. -# -# This file is part of MPlayer. -# -# MPlayer is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# MPlayer is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with MPlayer; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -include config.mak - -###### variable declarations ####### - -SOURCES_AUDIO_INPUT-$(ALSA) += stream/ai_alsa1x.c -SOURCES_AUDIO_INPUT-$(OSS) += stream/ai_oss.c -SOURCES_AUDIO_INPUT-$(SNDIO) += stream/ai_sndio.c -SOURCES-$(AUDIO_INPUT) += $(SOURCES_AUDIO_INPUT-yes) -SOURCES-$(CDDA) += stream/stream_cdda.c \ - stream/cdinfo.c -SOURCES-$(DVBIN) += stream/dvb_tune.c \ - stream/stream_dvb.c -SOURCES-$(DVDREAD) += stream/stream_dvd.c \ - stream/stream_dvd_common.c - -SOURCES-$(HAVE_SYS_MMAN_H) += audio/filter/af_export.c -SOURCES-$(LADSPA) += audio/filter/af_ladspa.c -SOURCES-$(LIBASS) += sub/ass_mp.c sub/sd_ass.c \ - demux/demux_libass.c - -SOURCES-$(LIBBLURAY) += stream/stream_bluray.c -SOURCES-$(LIBBS2B) += audio/filter/af_bs2b.c - -SOURCES-$(LIBPOSTPROC) += video/filter/vf_pp.c -SOURCES-$(LIBSMBCLIENT) += stream/stream_smb.c - -SOURCES-$(COCOA) += video/out/cocoa/view.m \ - video/out/cocoa/window.m \ - video/out/cocoa/additions.m \ - video/out/cocoa_common.m \ - osdep/macosx_application.m \ - osdep/macosx_events.m \ - osdep/ar/HIDRemote.m \ - osdep/path-macosx.m - -SOURCES-$(MPG123) += audio/decode/ad_mpg123.c - -SOURCES-$(NEED_GETTIMEOFDAY) += osdep/gettimeofday.c -SOURCES-$(NEED_GLOB) += osdep/glob-win.c -SOURCES-$(WIN32) += osdep/path-win.c - -SOURCES-$(PRIORITY) += osdep/priority.c -SOURCES-$(PVR) += stream/stream_pvr.c -SOURCES-$(RADIO) += stream/stream_radio.c -SOURCES-$(RADIO_CAPTURE) += stream/audio_in.c -SOURCES-$(STREAM_CACHE) += stream/cache.c - -SOURCES-$(TV) += stream/stream_tv.c stream/tv.c \ - stream/frequencies.c stream/tvi_dummy.c - -SOURCES-$(TV_V4L2) += stream/tvi_v4l2.c stream/audio_in.c -SOURCES-$(VCD) += stream/stream_vcd.c -SOURCES-$(DUMMY_OSD) += sub/osd_dummy.c -SOURCES-$(LIBASS_OSD) += sub/osd_libass.c - -SOURCES-$(ALSA) += audio/out/ao_alsa.c -SOURCES-$(CACA) += video/out/vo_caca.c -SOURCES-$(SDL) += audio/out/ao_sdl.c -SOURCES-$(SDL2) += video/out/vo_sdl.c -SOURCES-$(COREAUDIO) += audio/out/ao_coreaudio.c \ - audio/out/ao_coreaudio_utils.c \ - audio/out/ao_coreaudio_properties.c -SOURCES-$(COREVIDEO) += video/out/vo_corevideo.c -SOURCES-$(DIRECT3D) += video/out/vo_direct3d.c \ - video/out/w32_common.c -SOURCES-$(DSOUND) += audio/out/ao_dsound.c -SOURCES-$(WASAPI) += audio/out/ao_wasapi.c -SOURCES-$(GL) += video/out/gl_common.c video/out/gl_osd.c \ - video/out/vo_opengl.c video/out/gl_lcms.c \ - video/out/gl_video.c video/out/dither.c \ - video/out/vo_opengl_old.c \ - video/out/pnm_loader.c - -SOURCES-$(ENCODING) += video/out/vo_lavc.c audio/out/ao_lavc.c \ - mpvcore/encode_lavc.c - -SOURCES-$(GL_WIN32) += video/out/w32_common.c video/out/gl_w32.c -SOURCES-$(GL_X11) += video/out/x11_common.c video/out/gl_x11.c -SOURCES-$(GL_COCOA) += video/out/gl_cocoa.c -SOURCES-$(GL_WAYLAND) += video/out/wayland_common.c \ - video/out/gl_wayland.c - -SOURCES-$(JACK) += audio/out/ao_jack.c -SOURCES-$(JOYSTICK) += mpvcore/input/joystick.c -SOURCES-$(LIBQUVI) += mpvcore/resolve_quvi.c -SOURCES-$(LIBQUVI9) += mpvcore/resolve_quvi9.c -SOURCES-$(LIRC) += mpvcore/input/lirc.c -SOURCES-$(OPENAL) += audio/out/ao_openal.c -SOURCES-$(OSS) += audio/out/ao_oss.c -SOURCES-$(PULSE) += audio/out/ao_pulse.c -SOURCES-$(PORTAUDIO) += audio/out/ao_portaudio.c -SOURCES-$(RSOUND) += audio/out/ao_rsound.c -SOURCES-$(SNDIO) += audio/out/ao_sndio.c -SOURCES-$(VDPAU) += video/vdpau.c video/out/vo_vdpau.c -SOURCES-$(VDPAU_GL_X11) += video/out/gl_hwdec_vdpau.c -SOURCES-$(VDA) += video/decode/vda.c -SOURCES-$(VDPAU_DEC) += video/decode/vdpau.c -SOURCES-$(VDPAU_DEC_OLD) += video/decode/vdpau_old.c -SOURCES-$(VAAPI) += video/out/vo_vaapi.c \ - video/decode/vaapi.c \ - video/vaapi.c -SOURCES-$(VAAPI_VPP) += video/filter/vf_vavpp.c -SOURCES-$(VAAPI_GLX) += video/out/gl_hwdec_vaglx.c - -SOURCES-$(X11) += video/out/vo_x11.c video/out/x11_common.c -SOURCES-$(XV) += video/out/vo_xv.c -SOURCES-$(WAYLAND) += video/out/vo_wayland.c video/out/wayland_common.c - -SOURCES-$(VF_LAVFI) += video/filter/vf_lavfi.c -SOURCES-$(AF_LAVFI) += audio/filter/af_lavfi.c - -SOURCES-$(LUA) += mpvcore/player/mp_lua.c - -ifeq ($(HAVE_AVUTIL_REFCOUNTING),no) - SOURCES-yes += video/decode/lavc_dr1.c -endif - -SOURCES-$(DLOPEN) += video/filter/vf_dlopen.c - -SOURCES = audio/audio.c \ - audio/audio_buffer.c \ - audio/chmap.c \ - audio/chmap_sel.c \ - audio/fmt-conversion.c \ - audio/format.c \ - audio/mixer.c \ - audio/reorder_ch.c \ - audio/decode/ad_lavc.c \ - audio/decode/ad_spdif.c \ - audio/decode/dec_audio.c \ - audio/filter/af.c \ - audio/filter/af_center.c \ - audio/filter/af_channels.c \ - audio/filter/af_convert24.c \ - audio/filter/af_convertsignendian.c \ - audio/filter/af_delay.c \ - audio/filter/af_dummy.c \ - audio/filter/af_equalizer.c \ - audio/filter/af_extrastereo.c \ - audio/filter/af_format.c \ - audio/filter/af_hrtf.c \ - audio/filter/af_karaoke.c \ - audio/filter/af_lavcac3enc.c \ - audio/filter/af_lavrresample.c \ - audio/filter/af_pan.c \ - audio/filter/af_scaletempo.c \ - audio/filter/af_sinesuppress.c \ - audio/filter/af_sub.c \ - audio/filter/af_surround.c \ - audio/filter/af_sweep.c \ - audio/filter/af_drc.c \ - audio/filter/af_volume.c \ - audio/filter/filter.c \ - audio/filter/tools.c \ - audio/filter/window.c \ - audio/out/ao.c \ - audio/out/ao_null.c \ - audio/out/ao_pcm.c \ - demux/codec_tags.c \ - demux/demux.c \ - demux/demux_edl.c \ - demux/demux_cue.c \ - demux/demux_lavf.c \ - demux/demux_mf.c \ - demux/demux_mkv.c \ - demux/demux_playlist.c \ - demux/demux_raw.c \ - demux/demux_subreader.c \ - demux/ebml.c \ - demux/mf.c \ - mpvcore/asxparser.c \ - mpvcore/av_common.c \ - mpvcore/av_log.c \ - mpvcore/av_opts.c \ - mpvcore/bstr.c \ - mpvcore/charset_conv.c \ - mpvcore/codecs.c \ - mpvcore/cpudetect.c \ - mpvcore/m_config.c \ - mpvcore/m_option.c \ - mpvcore/m_property.c \ - mpvcore/mp_common.c \ - mpvcore/mp_msg.c \ - mpvcore/mp_ring.c \ - mpvcore/options.c \ - mpvcore/parser-cfg.c \ - mpvcore/parser-mpcmd.c \ - mpvcore/path.c \ - mpvcore/playlist.c \ - mpvcore/playlist_parser.c \ - mpvcore/version.c \ - mpvcore/input/input.c \ - mpvcore/player/audio.c \ - mpvcore/player/configfiles.c \ - mpvcore/player/command.c \ - mpvcore/player/loadfile.c \ - mpvcore/player/main.c \ - mpvcore/player/misc.c \ - mpvcore/player/osd.c \ - mpvcore/player/playloop.c \ - mpvcore/player/screenshot.c \ - mpvcore/player/sub.c \ - mpvcore/player/video.c \ - mpvcore/player/timeline/tl_matroska.c \ - mpvcore/player/timeline/tl_mpv_edl.c \ - mpvcore/player/timeline/tl_cue.c \ - osdep/io.c \ - osdep/numcores.c \ - osdep/timer.c \ - osdep/threads.c \ - stream/cookies.c \ - stream/rar.c \ - stream/stream.c \ - stream/stream_avdevice.c \ - stream/stream_edl.c \ - stream/stream_file.c \ - stream/stream_lavf.c \ - stream/stream_memory.c \ - stream/stream_mf.c \ - stream/stream_null.c \ - stream/stream_rar.c \ - sub/dec_sub.c \ - sub/draw_bmp.c \ - sub/find_subfiles.c \ - sub/img_convert.c \ - sub/sd_lavc.c \ - sub/sd_lavc_conv.c \ - sub/sd_lavf_srt.c \ - sub/sd_microdvd.c \ - sub/sd_movtext.c \ - sub/sd_spu.c \ - sub/sd_srt.c \ - sub/spudec.c \ - sub/sub.c \ - ta/ta.c \ - ta/ta_utils.c \ - ta/ta_talloc.c \ - video/csputils.c \ - video/fmt-conversion.c \ - video/image_writer.c \ - video/img_format.c \ - video/mp_image.c \ - video/mp_image_pool.c \ - video/sws_utils.c \ - video/decode/dec_video.c \ - video/decode/vd.c \ - video/decode/vd_lavc.c \ - video/filter/vf.c \ - video/filter/pullup.c \ - video/filter/vf_crop.c \ - video/filter/vf_delogo.c \ - video/filter/vf_divtc.c \ - video/filter/vf_down3dright.c \ - video/filter/vf_dsize.c \ - video/filter/vf_eq.c \ - video/filter/vf_expand.c \ - video/filter/vf_flip.c \ - video/filter/vf_format.c \ - video/filter/vf_gradfun.c \ - video/filter/vf_hqdn3d.c \ - video/filter/vf_ilpack.c \ - video/filter/vf_mirror.c \ - video/filter/vf_noformat.c \ - video/filter/vf_noise.c \ - video/filter/vf_phase.c \ - video/filter/vf_pullup.c \ - video/filter/vf_rotate.c \ - video/filter/vf_scale.c \ - video/filter/vf_screenshot.c \ - video/filter/vf_softpulldown.c \ - video/filter/vf_stereo3d.c \ - video/filter/vf_sub.c \ - video/filter/vf_swapuv.c \ - video/filter/vf_unsharp.c \ - video/filter/vf_vo.c \ - video/filter/vf_yadif.c \ - video/out/bitmap_packer.c \ - video/out/aspect.c \ - video/out/filter_kernels.c \ - video/out/vo.c \ - video/out/vo_null.c \ - video/out/vo_image.c \ - osdep/$(GETCH) \ - osdep/$(TIMER) \ - $(SOURCES-yes) - -OBJECTS += $(addsuffix .o, $(basename $(SOURCES))) -OBJECTS-$(PE_EXECUTABLE) += osdep/mpv-rc.o -OBJECTS += $(OBJECTS-yes) - -DEP_FILES = $(patsubst %.S,%.d,$(patsubst %.cpp,%.d,$(patsubst %.c,%.d,$(SOURCES:.m=.d) $(SOURCES:.m=.d)))) - -ALL_TARGETS += mpv$(EXESUF) - -INSTALL_BIN += install-mpv -INSTALL_BIN_STRIP += install-mpv-strip -INSTALL_MAN = -INSTALL_PDF = - -ifeq ($(BUILD_MAN),yes) - INSTALL_MAN += install-mpv-man - ALL_TARGETS += DOCS/man/en/mpv.1 -endif - -ifeq ($(BUILD_PDF),yes) - INSTALL_PDF += install-mpv-pdf - ALL_TARGETS += DOCS/man/en/mpv.pdf -endif - -DIRS = . \ - audio \ - audio/decode \ - audio/filter \ - audio/out \ - mpvcore \ - mpvcore/input \ - mpvcore/timeline \ - demux \ - osdep \ - osdep/ar \ - stream \ - sub \ - video \ - video/decode \ - video/filter \ - video/out - - -ADDSUFFIXES = $(foreach suf,$(1),$(addsuffix $(suf),$(2))) -ADD_ALL_DIRS = $(call ADDSUFFIXES,$(1),$(DIRS)) -ADD_ALL_EXESUFS = $(1) $(call ADDSUFFIXES,$(EXESUFS_ALL),$(1)) - -###### brief build output ####### - -ifndef V -$(eval override CC = @printf "CC\t$$@\n"; $(CC)) -$(eval override RM = @$(RM)) -endif - -###### generic rules ####### - -all: $(ALL_TARGETS) - -%.tex: %.rst - $(RST2LATEX) --config=DOCS/man/docutils.conf $< $@ - -%.pdf: %.tex - pdflatex -interaction=batchmode -jobname=$(basename $@) $<; pdflatex -interaction=batchmode -jobname=$(basename $@) $< - -%.1: %.rst - $(RST2MAN) $< $@ - -%.o: %.S - $(CC) $(DEPFLAGS) $(CFLAGS) -c -o $@ $< - -%.o: %.c - $(CC) $(DEPFLAGS) $(CFLAGS) -c -o $@ $< - -%.o: %.cpp - $(CC) $(DEPFLAGS) $(CXXFLAGS) -c -o $@ $< - -%.o: %.m - $(CC) $(DEPFLAGS) $(CFLAGS) -c -o $@ $< - -%-rc.o: %.rc - $(WINDRES) -I. $< $@ - -mpv$(EXESUF): $(OBJECTS) -mpv$(EXESUF): - $(CC) -o $@ $^ $(EXTRALIBS) - -mpvcore/input/input.c: mpvcore/input/input_conf.h -mpvcore/input/input_conf.h: TOOLS/file2string.pl etc/input.conf - ./$^ >$@ - -MKVLIB_DEPS = TOOLS/lib/Parse/Matroska.pm \ - TOOLS/lib/Parse/Matroska/Definitions.pm \ - TOOLS/lib/Parse/Matroska/Element.pm \ - TOOLS/lib/Parse/Matroska/Reader.pm \ - TOOLS/lib/Parse/Matroska/Utils.pm \ - -demux/ebml.c demux/demux_mkv.c: demux/ebml_types.h -demux/ebml_types.h: TOOLS/matroska.pl $(MKVLIB_DEPS) - ./$< --generate-header > $@ - -demux/ebml.c: demux/ebml_defs.c -demux/ebml_defs.c: TOOLS/matroska.pl $(MKVLIB_DEPS) - ./$< --generate-definitions > $@ - -video/out/gl_video.c: video/out/gl_video_shaders.h -video/out/gl_video_shaders.h: TOOLS/file2string.pl video/out/gl_video_shaders.glsl - ./$^ >$@ - -video/out/x11_common.c: video/out/x11_icon.inc -video/out/x11_icon.inc: TOOLS/file2string.pl video/out/x11_icon.bin - ./$^ >$@ - -sub/osd_libass.c: sub/osd_font.h -sub/osd_font.h: TOOLS/file2string.pl sub/osd_font.otf - ./$^ >$@ - -mpvcore/player/mp_lua.c: mpvcore/player/lua/defaults.inc -mpvcore/player/lua/defaults.inc: TOOLS/file2string.pl mpvcore/player/lua/defaults.lua - ./$^ >$@ - -mpvcore/player/mp_lua.c: mpvcore/player/lua/assdraw.inc -mpvcore/player/lua/assdraw.inc: TOOLS/file2string.pl mpvcore/player/lua/assdraw.lua - ./$^ >$@ - -mpvcore/player/mp_lua.c: mpvcore/player/lua/osc.inc -mpvcore/player/lua/osc.inc: TOOLS/file2string.pl mpvcore/player/lua/osc.lua - ./$^ >$@ - -# ./configure must be rerun if it changed -config.mak: configure - @echo "############################################################" - @echo "####### Please run ./configure again - it's changed! #######" - @echo "############################################################" - -version.h .version: version.sh - ./$< - -# Force version.sh to run to potentially regenerate version.h --include .version - -%$(EXESUF): %.c - $(CC) $(CFLAGS) -o $@ $^ - - -###### dependency declarations / specific CFLAGS ###### - -mpvcore/version.c osdep/mpv-rc.o: version.h - -osdep/mpv-rc.o: osdep/mpv.exe.manifest etc/mpv-icon.ico - -DOCS/man/en/mpv.1 DOCS/man/en/mpv.pdf: DOCS/man/en/af.rst \ - DOCS/man/en/ao.rst \ - DOCS/man/en/changes.rst \ - DOCS/man/en/encode.rst \ - DOCS/man/en/input.rst \ - DOCS/man/en/options.rst \ - DOCS/man/en/vf.rst \ - DOCS/man/en/vo.rst - -###### installation / clean / generic rules ####### - -install: $(INSTALL_BIN) install-data $(INSTALL_MAN) $(INSTALL_PDF) -install-no-man: $(INSTALL_BIN) install-data -install-strip: $(INSTALL_BIN_STRIP) install-data $(INSTALL_MAN) $(INSTALL_PDF) -install-strip-no-man: $(INSTALL_BIN_STRIP) install-data - -install-dirs: - if test ! -d $(BINDIR) ; then $(INSTALL) -d $(BINDIR) ; fi - -install-%: %$(EXESUF) install-dirs - $(INSTALL) -m 755 $< $(BINDIR) - -install-%-strip: %$(EXESUF) install-dirs - $(INSTALL) -m 755 -s $< $(BINDIR) - -install-mpv-man: install-mpv-man-en - -install-mpv-man-en: DOCS/man/en/mpv.1 - if test ! -d $(MANDIR)/man1 ; then $(INSTALL) -d $(MANDIR)/man1 ; fi - $(INSTALL) -m 644 DOCS/man/en/mpv.1 $(MANDIR)/man1/ - -install-mpv-pdf: install-mpv-pdf-en - -install-mpv-pdf-en: DOCS/man/en/mpv.pdf - if test ! -d $(DOCDIR) ; then $(INSTALL) -d $(DOCDIR) ; fi - $(INSTALL) -m 644 DOCS/man/en/mpv.pdf $(DOCDIR)/ - -ICONSIZES = 16x16 32x32 64x64 - -define ICON_INSTALL_RULE -install-mpv-icon-$(size): etc/mpv-icon-8bit-$(size).png - $(INSTALL) -d $(prefix)/share/icons/hicolor/$(size)/apps - $(INSTALL) -m 644 etc/mpv-icon-8bit-$(size).png $(prefix)/share/icons/hicolor/$(size)/apps/mpv.png -endef - -$(foreach size,$(ICONSIZES),$(eval $(ICON_INSTALL_RULE))) - -install-mpv-icons: $(foreach size,$(ICONSIZES),install-mpv-icon-$(size)) - -install-mpv-desktop: etc/mpv.desktop - $(INSTALL) -d $(prefix)/share/applications - $(INSTALL) -m 644 etc/mpv.desktop $(prefix)/share/applications/ - -install-data: install-mpv-icons install-mpv-desktop - -uninstall: - $(RM) $(BINDIR)/mpv$(EXESUF) - $(RM) $(MANDIR)/man1/mpv.1 - $(RM) $(MANDIR)/en/man1/mpv.1 - $(RM) $(DOCDIR)/mpv.pdf - $(RM) $(prefix)/share/applications/mpv.desktop - $(RM) $(foreach size,$(ICONSIZES),$(prefix)/share/icons/hicolor/$(size)/apps/mpv.png) - -clean: - -$(RM) $(call ADD_ALL_DIRS,/*.o /*.d /*.a /*.ho /*~) - -$(RM) $(call ADD_ALL_DIRS,/*.o /*.a /*.ho /*~) - -$(RM) $(call ADD_ALL_EXESUFS,mpv) - -$(RM) $(call ADDSUFFIXES,.pdf .tex .log .aux .out .toc,DOCS/man/*/mpv) - -$(RM) DOCS/man/*/mpv.1 - -$(RM) version.h - -$(RM) mpvcore/input/input_conf.h - -$(RM) video/out/vdpau_template.c - -$(RM) demux/ebml_types.h demux/ebml_defs.c - -$(RM) video/out/gl_video_shaders.h - -$(RM) video/out/x11_icon.inc - -$(RM) sub/osd_font.h - -$(RM) mpvcore/player/lua/defaults.inc - -$(RM) mpvcore/player/lua/assdraw.inc - -$(RM) mpvcore/player/lua/osc.inc - -distclean: clean - -$(RM) config.log config.mak config.h TAGS tags - -TAGS: - $(RM) $@; find . -name '*.[chS]' -o -name '*.asm' | xargs etags -a - -tags: - $(RM) $@; find . -name '*.[chS]' -o -name '*.asm' | xargs ctags -a - -osxbundle: - @TOOLS/osxbundle.py mpv - -osxbundle-skip-deps: - @TOOLS/osxbundle.py --skip-deps mpv - --include $(DEP_FILES) - -.PHONY: all *install* *clean .version - -# Disable suffix rules. Most of the builtin rules are suffix rules, -# so this saves some time on slow systems. -.SUFFIXES: - -# If a command returns failure but changed its target file, delete the -# (presumably malformed) file. Otherwise the file would be considered to -# be up to date if make is restarted. - -.DELETE_ON_ERROR: diff --git a/README.md b/README.md index f1286bea01..2e8c1d75ff 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,22 @@ Compilation ----------- Compiling with full features requires development files for several -external libraries. Below is a list of some important requirements. For -more information see the output of `./configure --help` for a list of options, -or look at the list of enabled and disabled features printed after running -`./configure`. If you think you have support for some feature installed -but configure fails to detect it, the file `config.log` may contain -information about the reasons for the failure. +external libraries. Below is a list of some important requirements. + +The mpv build system uses *waf* but we don't store it in your source tree. The +script './bootstrap.py' will download the latest version of waf that was tested +with the build system. + +For a list of the available build options use `./waf configure --help`. If +you think you have support for some feature installed but configure fails to +detect it, the file `build/config.log` may contain information about the +reasons for the failure. + +To build the software you can use `./waf build`, and `./waf install` to install +it. + +NOTE: Using the old build system (with `./old-configure`) should still work, +but will be removed in a future version of mpv. Essential dependencies (incomplete list): @@ -47,22 +57,6 @@ If you are running Mac OSX and using homebrew we provide [homebrew-mpv][homebrew to date formula that compiles mpv with sensible dependencies and defaults for OSX. -### configure `--enable-*` parameters - -The `--enable-*` parameters unconditionally force options on, completely -skipping autodetection. This behavior is unlike what you may be used to from -autoconf-based configure scripts that can decide to override you. This greater -level of control comes at a price. You may have to provide the correct compiler -and linker flags yourself. - -If you used one of these options and experience a compilation or -linking failure, make sure you have passed the necessary compiler/linker flags -to configure. - -mpv's configure script is greedy and automatically enables features as a result -of autodetection. The cases where you may want to use `--enable-*` are very -limited. - FFmpeg vs. Libav ---------------- diff --git a/TOOLS/osxbundle.py b/TOOLS/osxbundle.py index 6cd2a227c5..66ef576efd 100755 --- a/TOOLS/osxbundle.py +++ b/TOOLS/osxbundle.py @@ -30,24 +30,28 @@ def user_dylib_lst(input_file): return [lib for lib in dylib_lst(input_file).split("\n") if is_user_lib(lib, input_file)] -def bundle_name(binary_name): +def bundle_path(binary_name): return "%s.app" % binary_name +def bundle_name(binary_name): + return os.path.basename(bundle_path(binary_name)) + def target_plist(binary_name): - return os.path.join(bundle_name(binary_name), 'Contents', 'Info.plist') + return os.path.join(bundle_path(binary_name), 'Contents', 'Info.plist') def target_directory(binary_name): - return os.path.join(bundle_name(binary_name), 'Contents', 'MacOS') + return os.path.join(bundle_path(binary_name), 'Contents', 'MacOS') def target_binary(binary_name): - return os.path.join(target_directory(binary_name), binary_name) + return os.path.join(target_directory(binary_name), + os.path.basename(binary_name)) def copy_bundle(binary_name): - if os.path.isdir(bundle_name(binary_name)): - shutil.rmtree(bundle_name(binary_name)) + if os.path.isdir(bundle_path(binary_name)): + shutil.rmtree(bundle_path(binary_name)) shutil.copytree( os.path.join('TOOLS', 'osxbundle', bundle_name(binary_name)), - bundle_name(binary_name)) + bundle_path(binary_name)) def copy_binary(binary_name): shutil.copy(binary_name, target_binary(binary_name)) @@ -91,7 +95,7 @@ def fix_dylibs_paths(target_file, dest_dir, root=True): fix_dylibs_paths(dylib_dest_path, dest_dir, False) def apply_plist_template(plist_file, version): - sh("sed -i -e 's/{{VERSION}}/%s/g' %s" % (version, plist_file)) + sh("sed -i -e 's/${VERSION}/%s/g' %s" % (version, plist_file)) def bundle_dependencies(binary_name): lib_bundle_directory = os.path.join(target_directory(binary_name), "lib") diff --git a/TOOLS/osxbundle/mpv.app/Contents/Info.plist b/TOOLS/osxbundle/mpv.app/Contents/Info.plist index f1e2e6f34d..0573b62e44 100644 --- a/TOOLS/osxbundle/mpv.app/Contents/Info.plist +++ b/TOOLS/osxbundle/mpv.app/Contents/Info.plist @@ -183,7 +183,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - {{VERSION}} + ${VERSION} NSHighResolutionCapable CFBundleURLTypes diff --git a/bootstrap.py b/bootstrap.py new file mode 100755 index 0000000000..d855de029b --- /dev/null +++ b/bootstrap.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +# This script simply downloads waf to the current directory + +from __future__ import print_function +import os, sys, stat, hashlib + +try: + from urllib.request import urlopen +except: + from urllib2 import urlopen + +WAFRELEASE = "waf-1.7.13" +SHA256HASH = "03cc750049350ee01cdbc584b70924e333fcc17ba4a2d04648dab1535538a873" + +waf = urlopen("https://waf.googlecode.com/files/" + WAFRELEASE).read() + +if SHA256HASH == hashlib.sha256(waf).hexdigest(): + with open("waf", "wb") as wf: + wf.write(waf) + + os.chmod("waf", os.stat("waf").st_mode | stat.S_IXUSR) + print("Checksum verified.") +else: + print("The checksum of the downloaded file does not match!") + print("Please download and verify the file manually.") + + sys.exit(1) diff --git a/configure b/configure deleted file mode 100755 index 0618c05594..0000000000 --- a/configure +++ /dev/null @@ -1,3620 +0,0 @@ -#! /bin/sh -# -# Original version (C) 2000 Pontscho/fresh!mindworkz -# pontscho@makacs.poliod.hu -# -# History / Contributors: Check the Subversion log. -# -# Cleanups all over the place (c) 2001 pl -# -# -# This configure script is *not* autoconf-based and has different semantics. -# It attempts to autodetect all settings and options where possible. It is -# possible to override autodetection with the --enable-option/--disable-option -# command line parameters. --enable-option forces the option on skipping -# autodetection. Yes, this means that compilation may fail and yes, this is not -# how autoconf-based configure scripts behave. -# -# configure generates a series of configuration files: -# - config.h contains #defines that are used in the C code. -# - config.mak is included from the Makefiles. -# -# If you want to add a new check for $feature, look at the existing checks -# and try to use helper functions where you can. -# -# Furthermore you need to add the variable _feature to the list of default -# settings and set it to one of yes/no/auto. Also add appropriate -# --enable-feature/--disable-feature command line options. -# The results of the check should be written to config.h and config.mak -# at the end of this script. The variable names used for this should be -# uniform, i.e. if the option is named 'feature': -# -# _feature : should have a value of yes/no/auto -# def_feature : '#define ... 1' or '#undef ...' for conditional compilation -# _ld_feature : '-L/path/dir -lfeature' GCC options -# -############################################################################# - -# Prevent locale nonsense from breaking basic text processing utils -export LC_ALL=C - -# Store the configure line that was used -configuration="$*" - -# Prefer these macros to full length text ! -# These macros only return an error code - NO display is done -command_check() { - echo >> "$TMPLOG" - echo "$@" >> "$TMPLOG" - "$@" >> "$TMPLOG" 2>&1 - TMPRES="$?" - echo >> "$TMPLOG" - return "$TMPRES" -} - -compile_check() { - source="$1" - shift - echo >> "$TMPLOG" - cat "$source" >> "$TMPLOG" - echo >> "$TMPLOG" - echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG" - rm -f "$TMPEXE" - $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1 - TMPRES="$?" - echo >> "$TMPLOG" - echo >> "$TMPLOG" - return "$TMPRES" -} - -cc_check() { - compile_check $TMPC $@ -} - -cxx_check() { - compile_check $TMPCPP $@ -lstdc++ -} - -cflag_check() { - cat > $TMPC << EOF -int main(void) { return 0; } -EOF - compile_check $TMPC $@ -} - -header_check() { - cat > $TMPC << EOF -#include <$1> -int main(void) { return 0; } -EOF - shift - compile_check $TMPC $@ -} - -return_check() { - cat > $TMPC << EOF -#include <$1> -int main(void) { return $2; } -EOF - shift 2 - compile_check $TMPC $@ -} - -statement_check() { - cat > $TMPC << EOF -#include <$1> -int main(void) { $2; return 0; } -EOF - shift - shift - compile_check $TMPC $@ -} - -define_statement_check() { - cat > $TMPC << EOF -#define $1 -#include <$2> -int main(void) { $3; return 0; } -EOF - shift 3 - compile_check $TMPC $@ -} - -return_statement_check() { - cat > $TMPC << EOF -#include <$1> -int main(void) { $2; return $3; } -EOF - shift 3 - compile_check $TMPC $@ -} - -inline_asm_check() { - cat > $TMPC << EOF -int main(void) { __asm__ volatile ($1); return 0; } -EOF - shift - compile_check $TMPC $@ -} - -# The following checks are special and should only be used with broken and -# non-selfsufficient headers that do not include all of their dependencies. - -header_check_broken() { - cat > $TMPC << EOF -#include <$1> -#include <$2> -int main(void) { return 0; } -EOF - shift - shift - compile_check $TMPC $@ -} - -statement_check_broken() { - cat > $TMPC << EOF -#include <$1> -#include <$2> -int main(void) { $3; return 0; } -EOF - shift 3 - compile_check $TMPC $@ -} - -pkg_config_add() { - unset IFS # shell should not be used for programming - echo >> "$TMPLOG" - echo "$_pkg_config --cflags $@" >> "$TMPLOG" - ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $? - echo >> "$TMPLOG" - echo "$_pkg_config --libs $@" >> "$TMPLOG" - ltmp=$($_pkg_config --libs "$@" 2>> "$TMPLOG") || return $? - echo >> "$TMPLOG" - echo "cflags: $ctmp" >> "$TMPLOG" - echo "libs: $ltmp" >> "$TMPLOG" - echo >> "$TMPLOG" - extra_cflags="$extra_cflags $ctmp" - libs_mplayer="$libs_mplayer $ltmp" -} - -tmp_run() { - "$TMPEXE" >> "$TMPLOG" 2>&1 -} - -# Display error message, flushes tempfile, exit -die () { - echo - echo "Error: $@" >&2 - echo >&2 - rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" - echo "Check \"$TMPLOG\" if you do not understand why it failed." - exit 1 -} - -# OS test booleans functions -issystem() { - test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)" -} -cygwin() { issystem "CYGWIN"; } -darwin() { issystem "Darwin"; } -dragonfly() { issystem "DragonFly"; } -freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; } -gnu() { issystem "GNU"; } -linux() { issystem "Linux"; } -mingw32() { issystem "MINGW32"; } -morphos() { issystem "MorphOS"; } -netbsd() { issystem "NetBSD"; } -openbsd() { issystem "OpenBSD"; } -win32() { cygwin || mingw32; } - -# arch test boolean functions -x86_32() { - case "$host_arch" in - i[3-9]86|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;; - *) return 1 ;; - esac -} - -x86_64() { - case "$host_arch" in - x86_64|amd64) return 0 ;; - *) return 1 ;; - esac -} - -x86() { - x86_32 || x86_64 -} - -ppc() { - case "$host_arch" in - ppc|ppc64|powerpc|powerpc64) return 0;; - *) return 1;; - esac -} - -alpha() { - case "$host_arch" in - alpha*) return 0;; - *) return 1;; - esac -} - -arm() { - case "$host_arch" in - arm*) return 0;; - *) return 1;; - esac -} - -# Use this before starting a check -echocheck() { - echo "============ Checking for $@ ============" >> "$TMPLOG" - echo ${_echo_n} "Checking for $@ ... ${_echo_c}" -} - -# Use this to echo the results of a check -echores() { - if test "$res_comment" ; then - res_comment="($res_comment)" - fi - echo "Result is: $@ $res_comment" >> "$TMPLOG" - echo "##########################################" >> "$TMPLOG" - echo "" >> "$TMPLOG" - echo "$@ $res_comment" - res_comment="" -} -############################################################################# - -# Check how echo works in this /bin/sh -case $(echo -n) in - -n) _echo_n= _echo_c='\c' ;; # SysV echo - *) _echo_n='-n ' _echo_c= ;; # BSD echo -esac - - -show_help(){ -cat << EOF -Usage: $0 [OPTIONS]... - -Configuration: - -h, --help display this help and exit - -Installation directories: - --prefix=DIR prefix directory for installation [/usr/local] - --bindir=DIR directory for installing binaries [PREFIX/bin] - --datadir=DIR directory for installing machine independent - data files (skins, etc) [PREFIX/share/mpv] - --mandir=DIR directory for installing man pages [PREFIX/share/man] - --docdir=DIR directory for installing docs [PREFIX/share/doc/mpv] - --confdir=DIR directory for installing configuration files - [PREFIX/etc/mpv] - -Optional features: - --disable-encoding disable encoding functionality [enable] - --disable-lua disable Lua scripting support [autodetect] - --lua=LUA select Lua package which should be autodetected - Choices: 51 51deb 52 52deb luajit - --disable-libguess disable libguess [autodetect] - --enable-terminfo use terminfo database for key codes [autodetect] - --enable-termcap use termcap database for key codes [autodetect] - --enable-termios use termios database for key codes [autodetect] - --disable-iconv disable iconv for encoding conversion [autodetect] - --enable-lirc enable LIRC (remote control) support [autodetect] - --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect] - --enable-joystick enable joystick support [disable] - --disable-vm disable X video mode extensions [autodetect] - --disable-xf86keysym disable support for multimedia keys [autodetect] - --enable-radio enable radio interface [disable] - --enable-radio-capture enable radio capture (through PCI/line-in) [disable] - --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect] - --disable-tv disable TV interface (TV/DVB grabbers) [enable] - --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect] - --disable-libv4l2 disable libv4l2 [autodetect] - --disable-pvr disable Video4Linux2 MPEG PVR [autodetect] - --enable-smb enable Samba (SMB) input [autodetect] - --disable-libquvi4 disable libquvi 0.4.x [autodetect] - --disable-libquvi9 disable libquvi 0.9.x [autodetect] - --enable-lcms2 enable LCMS2 support [autodetect] - --disable-vcd disable VCD support [autodetect] - --disable-bluray disable Blu-ray support [autodetect] - --disable-dvdread disable libdvdread [autodetect] - --disable-enca disable ENCA charset oracle library [autodetect] - --disable-pthreads disable Posix threads support [autodetect] - --disable-libass disable subtitle rendering with libass [autodetect] - --disable-libass-osd disable OSD rendering with libass [autodetect] - --enable-rpath enable runtime linker path for extra libs [disabled] - --disable-libpostproc disable postprocess filter (vf_pp) [autodetect] - --disable-libavdevice disable libavdevice demuxers [autodetect] - --disable-libavfilter disable libavfilter [autodetect] - --disable-vf-lavfi disable vf_lavfi libavfilter bridge [audodetect] - --disable-af-lavfi disable af_lavfi libavfilter bridge [audodetect] - -Codecs: - --enable-jpeg enable JPEG input/output support [autodetect] - --enable-libcdio enable libcdio support [autodetect] - --enable-libav skip Libav autodetection [autodetect] - --disable-ladspa disable LADSPA plugin support [autodetect] - --disable-libbs2b disable libbs2b audio filter support [autodetect] - --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect] - -Resampler: - --disable-libavresample check for libswresample only [autodetect] - -Video output: - --enable-gl enable OpenGL video output [autodetect] - --enable-caca enable CACA video output [autodetect] - --enable-direct3d enable Direct3D video output [autodetect] - --enable-sdl enable SDL audio output [disable] - --enable-sdl2 enable SDL 2.0+ audio and video output [disable] - --enable-xv enable Xv video output [autodetect] - --enable-vdpau enable VDPAU acceleration [autodetect] - --enable-vda enable VDA acceleration [autodetect] - --enable-vaapi enable VAAPI acceleration [autodetect] - --enable-vm enable XF86VidMode support [autodetect] - --enable-xinerama enable Xinerama support [autodetect] - --enable-x11 enable X11 video output [autodetect] - --enable-wayland enable Wayland video output [autodetect] - --disable-xss disable screensaver support via xss [autodetect] - --disable-corevideo disable CoreVideo video output [autodetect] - --disable-cocoa disable Cocoa OpenGL backend [autodetect] - -Audio output: - --disable-alsa disable ALSA audio output [autodetect] - --disable-ossaudio disable OSS audio output [autodetect] - --disable-rsound disable RSound audio output [autodetect] - --disable-sndio disable sndio audio output [autodetect] - --disable-pulse disable Pulseaudio audio output [autodetect] - --disable-portaudio disable PortAudio audio output [autodetect] - --disable-jack disable JACK audio output [autodetect] - --enable-openal enable OpenAL audio output [disable] - --disable-coreaudio disable CoreAudio audio output [autodetect] - --disable-dsound disable DirectSound audio output [autodetect] - --disable-wasapi disable WASAPI (event mode) audio output [autodetect] - --disable-select disable using select() on the audio device [enable] - -Miscellaneous options: - --enable-cross-compile enable cross-compilation [disable] - --cc=COMPILER C compiler to build mpv [gcc] - --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config] - --windres=WINDRES windres to build mpv [windres] - --target=PLATFORM target platform (i386-linux, arm-linux, etc) - --enable-static build a statically linked binary - --with-install=PATH path to a custom install program - --disable-manpage do not build and install manpage [auto] - --disable-pdf do not build and install PDF manual [auto] - --disable-build-date do not include binary compile time - -Advanced options: - --enable-shm enable shm [autodetect] - --disable-debug compile-in debugging information [enable] - --disable-optimization compile without -O2 [enable] - -Use these options if autodetection fails: - --extra-cflags=FLAGS extra CFLAGS - --extra-ldflags=FLAGS extra LDFLAGS - --extra-libs=FLAGS extra linker flags - --extra-libs-mpv=FLAGS extra linker flags for mpv - -This configure script is NOT autoconf-based, even though its output is similar. -It will try to autodetect all configuration options. If you --enable an option -it will be forcefully turned on, skipping autodetection. This can break -compilation, so you need to know what you are doing. -EOF -exit 0 -} #show_help() - -# GOTCHA: the variables below defines the default behavior for autodetection -# and have - unless stated otherwise - at least 2 states : yes no -# If autodetection is available then the third state is: auto -_install=install -_pkg_config=auto -_windres=auto -_cc=auto -test "$CC" && _cc="$CC" -_debug=-g -_opt=-O2 -_cross_compile=no -_prefix="/usr/local" -ffmpeg=auto -_encoding=yes -_disable_avresample=no -_x11=auto -_wayland=auto -_xss=auto -_xv=auto -_vdpau=auto -_vda=auto -_vda_refcounting=auto -_vaapi=auto -_direct3d=auto -_sdl=no -_sdl2=no -_dsound=auto -_wasapi=auto -_jpeg=auto -_gl=auto -_aa=auto -_caca=auto -_dvb=auto -_iconv=auto -_ossaudio=auto -_rsound=auto -_pulse=auto -_portaudio=auto -_jack=auto -_openal=no -_libcdio=auto -_mpg123=auto -_ladspa=auto -_libbs2b=auto -_vcd=auto -_bluray=auto -_dvdread=auto -_lcms2=auto -_xinerama=auto -_vm=auto -_xf86keysym=auto -_sndio=auto -_alsa=auto -_select=yes -_radio=no -_radio_capture=no -_radio_v4l2=auto -_tv=yes -_tv_v4l2=auto -_libv4l2=auto -_pvr=auto -_smb=auto -_libquvi4=auto -_libquvi9=auto -_libguess=auto -_joystick=no -_lirc=auto -_lircc=auto -_terminfo=auto -_termcap=auto -_termios=auto -_shm=auto -_cdda=auto -_coreaudio=auto -_corevideo=auto -_cocoa=auto -_enca=auto -_pthreads=auto -_ass=auto -_libass_osd=auto -_rpath=no -lua=auto -libpostproc=auto -libavfilter=auto -vf_lavfi=auto -af_lavfi=auto -libavdevice=auto -_stream_cache=yes -_priority=no -def_dos_paths="#define HAVE_DOS_PATHS 0" -def_priority="#define HAVE_PRIORITY 0" -_build_man=auto -_build_pdf=auto -_build_date=yes -for ac_option do - case "$ac_option" in - --help|-help|-h) - show_help - ;; - --prefix=*) - _prefix=$(echo $ac_option | cut -d '=' -f 2) - ;; - --bindir=*) - _bindir=$(echo $ac_option | cut -d '=' -f 2) - ;; - --mandir=*) - _mandir=$(echo $ac_option | cut -d '=' -f 2) - ;; - --docdir=*) - _docdir=$(echo $ac_option | cut -d '=' -f 2) - ;; - --confdir=*) - _confdir=$(echo $ac_option | cut -d '=' -f 2) - ;; - - --with-install=*) - _install=$(echo $ac_option | cut -d '=' -f 2 ) - ;; - - --extra-cflags=*) - extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)" - ;; - --extra-ldflags=*) - extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)" - ;; - --extra-libs=*) - extra_libs=$(echo $ac_option | cut -d '=' -f 2) - ;; - --extra-libs-mpv=*) - libs_mplayer=$(echo $ac_option | cut -d '=' -f 2) - ;; - - --target=*) - _target=$(echo $ac_option | cut -d '=' -f 2) - ;; - --cc=*) - _cc=$(echo $ac_option | cut -d '=' -f 2) - ;; - --pkg-config=*) - _pkg_config=$(echo $ac_option | cut -d '=' -f 2) - ;; - --windres=*) - _windres=$(echo $ac_option | cut -d '=' -f 2) - ;; - - --enable-static) - _ld_static='-static' - ;; - --disable-static) - _ld_static='' - ;; - --enable-debug) - _debug='-g' - ;; - --enable-debug=*) - _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2) - ;; - --disable-debug) - _debug= - ;; - --enable-optimization) - _opt='-O2' - ;; - --enable-optimization=*) - _opt=$(echo $_echo_n '-O'$_echo_c; echo $ac_option | cut -d '=' -f 2) - ;; - --disable-optimization) - _opt= - ;; - --enable-cross-compile) _cross_compile=yes ;; - --disable-cross-compile) _cross_compile=no ;; - --enable-encoding) _encoding=yes ;; - --disable-encoding) _encoding=no ;; - --enable-wayland) _wayland=yes ;; - --disable-wayland) _wayland=no ;; - --enable-x11) _x11=yes ;; - --disable-x11) _x11=no ;; - --enable-xss) _xss=yes ;; - --disable-xss) _xss=no ;; - --enable-xv) _xv=yes ;; - --disable-xv) _xv=no ;; - --enable-vdpau) _vdpau=yes ;; - --disable-vdpau) _vdpau=no ;; - --enable-vda) _vda=yes ;; - --disable-vda) _vda=no ;; - --enable-vaapi) _vaapi=yes ;; - --disable-vaapi) _vaapi=no ;; - --enable-direct3d) _direct3d=yes ;; - --disable-direct3d) _direct3d=no ;; - --enable-sdl) _sdl=yes ;; - --disable-sdl) _sdl=no ;; - --enable-sdl2) _sdl2=yes ;; - --disable-sdl2) _sdl2=no ;; - --enable-dsound) _dsound=yes ;; - --disable-dsound) _dsound=no ;; - --enable-wasapi) _wasapi=yes ;; - --disable-wasapi) _wasapi=no ;; - --enable-jpeg) _jpeg=yes ;; - --disable-jpeg) _jpeg=no ;; - --enable-gl) _gl=yes ;; - --disable-gl) _gl=no ;; - --enable-caca) _caca=yes ;; - --disable-caca) _caca=no ;; - --enable-dvb) _dvb=yes ;; - --disable-dvb) _dvb=no ;; - --enable-iconv) _iconv=yes ;; - --disable-iconv) _iconv=no ;; - --enable-ossaudio) _ossaudio=yes ;; - --disable-ossaudio) _ossaudio=no ;; - --enable-rsound) _rsound=yes ;; - --disable-rsound) _rsound=no ;; - --enable-sndio) _sndio=yes ;; - --disable-sndio) _sndio=no ;; - --enable-pulse) _pulse=yes ;; - --disable-pulse) _pulse=no ;; - --enable-portaudio) _portaudio=yes ;; - --disable-portaudio) _portaudio=no ;; - --enable-jack) _jack=yes ;; - --disable-jack) _jack=no ;; - --enable-openal) _openal=auto ;; - --disable-openal) _openal=no ;; - --enable-libcdio) _libcdio=yes ;; - --disable-libcdio) _libcdio=no ;; - --enable-mpg123) _mpg123=yes ;; - --disable-mpg123) _mpg123=no ;; - --enable-ladspa) _ladspa=yes ;; - --disable-ladspa) _ladspa=no ;; - --enable-libbs2b) _libbs2b=yes ;; - --disable-libbs2b) _libbs2b=no ;; - --enable-vcd) _vcd=yes ;; - --disable-vcd) _vcd=no ;; - --enable-bluray) _bluray=yes ;; - --disable-bluray) _bluray=no ;; - --enable-dvdread) _dvdread=yes ;; - --disable-dvdread) _dvdread=no ;; - --enable-lcms2) _lcms2=yes ;; - --disable-lcms2) _lcms2=no ;; - --enable-xinerama) _xinerama=yes ;; - --disable-xinerama) _xinerama=no ;; - --enable-vm) _vm=yes ;; - --disable-vm) _vm=no ;; - --enable-xf86keysym) _xf86keysym=yes ;; - --disable-xf86keysym) _xf86keysym=no ;; - --enable-alsa) _alsa=yes ;; - --disable-alsa) _alsa=no ;; - --enable-tv) _tv=yes ;; - --disable-tv) _tv=no ;; - --enable-tv-v4l2) _tv_v4l2=yes ;; - --disable-tv-v4l2) _tv_v4l2=no ;; - --enable-libv4l2) _libv4l2=yes ;; - --disable-libv4l2) _libv4l2=no ;; - --enable-radio) _radio=yes ;; - --enable-radio-capture) _radio_capture=yes ;; - --disable-radio-capture) _radio_capture=no ;; - --disable-radio) _radio=no ;; - --enable-radio-v4l2) _radio_v4l2=yes ;; - --disable-radio-v4l2) _radio_v4l2=no ;; - --enable-pvr) _pvr=yes ;; - --disable-pvr) _pvr=no ;; - --enable-smb) _smb=yes ;; - --disable-smb) _smb=no ;; - --enable-libquvi4) _libquvi4=yes ;; - --disable-libquvi4) _libquvi4=no ;; - --enable-libquvi9) _libquvi9=yes ;; - --disable-libquvi9) _libquvi9=no ;; - --enable-libguess) _libguess=yes ;; - --disable-libguess) _libguess=no ;; - --enable-joystick) _joystick=yes ;; - --disable-joystick) _joystick=no ;; - --enable-libav) ffmpeg=yes ;; - --disable-libavresample) _disable_avresample=yes ;; - --enable-libavresample) _disable_avresample=no ;; - - --enable-lua) lua=yes ;; - --disable-lua) lua=no ;; - --lua=*) lua_pkg=$(echo $ac_option | cut -d '=' -f 2) ;; - --enable-lirc) _lirc=yes ;; - --disable-lirc) _lirc=no ;; - --enable-lircc) _lircc=yes ;; - --disable-lircc) _lircc=no ;; - --enable-terminfo) _terminfo=yes ;; - --disable-terminfo) _terminfo=no ;; - --enable-termcap) _termcap=yes ;; - --disable-termcap) _termcap=no ;; - --enable-termios) _termios=yes ;; - --disable-termios) _termios=no ;; - --enable-shm) _shm=yes ;; - --disable-shm) _shm=no ;; - --enable-select) _select=yes ;; - --disable-select) _select=no ;; - --enable-pthreads) _pthreads=yes ;; - --disable-pthreads) _pthreads=no ;; - --enable-libass) _ass=yes ;; - --disable-libass) _ass=no ;; - --enable-libass-osd) _libass_osd=yes ;; - --disable-libass-osd) _libass_osd=no ;; - --enable-rpath) _rpath=yes ;; - --disable-rpath) _rpath=no ;; - --enable-libpostproc) libpostproc=yes ;; - --disable-libpostproc) libpostproc=no ;; - --enable-libavdevice) libavdevice=auto ;; - --disable-libavdevice) libavdevice=no ;; - --enable-libavfilter) libavfilter=auto ;; - --disable-libavfilter) libavfilter=no ;; - --enable-vf-lavfi) vf_lavfi=auto ;; - --disable-vf-lavfi) vf_lavfi=no ;; - --enable-af-lavfi) af_lavfi=auto ;; - --disable-af-lavfi) af_lavfi=no ;; - - --enable-enca) _enca=yes ;; - --disable-enca) _enca=no ;; - - --enable-coreaudio) _coreaudio=yes ;; - --disable-coreaudio) _coreaudio=no ;; - --enable-corevideo) _corevideo=yes ;; - --disable-corevideo) _corevideo=no ;; - --enable-cocoa) _cocoa=yes ;; - --disable-cocoa) _cocoa=no ;; - - --enable-manpage) _build_man=yes ;; - --disable-manpage) _build_man=no ;; - --enable-pdf) _build_pdf=yes ;; - --disable-pdf) _build_pdf=no ;; - - --enable-build-date) _build_date=yes ;; - --disable-build-date) _build_date=no ;; - *) - echo "Unknown parameter: