Commit b09f478e authored by Nirbheek Chauhan's avatar Nirbheek Chauhan Committed by Tim-Philipp Müller

Add support for Meson as alternative/parallel build system

https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Jussi Pakkanen <jpakkane@gmail.com> (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.
parent 655856de
aclocal.m4
autom4te.cache
config.h*
config.h
config.h.in
config.h-new
config.log
config.status
config.guess
......@@ -61,3 +63,6 @@ Build
/test-driver
*.log
*.trs
/build
/subprojects
/* 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
/* 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 aalib ASCII Art library (used by aasink). */
#mesondefine HAVE_AALIB
/* Define to 1 if you have the `asinh' function. */
#mesondefine HAVE_ASINH
/* Define to enable bz2 library for matroska . */
#mesondefine HAVE_BZ2
/* Define to enable Cairo graphics rendering and gobject bindings (used by
cairo). */
#mesondefine HAVE_CAIRO
/* 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 to 1 if you have the `clock_gettime' function. */
#mesondefine HAVE_CLOCK_GETTIME
/* Define to 1 if you have the `cosh' function. */
#mesondefine HAVE_COSH
/* 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 enable DirectSound plug-in (used by directsoundsink). */
#mesondefine HAVE_DIRECTSOUND
/* Define to 1 if you have the <dlfcn.h> header file. */
#mesondefine HAVE_DLFCN_H
/* define for working do while(0) macros */
#mesondefine HAVE_DOWHILE_MACROS
/* Define to enable raw1394 and avc1394 library (used by 1394). */
#mesondefine HAVE_DV1394
/* Define to enable building of experimental plug-ins. */
#mesondefine HAVE_EXPERIMENTAL
/* Define to enable building of plug-ins with external deps. */
#mesondefine HAVE_EXTERNAL
/* Define to 1 if you have the <fcntl.h> header file. */
#mesondefine HAVE_FCNTL_H
/* FIONREAD ioctl found in sys/filio.h */
#mesondefine HAVE_FIONREAD_IN_SYS_FILIO
/* FIONREAD ioctl found in sys/ioclt.h */
#mesondefine HAVE_FIONREAD_IN_SYS_IOCTL
/* Define to enable FLAC lossless audio (used by flac). */
#mesondefine HAVE_FLAC
/* Define to 1 if you have the `fpclass' function. */
#mesondefine HAVE_FPCLASS
/* Define if compiler supports gcc inline assembly */
#mesondefine HAVE_GCC_ASM
/* Define to enable GDK pixbuf (used by gdkpixbuf). */
#mesondefine HAVE_GDK_PIXBUF
/* Define to 1 if you have the `getpagesize' function. */
#mesondefine HAVE_GETPAGESIZE
/* Define if the GNU gettext() function is already present or preinstalled. */
#mesondefine HAVE_GETTEXT
/* Define to enable Video 4 Linux 2 (used by video4linux2). */
#mesondefine HAVE_GST_V4L2
/* Whether gudev is available for device detection */
#mesondefine HAVE_GUDEV
/* Define if you have the iconv() function and it works. */
#mesondefine HAVE_ICONV
/* Define to 1 if you have the <inttypes.h> header file. */
#mesondefine HAVE_INTTYPES_H
/* building for iOS platofrm */
#mesondefine HAVE_IOS
/* Define if we have struct ip_mreqn */
#mesondefine HAVE_IP_MREQN
/* Define to 1 if you have the `isinf' function. */
#mesondefine HAVE_ISINF
/* Define to enable Jack (used by jack). */
#mesondefine HAVE_JACK
/* defined if jack >= 0.120.1 is available */
#mesondefine HAVE_JACK_0_120_1
/* defined if jack >= 1.9.7 is available */
#mesondefine HAVE_JACK_1_9_7
/* Define to enable jpeg library (used by jpeg). */
#mesondefine HAVE_JPEG
/* Define to enable libcaca coloured ASCII art (used by cacasink). */
#mesondefine HAVE_LIBCACA
/* Define to enable libdv DV demuxer/decoder (used by dv). */
#mesondefine HAVE_LIBDV
/* Define to enable Portable Network Graphics library (used by png). */
#mesondefine HAVE_LIBPNG
/* Whether libv4l2 is available for video buffer conversion */
#mesondefine HAVE_LIBV4L2
/* Define to 1 if you have the <memory.h> header file. */
#mesondefine HAVE_MEMORY_H
/* Define to 1 if you have a working `mmap' system call. */
#mesondefine HAVE_MMAP
/* Use Orc */
#mesondefine HAVE_ORC
/* Define to enable OSS audio (used by ossaudio). */
#mesondefine HAVE_OSS
/* Define to enable Open Sound System 4 (used by oss4). */
#mesondefine HAVE_OSS4
/* Define if OSS includes are in /machine/ */
#mesondefine HAVE_OSS_INCLUDE_IN_MACHINE
/* Define if OSS includes are in / */
#mesondefine HAVE_OSS_INCLUDE_IN_ROOT
/* Define if OSS includes are in /sys/ */
#mesondefine HAVE_OSS_INCLUDE_IN_SYS
/* Define to enable OSX audio (used by osxaudio). */
#mesondefine HAVE_OSX_AUDIO
/* Define to enable OSX video (used by osxvideosink). */
#mesondefine HAVE_OSX_VIDEO
/* Define to 1 if you have the <process.h> header file. */
#mesondefine HAVE_PROCESS_H
/* Define to enable pulseaudio plug-in (used by pulseaudio). */
#mesondefine HAVE_PULSE
/* Define if RDTSC is available */
#mesondefine HAVE_RDTSC
/* Define to 1 if you have the `rint' function. */
#mesondefine HAVE_RINT
/* Define to enable Shoutcast/Icecast client library (used by shout2). */
#mesondefine HAVE_SHOUT2
/* Define to 1 if you have the `sinh' function. */
#mesondefine HAVE_SINH
/* Define to enable soup http client plugin (2.4) (used by souphttpsrc). */
#mesondefine HAVE_SOUP
/* Define to enable speex speech codec (used by speex). */
#mesondefine HAVE_SPEEX
/* Define to 1 if you have the <stdint.h> header file. */
#mesondefine HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#mesondefine HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#mesondefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#mesondefine HAVE_STRING_H
/* Define to enable Sun Audio (used by sunaudio). */
#mesondefine HAVE_SUNAUDIO
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#mesondefine HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/param.h> header file. */
#mesondefine HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#mesondefine HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#mesondefine HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#mesondefine HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#mesondefine HAVE_SYS_TYPES_H
/* Define to enable taglib tagging library (used by taglib). */
#mesondefine HAVE_TAGLIB
/* Define to 1 if you have the <unistd.h> header file. */
#mesondefine HAVE_UNISTD_H
/* Define if valgrind should be used */
#mesondefine HAVE_VALGRIND
/* Defined if the VP8 decoder is available */
#mesondefine HAVE_VP8_DECODER
/* Defined if the VP8 encoder is available */
#mesondefine HAVE_VP8_ENCODER
/* Defined if the VP9 decoder is available */
#mesondefine HAVE_VP9_DECODER
/* Defined if the VP9 encoder is available */
#mesondefine HAVE_VP9_ENCODER
/* Define to enable VPX decoder (used by vpx). */
#mesondefine HAVE_VPX
/* Define to enable Win32 WaveForm (used by waveformsink). */
#mesondefine HAVE_WAVEFORM
/* Define to enable wavpack plug-in (used by wavpack). */
#mesondefine HAVE_WAVPACK
/* Define to enable X libraries and plugins (used by ximagesrc). */
#mesondefine HAVE_X
/* Define to enable X Shared Memory extension. */
#mesondefine HAVE_XSHM
/* Define to enable zlib support for qtdemux/matroska. */
#mesondefine HAVE_ZLIB
/* 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
/* defined if speex 1.0.x API detected */
#mesondefine SPEEX_1_0
/* 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
/* old wavpack API */
#mesondefine WAVPACK_OLD_API
/* 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
/* Define to 1 if the X Window System is missing or not being used. */
#mesondefine X_DISPLAY_MISSING
cairo_dep = dependency('cairo-gobject', version : '>=1.10.0', required : false)
if cairo_dep.found()
gstcairo = library('gstcairo',
'gstcairo.c', 'gstcairooverlay.c',
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, cairo_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
dv_sources = [
'gstdv.c',
'gstdvdec.c',
'gstdvdemux.c',
'gstsmptetimecode.c',
'smpte_test.c',
]
dv_dep = dependency('libdv', version : '>= 0.100', required : false)
if dv_dep.found()
gstdv = library('gstdv',
dv_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, gstvideo_dep, dv_dep],
install : true,
install_dir : plugins_install_dir,
)
#executable('smpte_test',
# 'smpte_test.c', 'gstsmptetimecode.c',
# dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, gstvideo_dep, dv_dep],
# install : false)
endif
flac_sources = [
'gstflac.c',
'gstflacdec.c',
'gstflacenc.c',
'gstflactag.c',
]
flac_dep = dependency('flac', version : '>=1.1.4', required : false)
if flac_dep.found()
gstflac = library('gstflac',
flac_sources,
c_args : gst_plugins_good_args + ['-DGST_USE_UNSTABLE_API'],
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, flac_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
pixbuf_sources = [
'gstgdkpixbufdec.c',
'gstgdkpixbufoverlay.c',
'gstgdkpixbufplugin.c',
'gstgdkpixbufsink.c',
]
gdkpixbuf_dep = dependency('gdk-pixbuf-2.0', version : '>=2.8.0', required : false)
if gdkpixbuf_dep.found()
gstgdkpixbuf = library('gstgdkpixbuf',
pixbuf_sources,
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, gstcontroller_dep, gdkpixbuf_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
jack_sources = [
'gstjackaudioclient.c',
'gstjackaudiosink.c',
'gstjackaudiosrc.c',
'gstjack.c',
'gstjackutil.c',
]
libjack_dep = dependency('jack', version : '>= 1.9.7', required : false)
if libjack_dep.found()
gstjack = library('gstjack',
jack_sources,
c_args : gst_plugins_good_args + ['-DHAVE_JACK_1_9_7'],
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gstaudio_dep, libjack_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
jpeg_sources = [
'gstjpeg.c',
'gstjpegenc.c',
'gstjpegdec.c',
]
jpeglib = cc.find_library('jpeg', required : false)
if jpeglib.found()
gstjpeg = library('gstjpeg',
jpeg_sources,
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gstvideo_dep, jpeglib, libm],
install : true,
install_dir : plugins_install_dir,
)
endif
png_sources = [
'gstpng.c',
'gstpngenc.c',
'gstpngdec.c',
]
libpng_dep = dependency('libpng', version : '>=1.2', required : false)
if libpng_dep.found()
gstpng = library('gstpng',
png_sources,
c_args : gst_plugins_good_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, gstvideo_dep, libpng_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
# subdir('aalib')
subdir('cairo')
subdir('flac')
subdir('gdk_pixbuf')
subdir('jack')
subdir('jpeg')
# subdir('libcaca')
# FIXME: dv plugin fails to link with msvc, wants pthread.lib
if cc.get_id() != 'msvc'
subdir('dv')
endif
subdir('libpng')
# subdir('raw1394')
subdir('pulse')
subdir('shout2')
subdir('soup')
subdir('speex')
# FIXME: taglib fails to compile and link with msvc
if cc.get_id() != 'msvc'
subdir('taglib')
endif
subdir('vpx')
subdir('wavpack')
pulse_sources = [
'plugin.c',
'pulsesink.c',
'pulsesrc.c',
'pulsedeviceprovider.c',
'pulseutil.c',
]
libpulse_dep = dependency('libpulse', version : '>=2.0', required : false)
if libpulse_dep.found()
gstpulse = library('gstpulse',
pulse_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gstaudio_dep, gstpbutils_dep, libpulse_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
shout2_sources = ['gstshout2.c']
shout2_dep = dependency('shout', version : '>= 2.0', required : false)
if shout2_dep.found()
gstshout2 = library('gstshout2',
shout2_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstbase_dep, shout2_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
soup_sources = [
'gstsouphttpsrc.c',
'gstsouphttpclientsink.c',
'gstsouputils.c',
'gstsoup.c',
]
soup_args = [
'-DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_48',
'-DSOUP_VERSION_MAX_ALLOWED=SOUP_DEPRECATED_IN_2_48',
]
libsoup_dep = dependency('libsoup-2.4', version : '>=2.48', required : false)
if libsoup_dep.found()
gstsouphttpsrc = library('gstsouphttpsrc',
soup_sources,
c_args : gst_plugins_good_args + soup_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gst_dep, gstbase_dep, gsttag_dep, libsoup_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
speex_sources = [
'gstspeex.c',
'gstspeexdec.c',
'gstspeexenc.c',
]
speex_dep = dependency('speex', version : '>=1.1.6', required : false)
if speex_dep.found()
gstspeex = library('gstspeex',
speex_sources,
c_args : gst_plugins_good_args + ['-DGST_USE_UNSTABLE_API'],
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gsttag_dep, gstaudio_dep, speex_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
endif
taglib_sources = [
'gstapev2mux.cc',
'gstid3v2mux.cc',
'gsttaglibplugin.c',
]
taglib_dep = dependency('taglib', version : '>= 1.5', required : false)
if taglib_dep.found() and add_languages('cpp')
gsttaglib = library('gsttaglib',
taglib_sources,
c_args : gst_plugins_good_args + ['-DGST_USE_UNSTABLE_API'],
include_directories : [configinc, libsinc],
dependencies : [gsttag_dep, taglib_dep],
install : true,
install_dir : plugins_install_dir,
)
endif
vpx_sources = [
'gstvp8dec.c',
'gstvp8enc.c',
'gstvp8utils.c',
'gstvp9dec.c',
'gstvp9enc.c',
'gstvpxdec.c',
'gstvpxenc.c',
'plugin.c',
]
vpx_features = [
[ 'vpx/vp8cx.h', 'vpx_codec_vp8_cx_algo', '-DHAVE_VP8_ENCODER', 'VP8 encoder' ],
[ 'vpx/vp8dx.h', 'vpx_codec_vp8_dx_algo', '-DHAVE_VP8_DECODER', 'VP8 decoder' ],
[ 'vpx/vp8cx.h', 'vpx_codec_vp9_cx_algo', '-DHAVE_VP9_ENCODER', 'VP9 encoder' ],
[ 'vpx/vp8dx.h', 'vpx_codec_vp9_dx_algo', '-DHAVE_VP9_DECODER', 'VP9 decoder' ],
]
vpx_dep = dependency('vpx', version : '>=1.3.0', required : false)
if vpx_dep.found()
vpx_args = []
foreach f : vpx_features
header = f.get(0)
codec_iface = f.get(1)
extra_define = f.get(2)
link_code = '''#include <@0@>
int main (int a, char ** g) {
const vpx_codec_iface_t *c = &@1@;
return c != 0;
}'''.format(header,codec_iface)
# FIXME: should take dependencies : vpx_dep argument
if cc.links(link_code, args : ['-lvpx'])
vpx_args += extra_define
message('libvpx provides @0@ interface (@1@)'.format(f.get(3),f.get(1)))
else
message('libvpx does not provide @0@ interface (@1@)'.format(f.get(3),f.get(1)))
endif
endforeach
if vpx_args.length() == 0
message('WARNING: libvpx was built without any encoder or decoder features!')
endif
if dependency('vpx', version : '>=1.4.0').found()
vpx_args += '-DHAVE_VPX_1_4'
endif
gstvpx = library('gstvpx',