diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-07-16 13:28:28 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-21 21:22:36 +0100 |
commit | 7e2edad8efea55e8df1faa695d1389ef4e326d7c (patch) | |
tree | f9662620b8ecaf50f6c67804dd0d99d00d85fe5b /waftools/fragments | |
parent | 0cb9227a73f03a6ecdf71e837c7c33c823b194b4 (diff) | |
download | mpv-7e2edad8efea55e8df1faa695d1389ef4e326d7c.tar.bz2 mpv-7e2edad8efea55e8df1faa695d1389ef4e326d7c.tar.xz |
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.
Diffstat (limited to 'waftools/fragments')
-rw-r--r-- | waftools/fragments/cocoa.m | 11 | ||||
-rw-r--r-- | waftools/fragments/coreaudio.c | 15 | ||||
-rw-r--r-- | waftools/fragments/dvb.c | 10 | ||||
-rw-r--r-- | waftools/fragments/ebx.c | 12 | ||||
-rw-r--r-- | waftools/fragments/gl_x11.c | 9 | ||||
-rw-r--r-- | waftools/fragments/iconv.c | 30 | ||||
-rw-r--r-- | waftools/fragments/libavfilter.c | 7 | ||||
-rw-r--r-- | waftools/fragments/lua.c | 24 | ||||
-rw-r--r-- | waftools/fragments/lua_libquvi4.c | 3 | ||||
-rw-r--r-- | waftools/fragments/lua_libquvi9.c | 3 | ||||
-rw-r--r-- | waftools/fragments/mng.c | 7 | ||||
-rw-r--r-- | waftools/fragments/oss_audio.c | 11 | ||||
-rw-r--r-- | waftools/fragments/oss_audio_header.c | 13 | ||||
-rw-r--r-- | waftools/fragments/pthreads.c | 10 | ||||
-rw-r--r-- | waftools/fragments/pvr.c | 7 | ||||
-rw-r--r-- | waftools/fragments/vcd_windows.c | 7 | ||||
-rw-r--r-- | waftools/fragments/wasapi.c | 19 | ||||
-rw-r--r-- | waftools/fragments/xf86vm.c | 8 | ||||
-rw-r--r-- | waftools/fragments/xf86xk.c | 6 |
19 files changed, 212 insertions, 0 deletions
diff --git a/waftools/fragments/cocoa.m b/waftools/fragments/cocoa.m new file mode 100644 index 0000000000..6e0e4d32b4 --- /dev/null +++ b/waftools/fragments/cocoa.m @@ -0,0 +1,11 @@ +#import <CoreServices/CoreServices.h> +#import <OpenGL/OpenGL.h> +#import <Cocoa/Cocoa.h> + +int main(int argc, char **argv) { + @autoreleasepool { + NSArray *ary = @[@1, @2, @3]; + NSLog(@"test subscripting: %@", ary[0]); + NSApplicationLoad(); + } +} diff --git a/waftools/fragments/coreaudio.c b/waftools/fragments/coreaudio.c new file mode 100644 index 0000000000..c7411311a7 --- /dev/null +++ b/waftools/fragments/coreaudio.c @@ -0,0 +1,15 @@ +#include <CoreAudio/CoreAudio.h> +#include <AudioToolbox/AudioToolbox.h> +#include <AudioUnit/AudioUnit.h> + +int main(int argc, char **argv) +{ + AudioComponentDescription desc = (AudioComponentDescription) { + .componentType = kAudioUnitType_Output, + .componentSubType = kAudioUnitSubType_DefaultOutput, + .componentManufacturer = kAudioUnitManufacturer_Apple, + }; + + AudioComponentFindNext(NULL, &desc); + return 0; +} diff --git a/waftools/fragments/dvb.c b/waftools/fragments/dvb.c new file mode 100644 index 0000000000..9deaa1eaab --- /dev/null +++ b/waftools/fragments/dvb.c @@ -0,0 +1,10 @@ +#include <poll.h> +#include <sys/ioctl.h> +#include <stdio.h> +#include <time.h> +#include <unistd.h> +#include <linux/dvb/dmx.h> +#include <linux/dvb/frontend.h> +#include <linux/dvb/video.h> +#include <linux/dvb/audio.h> +int main(void) {return 0;} diff --git a/waftools/fragments/ebx.c b/waftools/fragments/ebx.c new file mode 100644 index 0000000000..b487939c56 --- /dev/null +++ b/waftools/fragments/ebx.c @@ -0,0 +1,12 @@ +int main(void) { + int x; + __asm__ volatile( + "xor %0, %0" + :"=b"(x) + // just adding ebx to clobber list seems unreliable with some + // compilers, e.g. Haiku's gcc 2.95 + ); + // and the above check does not work for OSX 64 bit... + __asm__ volatile("":::"%ebx"); + return 0; +} diff --git a/waftools/fragments/gl_x11.c b/waftools/fragments/gl_x11.c new file mode 100644 index 0000000000..6c617d43ee --- /dev/null +++ b/waftools/fragments/gl_x11.c @@ -0,0 +1,9 @@ +#include <X11/Xlib.h> +#include <GL/glx.h> +#include <GL/gl.h> + +int main(int argc, char *argv[]) { + glXCreateContext(NULL, NULL, NULL, True); + glFinish(); + return 0; +} diff --git a/waftools/fragments/iconv.c b/waftools/fragments/iconv.c new file mode 100644 index 0000000000..78c963b643 --- /dev/null +++ b/waftools/fragments/iconv.c @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <unistd.h> +#include <iconv.h> +#define INBUFSIZE 1024 +#define OUTBUFSIZE 4096 + +char inbuffer[INBUFSIZE]; +char outbuffer[OUTBUFSIZE]; + +int main(void) { + size_t numread; + iconv_t icdsc; + char *tocode="UTF-8"; + char *fromcode="cp1250"; + if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) { + while ((numread = read(0, inbuffer, INBUFSIZE))) { + char *iptr=inbuffer; + char *optr=outbuffer; + size_t inleft=numread; + size_t outleft=OUTBUFSIZE; + if (iconv(icdsc, &iptr, &inleft, &optr, &outleft) + != (size_t)(-1)) { + write(1, outbuffer, OUTBUFSIZE - outleft); + } + } + if (iconv_close(icdsc) == -1) + ; + } + return 0; +} diff --git a/waftools/fragments/libavfilter.c b/waftools/fragments/libavfilter.c new file mode 100644 index 0000000000..4e1986f4a2 --- /dev/null +++ b/waftools/fragments/libavfilter.c @@ -0,0 +1,7 @@ +#include <libavfilter/avfilter.h> +void vf_next_query_format() {} +int main(void) { + avfilter_register_all(); + vf_next_query_format(); + return 0; +} diff --git a/waftools/fragments/lua.c b/waftools/fragments/lua.c new file mode 100644 index 0000000000..43d678b476 --- /dev/null +++ b/waftools/fragments/lua.c @@ -0,0 +1,24 @@ +#include <stdlib.h> +#include <lua.h> +#include <lualib.h> +#include <lauxlib.h> + +// filled on the python side with .format() +{additional_lua_test_header} + +void test_lua(void) {{ + lua_State *L = luaL_newstate(); + lua_pushstring(L, "test"); + lua_setglobal(L, "test"); +}} + +void test_other(void) {{ + // filled on the python side with .format() + {additional_lua_test_code} +}} + +int main(void) {{ + test_lua(); + test_other(); + return 0; +}} diff --git a/waftools/fragments/lua_libquvi4.c b/waftools/fragments/lua_libquvi4.c new file mode 100644 index 0000000000..efcf30375a --- /dev/null +++ b/waftools/fragments/lua_libquvi4.c @@ -0,0 +1,3 @@ + quvi_t q; + if (quvi_init(&q) == QUVI_OK) + quvi_supported(q, "http://nope"); diff --git a/waftools/fragments/lua_libquvi9.c b/waftools/fragments/lua_libquvi9.c new file mode 100644 index 0000000000..e25ea1a462 --- /dev/null +++ b/waftools/fragments/lua_libquvi9.c @@ -0,0 +1,3 @@ + quvi_t q = quvi_new(); + if (quvi_ok(q)) + quvi_supports(q, "http://nope", QUVI_SUPPORTS_MODE_OFFLINE, QUVI_SUPPORTS_TYPE_MEDIA); diff --git a/waftools/fragments/mng.c b/waftools/fragments/mng.c new file mode 100644 index 0000000000..7befc7e895 --- /dev/null +++ b/waftools/fragments/mng.c @@ -0,0 +1,7 @@ +#include <libmng.h> + +int main(int argc, char **argv) +{ + const char * p_ver = mng_version_text(); + return !p_ver || p_ver[0] == 0; +} diff --git a/waftools/fragments/oss_audio.c b/waftools/fragments/oss_audio.c new file mode 100644 index 0000000000..e23979da97 --- /dev/null +++ b/waftools/fragments/oss_audio.c @@ -0,0 +1,11 @@ +#if HAVE_SOUNDCARD_H +#include <soundcard.h> +#endif + +#if HAVE_SYS_SOUNDCARD_H +#include <sys/soundcard.h> +#endif + +int main(int argc, char **argv) { + return SNDCTL_DSP_SETFRAGMENT; +} diff --git a/waftools/fragments/oss_audio_header.c b/waftools/fragments/oss_audio_header.c new file mode 100644 index 0000000000..980eb69215 --- /dev/null +++ b/waftools/fragments/oss_audio_header.c @@ -0,0 +1,13 @@ +#if HAVE_SOUNDCARD_H +#include <soundcard.h> +#endif + +#if HAVE_SYS_SOUNDCARD_H +#include <sys/soundcard.h> +#endif + +#ifdef OPEN_SOUND_SYSTEM +int main(void) {{ return 0; }} +#else +#error Not the real thing +#endif diff --git a/waftools/fragments/pthreads.c b/waftools/fragments/pthreads.c new file mode 100644 index 0000000000..6702f36f97 --- /dev/null +++ b/waftools/fragments/pthreads.c @@ -0,0 +1,10 @@ +#include <pthread.h> +static void *func(void *arg) { return arg; } +int main(void) { + pthread_t tid; +#ifdef PTW32_STATIC_LIB + pthread_win32_process_attach_np(); + pthread_win32_thread_attach_np(); +#endif + return pthread_create (&tid, 0, func, 0) != 0; +} diff --git a/waftools/fragments/pvr.c b/waftools/fragments/pvr.c new file mode 100644 index 0000000000..be301e11e5 --- /dev/null +++ b/waftools/fragments/pvr.c @@ -0,0 +1,7 @@ +#include <sys/time.h> +#include <linux/videodev2.h> +int main(void) +{ + struct v4l2_ext_controls ext; + return ext.controls->value; +} diff --git a/waftools/fragments/vcd_windows.c b/waftools/fragments/vcd_windows.c new file mode 100644 index 0000000000..8d33127043 --- /dev/null +++ b/waftools/fragments/vcd_windows.c @@ -0,0 +1,7 @@ +#include <windows.h> +#include <ntddcdrm.h> + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/waftools/fragments/wasapi.c b/waftools/fragments/wasapi.c new file mode 100644 index 0000000000..ef3b3f7866 --- /dev/null +++ b/waftools/fragments/wasapi.c @@ -0,0 +1,19 @@ +#define COBJMACROS 1 +#define _WIN32_WINNT 0x600 +#include <malloc.h> +#include <stdlib.h> +#include <process.h> +#include <initguid.h> +#include <audioclient.h> +#include <endpointvolume.h> +#include <mmdeviceapi.h> +#include <avrt.h> + const GUID *check1[] = { + &IID_IAudioClient, + &IID_IAudioRenderClient, + &IID_IAudioClient, + &IID_IAudioEndpointVolume, + }; +int main(void) { + return 0; +} diff --git a/waftools/fragments/xf86vm.c b/waftools/fragments/xf86vm.c new file mode 100644 index 0000000000..195e514d6c --- /dev/null +++ b/waftools/fragments/xf86vm.c @@ -0,0 +1,8 @@ +#include <X11/Xlib.h> +#include <X11/extensions/xf86vmode.h> + +int main(int argc, char **argv) +{ + XF86VidModeQueryExtension(0, 0, 0); + return 0; +} diff --git a/waftools/fragments/xf86xk.c b/waftools/fragments/xf86xk.c new file mode 100644 index 0000000000..541e7ce3af --- /dev/null +++ b/waftools/fragments/xf86xk.c @@ -0,0 +1,6 @@ +#include <X11/XF86keysym.h> + +int main(int argc, char **argv) +{ + return XF86XK_AudioPause; +} |