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. --- 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 ++++++ 19 files changed, 212 insertions(+) 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 (limited to 'waftools/fragments') 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 +#import +#import + +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 +#include +#include + +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 +#include +#include +#include +#include +#include +#include +#include +#include +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 +#include +#include + +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 +#include +#include +#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 +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 +#include +#include +#include + +// 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 + +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 +#endif + +#if HAVE_SYS_SOUNDCARD_H +#include +#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 +#endif + +#if HAVE_SYS_SOUNDCARD_H +#include +#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 +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 +#include +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 +#include + +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 +#include +#include +#include +#include +#include +#include +#include + 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 +#include + +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 + +int main(int argc, char **argv) +{ + return XF86XK_AudioPause; +} -- cgit v1.2.3