From c8260a15459cc809b1b7390ba0bd19124b09f070 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 12 Aug 2016 21:25:34 +0530 Subject: [PATCH] Add support for Meson as alternative/parallel build system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/mesonbuild/meson With contributions from: Tim-Philipp Müller Jussi Pakkanen (original port) Highlights of the features provided are: * Faster builds on Linux (~40-50% faster) * The ability to build with MSVC on Windows * Generate Visual Studio project files * Generate XCode project files * Much faster builds on Windows (on-par with Linux) * Seriously fast configure and building on embedded ... and many more. For more details see: http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html Building with Meson should work on both Linux and Windows, but may need a few more tweaks on other operating systems. --- .gitignore | 4 + config.h.meson | 294 +++++++++++++++++++++++++++++++++++++ ext/a52dec/meson.build | 12 ++ ext/amrnb/meson.build | 12 ++ ext/amrwbdec/meson.build | 12 ++ ext/cdio/meson.build | 12 ++ ext/dvdread/meson.build | 13 ++ ext/lame/meson.build | 19 +++ ext/mad/meson.build | 15 ++ ext/meson.build | 12 ++ ext/mpeg2dec/meson.build | 12 ++ ext/mpg123/meson.build | 16 ++ ext/twolame/meson.build | 12 ++ ext/x264/meson.build | 16 ++ gst/asfdemux/meson.build | 17 +++ gst/dvdlpcmdec/meson.build | 12 ++ gst/dvdsub/meson.build | 13 ++ gst/meson.build | 5 + gst/realmedia/meson.build | 23 +++ gst/xingmux/meson.build | 13 ++ meson.build | 125 ++++++++++++++++ 21 files changed, 669 insertions(+) create mode 100644 config.h.meson create mode 100644 ext/a52dec/meson.build create mode 100644 ext/amrnb/meson.build create mode 100644 ext/amrwbdec/meson.build create mode 100644 ext/cdio/meson.build create mode 100644 ext/dvdread/meson.build create mode 100644 ext/lame/meson.build create mode 100644 ext/mad/meson.build create mode 100644 ext/meson.build create mode 100644 ext/mpeg2dec/meson.build create mode 100644 ext/mpg123/meson.build create mode 100644 ext/twolame/meson.build create mode 100644 ext/x264/meson.build create mode 100644 gst/asfdemux/meson.build create mode 100644 gst/dvdlpcmdec/meson.build create mode 100644 gst/dvdsub/meson.build create mode 100644 gst/meson.build create mode 100644 gst/realmedia/meson.build create mode 100644 gst/xingmux/meson.build create mode 100644 meson.build diff --git a/.gitignore b/.gitignore index ecd79852ea..fc746d9c31 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,7 @@ Build /test-driver *.log *.trs + +# Meson +/build +/subprojects diff --git a/config.h.meson b/config.h.meson new file mode 100644 index 0000000000..2fef992f31 --- /dev/null +++ b/config.h.meson @@ -0,0 +1,294 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#mesondefine AC_APPLE_UNIVERSAL_BUILD + +/* Default audio sink */ +#mesondefine DEFAULT_AUDIOSINK + +/* Default audio source */ +#mesondefine DEFAULT_AUDIOSRC + +/* Default video sink */ +#mesondefine DEFAULT_VIDEOSINK + +/* Default video source */ +#mesondefine DEFAULT_VIDEOSRC + +/* Default visualizer */ +#mesondefine DEFAULT_VISUALIZER + +/* Disable Orc */ +#mesondefine DISABLE_ORC + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#mesondefine ENABLE_NLS + +/* gettext package name */ +#mesondefine GETTEXT_PACKAGE + +/* The GIO library directory. */ +#mesondefine GIO_LIBDIR + +/* The GIO modules directory. */ +#mesondefine GIO_MODULE_DIR + +/* GStreamer API Version */ +#mesondefine GST_API_VERSION + +/* macro to use to show function name */ +#mesondefine GST_FUNCTION + +/* Defined if gcov is enabled to force a rebuild due to config.h changing */ +#mesondefine GST_GCOV_ENABLED + +/* Default errorlevel to use */ +#mesondefine GST_LEVEL_DEFAULT + +/* GStreamer license */ +#mesondefine GST_LICENSE + +/* package name in plugins */ +#mesondefine GST_PACKAGE_NAME + +/* package origin */ +#mesondefine GST_PACKAGE_ORIGIN + +/* GStreamer package release date/time for plugins as YYYY-MM-DD */ +#mesondefine GST_PACKAGE_RELEASE_DATETIME + +/* Define if static plugins should be built */ +#mesondefine GST_PLUGIN_BUILD_STATIC + +/* Define to enable a52dec (used by a52dec). */ +#mesondefine HAVE_A52DEC + +/* Define to enable amrnb library (used by amrnb). */ +#mesondefine HAVE_AMRNB + +/* Define to enable amrwb library (used by amrwbdec). */ +#mesondefine HAVE_AMRWB + +/* Define to enable cdio library (used by cdio). */ +#mesondefine HAVE_CDIO + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#mesondefine HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#mesondefine HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define if the target CPU is an Alpha */ +#mesondefine HAVE_CPU_ALPHA + +/* Define if the target CPU is an ARM */ +#mesondefine HAVE_CPU_ARM + +/* Define if the target CPU is a CRIS */ +#mesondefine HAVE_CPU_CRIS + +/* Define if the target CPU is a CRISv32 */ +#mesondefine HAVE_CPU_CRISV32 + +/* Define if the target CPU is a HPPA */ +#mesondefine HAVE_CPU_HPPA + +/* Define if the target CPU is an x86 */ +#mesondefine HAVE_CPU_I386 + +/* Define if the target CPU is a IA64 */ +#mesondefine HAVE_CPU_IA64 + +/* Define if the target CPU is a M68K */ +#mesondefine HAVE_CPU_M68K + +/* Define if the target CPU is a MIPS */ +#mesondefine HAVE_CPU_MIPS + +/* Define if the target CPU is a PowerPC */ +#mesondefine HAVE_CPU_PPC + +/* Define if the target CPU is a 64 bit PowerPC */ +#mesondefine HAVE_CPU_PPC64 + +/* Define if the target CPU is a S390 */ +#mesondefine HAVE_CPU_S390 + +/* Define if the target CPU is a SPARC */ +#mesondefine HAVE_CPU_SPARC + +/* Define if the target CPU is a x86_64 */ +#mesondefine HAVE_CPU_X86_64 + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#mesondefine HAVE_DCGETTEXT + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_DLFCN_H + +/* define for working do while(0) macros */ +#mesondefine HAVE_DOWHILE_MACROS + +/* Define to enable dvdread library (used by dvdreadsrc). */ +#mesondefine HAVE_DVDREAD + +/* Define to enable building of experimental plug-ins. */ +#mesondefine HAVE_EXPERIMENTAL + +/* Define to enable building of plug-ins with external deps. */ +#mesondefine HAVE_EXTERNAL + +/* defined if the compiler implements __func__ */ +#mesondefine HAVE_FUNC + +/* defined if the compiler implements __FUNCTION__ */ +#mesondefine HAVE_FUNCTION + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#mesondefine HAVE_GETTEXT + +/* Define if you have the iconv() function and it works. */ +#mesondefine HAVE_ICONV + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_INTTYPES_H + +/* Define to enable lame mp3 encoder library (used by lame). */ +#mesondefine HAVE_LAME + +/* Define to enable mad mp3 decoder (used by mad). */ +#mesondefine HAVE_MAD + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_MALLOC_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_MEMORY_H + +/* Define to enable mpeg2dec (used by mpeg2dec). */ +#mesondefine HAVE_MPEG2DEC + +/* Defined for newer opencore-amrnb */ +#mesondefine HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER + +/* Defined for newer opencore-amrwb */ +#mesondefine HAVE_OPENCORE_AMRWB_0_1_3_OR_LATER + +/* Use Orc */ +#mesondefine HAVE_ORC + +/* defined if the compiler implements __PRETTY_FUNCTION__ */ +#mesondefine HAVE_PRETTY_FUNCTION + +/* Define if RDTSC is available */ +#mesondefine HAVE_RDTSC + +/* Define to enable libsidplay (used by sid). */ +#mesondefine HAVE_SIDPLAY + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_TYPES_H + +/* Define to enable twolame (used by twolame). */ +#mesondefine HAVE_TWOLAME + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_UNISTD_H + +/* Define if valgrind should be used */ +#mesondefine HAVE_VALGRIND + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_WINSOCK2_H + +/* Define to enable x264 plug-in (used by x264). */ +#mesondefine HAVE_X264 + +/* the host CPU */ +#mesondefine HOST_CPU + +/* gettext locale dir */ +#mesondefine LOCALEDIR + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#mesondefine LT_OBJDIR + +/* Name of package */ +#mesondefine PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#mesondefine PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#mesondefine PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#mesondefine PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#mesondefine PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#mesondefine PACKAGE_URL + +/* Define to the version of this package. */ +#mesondefine PACKAGE_VERSION + +/* directory where plugins are located */ +#mesondefine PLUGINDIR + +/* The size of `char', as computed by sizeof. */ +#mesondefine SIZEOF_CHAR + +/* The size of `int', as computed by sizeof. */ +#mesondefine SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#mesondefine SIZEOF_LONG + +/* The size of `short', as computed by sizeof. */ +#mesondefine SIZEOF_SHORT + +/* The size of `void*', as computed by sizeof. */ +#mesondefine SIZEOF_VOIDP + +/* Define to 1 if you have the ANSI C header files. */ +#mesondefine STDC_HEADERS + +/* the target CPU */ +#mesondefine TARGET_CPU + +/* Version number of package */ +#mesondefine VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif diff --git a/ext/a52dec/meson.build b/ext/a52dec/meson.build new file mode 100644 index 0000000000..35d9d7a44c --- /dev/null +++ b/ext/a52dec/meson.build @@ -0,0 +1,12 @@ +a52_dep = cc.find_library('a52', required : false) + +if a52_dep.found() and cc.has_header_symbol('a52dec/a52.h', 'a52_init', prefix : '#include ') + a52dec = library('gsta52dec', + 'gsta52dec.c', + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstaudio_dep, orc_dep, a52_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/amrnb/meson.build b/ext/amrnb/meson.build new file mode 100644 index 0000000000..33cc68585c --- /dev/null +++ b/ext/amrnb/meson.build @@ -0,0 +1,12 @@ +amrnb_dep = dependency('opencore-amrnb', version : '>= 0.1.3', required : false) + +if amrnb_dep.found() + amrnb = library('gstamrnb', + ['amrnb.c', 'amrnbdec.c', 'amrnbenc.c'], + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstaudio_dep, amrnb_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/amrwbdec/meson.build b/ext/amrwbdec/meson.build new file mode 100644 index 0000000000..9bba8ae0eb --- /dev/null +++ b/ext/amrwbdec/meson.build @@ -0,0 +1,12 @@ +amrwb_dep = dependency('opencore-amrwb', version : '>= 0.1.3', required : false) + +if amrwb_dep.found() + amrwbdec = library('gstamrwbdec', + ['amrwb.c', 'amrwbdec.c'], + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstaudio_dep, amrwb_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/cdio/meson.build b/ext/cdio/meson.build new file mode 100644 index 0000000000..954b6b1cf1 --- /dev/null +++ b/ext/cdio/meson.build @@ -0,0 +1,12 @@ +cdio_dep = dependency('libcdio', version : '>= 0.76', required : false) + +if cdio_dep.found() + cdio = library('gstcdio', + ['gstcdio.c', 'gstcdiocddasrc.c'], + c_args : ugly_args, + include_directories : [configinc, libsinc], + dependencies : [gstaudio_dep, gsttag_dep, cdio_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/dvdread/meson.build b/ext/dvdread/meson.build new file mode 100644 index 0000000000..203f89e335 --- /dev/null +++ b/ext/dvdread/meson.build @@ -0,0 +1,13 @@ +gmodule_dep = dependency('gmodule-2.0', required : false) +dvdread_dep = dependency('dvdread', version : '>= 0.5.0', required : false) + +if gmodule_dep.found() and dvdread_dep.found() + dvdread = library('gstdvdread', + ['dvdreadsrc.c'], + c_args : ugly_args, + include_directories : [configinc, libsinc], + dependencies : [gstbase_dep, gmodule_dep, dvdread_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/lame/meson.build b/ext/lame/meson.build new file mode 100644 index 0000000000..2812cb9306 --- /dev/null +++ b/ext/lame/meson.build @@ -0,0 +1,19 @@ +lame_dep = cc.find_library('mp3lame', required : false) + +if lame_dep.found() and cc.has_header_symbol('lame/lame.h', 'lame_init') + lame_extra_c_args = [] + if cc.has_header_symbol('lame/lame.h', 'lame_set_VBR_quality') + lame_extra_c_args += ['-DHAVE_LAME_SET_VBR_QUALITY'] + endif + if cc.has_header_symbol('lame/lame.h', 'MEDIUM') + lame_extra_c_args += ['-DGSTLAME_PRESET'] + endif + lame = library('gstlame', + ['gstlamemp3enc.c', 'plugin.c'], + c_args : ugly_args + lame_extra_c_args, + include_directories : [configinc, libsinc], + dependencies : [gstaudio_dep, lame_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/mad/meson.build b/ext/mad/meson.build new file mode 100644 index 0000000000..c8983ff8a8 --- /dev/null +++ b/ext/mad/meson.build @@ -0,0 +1,15 @@ +mad_dep = dependency('mad', version : '>= 0.15', required : false) +if not mad_dep.found() and cc.has_header_symbol('mad.h', 'mad_decoder_finish') + mad_dep = cc.find_library('mad', required : false) +endif + +if mad_dep.found() + mad = library('gstmad', + ['gstmad.c'], + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstaudio_dep, mad_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/meson.build b/ext/meson.build new file mode 100644 index 0000000000..11728a9d41 --- /dev/null +++ b/ext/meson.build @@ -0,0 +1,12 @@ +subdir('a52dec') +subdir('amrnb') +subdir('amrwbdec') +subdir('cdio') +subdir('dvdread') +subdir('lame') +subdir('mad') +subdir('mpeg2dec') +subdir('mpg123') +#subdir('sidplay') # FIXME +subdir('twolame') +subdir('x264') diff --git a/ext/mpeg2dec/meson.build b/ext/mpeg2dec/meson.build new file mode 100644 index 0000000000..d0d7d5c079 --- /dev/null +++ b/ext/mpeg2dec/meson.build @@ -0,0 +1,12 @@ +mpeg2_dep = dependency('libmpeg2', version : '>= 0.4.0', required : false) + +if mpeg2_dep.found() + mpeg2dec = library('gstmpeg2dec', + ['gstmpeg2dec.c'], + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstvideo_dep, mpeg2_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/mpg123/meson.build b/ext/mpg123/meson.build new file mode 100644 index 0000000000..a575449bdf --- /dev/null +++ b/ext/mpg123/meson.build @@ -0,0 +1,16 @@ +mpg123_sources = [ + 'gstmpg123audiodec.c', +] + +mpg123_dep = dependency('libmpg123', version : '>= 1.3', required : false) + +if mpg123_dep.found() + gstmpg123 = library('gstmpg123', + mpg123_sources, + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstaudio_dep, mpg123_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/twolame/meson.build b/ext/twolame/meson.build new file mode 100644 index 0000000000..029a00eb4b --- /dev/null +++ b/ext/twolame/meson.build @@ -0,0 +1,12 @@ +twolame_dep = dependency('twolame', version : '>= 0.3.10', required : false) + +if twolame_dep.found() + twolame = library('gsttwolame', + ['gsttwolamemp2enc.c'], + c_args : ugly_args, + include_directories : [configinc, libsinc], + dependencies : [gstaudio_dep, twolame_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/ext/x264/meson.build b/ext/x264/meson.build new file mode 100644 index 0000000000..3aead3bde8 --- /dev/null +++ b/ext/x264/meson.build @@ -0,0 +1,16 @@ +x264_sources = [ + 'gstx264enc.c', +] + +x264_dep = dependency('x264', required : false) + +if x264_dep.found() + gstx264 = library('gstx264', + x264_sources, + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, x264_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/gst/asfdemux/meson.build b/gst/asfdemux/meson.build new file mode 100644 index 0000000000..e30c8075e0 --- /dev/null +++ b/gst/asfdemux/meson.build @@ -0,0 +1,17 @@ +asf_sources = [ + 'gstasfdemux.c', + 'gstasf.c', + 'asfheaders.c', + 'asfpacket.c', + 'gstrtpasfdepay.c', + 'gstrtspwms.c', +] + +gstasf = library('gstasf', + asf_sources, + c_args : ugly_args, + include_directories : [configinc, libsinc], + dependencies : [gstbase_dep, gstrtp_dep, gstvideo_dep, gstaudio_dep, gsttag_dep, gstriff_dep, gstrtsp_dep], + install : true, + install_dir : plugins_install_dir, +) diff --git a/gst/dvdlpcmdec/meson.build b/gst/dvdlpcmdec/meson.build new file mode 100644 index 0000000000..4aef59e504 --- /dev/null +++ b/gst/dvdlpcmdec/meson.build @@ -0,0 +1,12 @@ +dvdpl_sources = [ + 'gstdvdlpcmdec.c' +] + +gstdvdlpcmdec = library('gstdvdlpcmdec', + dvdpl_sources, + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstbase_dep, gstaudio_dep], + install : true, + install_dir : plugins_install_dir, +) diff --git a/gst/dvdsub/meson.build b/gst/dvdsub/meson.build new file mode 100644 index 0000000000..c13969b89a --- /dev/null +++ b/gst/dvdsub/meson.build @@ -0,0 +1,13 @@ +dvdsub_sources = [ + 'gstdvdsubdec.c', + 'gstdvdsubparse.c', +] + +gstdvdsub = library('gstdvdsub', + dvdsub_sources, + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstbase_dep, gstvideo_dep], + install : true, + install_dir : plugins_install_dir, +) diff --git a/gst/meson.build b/gst/meson.build new file mode 100644 index 0000000000..2bc6671c60 --- /dev/null +++ b/gst/meson.build @@ -0,0 +1,5 @@ +subdir('asfdemux') +subdir('dvdlpcmdec') +subdir('dvdsub') +subdir('realmedia') +subdir('xingmux') diff --git a/gst/realmedia/meson.build b/gst/realmedia/meson.build new file mode 100644 index 0000000000..4b55223717 --- /dev/null +++ b/gst/realmedia/meson.build @@ -0,0 +1,23 @@ +real_sources = [ + 'rademux.c', + 'rmdemux.c', + 'rmutils.c', + 'rdtdepay.c', + 'rdtmanager.c', + 'rtspreal.c', + 'realhash.c', + 'asmrules.c', + 'rdtjitterbuffer.c', + 'gstrdtbuffer.c', + 'pnmsrc.c', + 'realmedia.c' +] + +gstrmdemux = library('gstrmdemux', + real_sources, + c_args : ugly_args, + include_directories : [configinc, libsinc], + dependencies : [gstbase_dep, gstrtsp_dep, gstsdp_dep, gstpbutils_dep], + install : true, + install_dir : plugins_install_dir, +) diff --git a/gst/xingmux/meson.build b/gst/xingmux/meson.build new file mode 100644 index 0000000000..c17da1cb46 --- /dev/null +++ b/gst/xingmux/meson.build @@ -0,0 +1,13 @@ +xing_sources = [ + 'plugin.c', + 'gstxingmux.c', +] + +gstxingmux = library('gstxingmux', + xing_sources, + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstbase_dep], + install : true, + install_dir : plugins_install_dir, +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..5456b26404 --- /dev/null +++ b/meson.build @@ -0,0 +1,125 @@ +project('gst-plugins-ugly', 'c', + version : '1.9.1.1', + meson_version : '>= 0.32.0', + default_options : [ 'warning_level=1', + 'c_std=gnu99', + 'buildtype=debugoptimized' ]) + +gst_version = meson.project_version() +version_arr = gst_version.split('.') +gst_version_major = version_arr[0] +gst_version_minor = version_arr[1] +gst_version_micro = version_arr[2] +if version_arr.length() == 4 + gst_version_nano = version_arr[3] +else + gst_version_nano = 0 +endif + +glib_req = '>= 2.40.0' +gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) + +api_version = '1.0' + +plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir')) + +cc = meson.get_compiler('c') +cdata = configuration_data() +check_headers = [ + ['HAVE_DLFCN_H', 'dlfcn.h'], + ['HAVE_INTTYPES_H', 'inttypes.h'], + ['HAVE_MALLOC_H', 'malloc.h'], + ['HAVE_MEMORY_H', 'memory.h'], + ['HAVE_STDINT_H', 'stdint.h'], + ['HAVE_STDLIB_H', 'stdlib.h'], + ['HAVE_STRINGS_H', 'strings.h'], + ['HAVE_STRING_H', 'string.h'], + ['HAVE_SYS_STAT_H', 'sys/stat.h'], + ['HAVE_SYS_TYPES_H', 'sys/types.h'], + ['HAVE_UNISTD_H', 'unistd.h'], + ['HAVE_WINSOCK2_H', 'winsock2.h'], +] + +foreach h : check_headers + if cc.has_header(h.get(1)) + cdata.set(h.get(0), 1) + endif +endforeach + +check_functions = [ +# check token HAVE_CPU_ALPHA +# check token HAVE_CPU_ARM +# check token HAVE_CPU_CRIS +# check token HAVE_CPU_CRISV32 +# check token HAVE_CPU_HPPA +# check token HAVE_CPU_I386 +# check token HAVE_CPU_IA64 +# check token HAVE_CPU_M68K +# check token HAVE_CPU_MIPS +# check token HAVE_CPU_PPC +# check token HAVE_CPU_PPC64 +# check token HAVE_CPU_S390 +# check token HAVE_CPU_SPARC +# check token HAVE_CPU_X86_64 + ['HAVE_DCGETTEXT', 'dcgettext'], +# check token HAVE_EXPERIMENTAL +# check token HAVE_EXTERNAL +# check token HAVE_GETTEXT +# check token HAVE_VALGRIND +] + +foreach f : check_functions + if cc.has_function(f.get(1)) + cdata.set(f.get(0), 1) + endif +endforeach + +cdata.set('SIZEOF_CHAR', cc.sizeof('char')) +cdata.set('SIZEOF_INT', cc.sizeof('int')) +cdata.set('SIZEOF_LONG', cc.sizeof('long')) +cdata.set('SIZEOF_SHORT', cc.sizeof('short')) +cdata.set('SIZEOF_VOIDP', cc.sizeof('void*')) + +cdata.set('VERSION', '"@0@"'.format(gst_version)) +cdata.set('PACKAGE', '"gst-plugins-ugly"') +cdata.set('GETTEXT_PACKAGE', '"gst-plugins-ugly-1.0"') +cdata.set('GST_PACKAGE_NAME', '"GStreamer Ugly Plug-ins"') +cdata.set('GST_PACKAGE_ORIGIN', '"Unknown package origin"') +cdata.set('GST_LICENSE', '"LGPL"') + +# Mandatory GST deps +gst_dep = dependency('gstreamer-1.0', version : gst_req) +gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req) +gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req) +gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req) +gsttag_dep = dependency('gstreamer-tag-1.0', version : gst_req) +gstfft_dep = dependency('gstreamer-fft-1.0', version : gst_req) +gstaudio_dep = dependency('gstreamer-audio-1.0', version : gst_req) +gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req) +gstriff_dep = dependency('gstreamer-riff-1.0', version : gst_req) +gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req) +gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req) +gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req) +gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req) +gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req) +gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req) + +orc_dep = dependency('orc-0.4', version : '>= 0.4.16', required : false) +if orc_dep.found() + cdata.set('HAVE_ORC', 1) # used by a52dec for cpu detection +else + cdata.set('DISABLE_ORC', 1) +endif + +configure_file(input : 'config.h.meson', + output : 'config.h', + configuration : cdata) + +ugly_args = ['-DHAVE_CONFIG_H'] +configinc = include_directories('.') +libsinc = include_directories('gst-libs') + +subdir('gst') +subdir('ext') +# TODO +#subdir('tests')