udev-detect: Changes default latency 50ms to 25ms
[platform/upstream/pulseaudio.git] / meson.build
index 47f26bf..c93a73d 100644 (file)
@@ -4,6 +4,8 @@ project('pulseaudio', 'c', 'cpp',
         default_options : [ 'c_std=gnu11', 'cpp_std=c++11' ]
         )
 
+meson.add_dist_script('scripts/save-tarball-version.sh', meson.project_version())
+
 pa_version_str = meson.project_version()
 # For tarballs, the first split will do nothing, but for builds in git, we
 # split out suffixes when there are commits since the last tag
@@ -19,22 +21,37 @@ endif
 pa_version_major_minor = pa_version_major + '.' + pa_version_minor
 
 pa_api_version = 12
-pa_protocol_version = 33
+pa_protocol_version = 35
+
+# The stable ABI for client applications, for the version info x:y:z
+# always will hold x=z
+libpulse_version_info = [24, 0, 24]
+
+# A simplified, synchronous, ABI-stable interface for client
+# applications, for the version info x:y:z always will hold x=z
+libpulse_simple_version_info = [1, 1, 1]
 
-apiversion = '1.0'
-soversion = 0
-# FIXME: this doesn't actually do what we want it to
-# maintaining compatibility with the previous libtool versioning
-# current = minor * 100 + micro
-libversion = '@0@.@1@.0'.format(soversion, pa_version_minor.to_int() * 100 + pa_version_micro.to_int())
+# The ABI-stable GLib adapter for client applications, for the version
+# info x:y:z always will hold x=z
+libpulse_mainloop_glib_version_info = [0, 6, 0]
+
+libpulse_version = '@0@.@1@.@2@'.format(
+  libpulse_version_info[0] - libpulse_version_info[2],
+  libpulse_version_info[0],
+  libpulse_version_info[1],
+)
 
-# A simplified, synchronous, ABI-stable interface for client applications.
-# For the version x:y:z always will hold y=z.
-libpulse_simple_version = '1.1.1'
+libpulse_simple_version = '@0@.@1@.@2@'.format(
+  libpulse_simple_version_info[0] - libpulse_simple_version_info[2],
+  libpulse_simple_version_info[0],
+  libpulse_simple_version_info[1],
+)
 
-# The ABI-stable GLib adapter for client applications.
-# For the version x:y:z always will hold y=z.
-libpulse_mainloop_glib_version = '0.5.0'
+libpulse_mainloop_glib_version = '@0@.@1@.@2@'.format(
+  libpulse_mainloop_glib_version_info[0] - libpulse_mainloop_glib_version_info[2],
+  libpulse_mainloop_glib_version_info[0],
+  libpulse_mainloop_glib_version_info[1],
+)
 
 # Paths
 
@@ -46,16 +63,28 @@ includedir = join_paths(prefix, get_option('includedir'))
 libdir = join_paths(prefix, get_option('libdir'))
 libexecdir = join_paths(prefix, get_option('libexecdir'))
 mandir = join_paths(prefix, get_option('mandir'))
-datadir = join_paths(prefix, get_option('datadir'))
+#datadir = join_paths(prefix, get_option('datadir'))
+#FIXME: meson.build:1:0: ERROR: The value of the 'datadir' option is '/hal/share' which must be a subdir of the prefix '/usr'.
+datadir = get_option('hal-datadir')
 localedir = join_paths(prefix, get_option('localedir'))
 localstatedir = join_paths(prefix, get_option('localstatedir'))
 sysconfdir = join_paths(prefix, get_option('sysconfdir'))
 privlibdir = join_paths(libdir, 'pulseaudio')
-alsadatadir = join_paths(datadir, 'pulseaudio', 'alsa-mixer')
+
+if host_machine.system() == 'windows'
+  # Windows only supports loading libraries from the same dir as the executable
+  privlibdir = bindir
+endif
+
+alsadatadir = get_option('alsadatadir')
+if alsadatadir == ''
+  alsadatadir = join_paths(datadir, 'pulseaudio', 'alsa-mixer')
+endif
 
 pkgconfigdir = join_paths(libdir, 'pkgconfig')
 pulselibexecdir = join_paths(libexecdir, 'pulse')
-pulsesysconfdir = join_paths(sysconfdir, 'pulse')
+#pulsesysconfdir = join_paths(sysconfdir, 'pulse')
+pulsesysconfdir = join_paths(get_option('hal-sysconfdir'), 'pulse')
 
 modlibexecdir = get_option('modlibexecdir')
 if modlibexecdir == ''
@@ -73,6 +102,7 @@ if pulsedsp_location == ''
 endif
 
 systemduserunitdir = get_option('systemduserunitdir')
+systemdsystemunitdir = get_option('systemdsystemunitdir')
 # the default value is set below
 
 udevrulesdir = get_option('udevrulesdir')
@@ -106,7 +136,6 @@ cdata = configuration_data()
 cdata.set_quoted('PACKAGE', 'pulseaudio')
 cdata.set_quoted('PACKAGE_NAME', 'pulseaudio')
 cdata.set_quoted('PACKAGE_VERSION', pa_version_str)
-cdata.set_quoted('CANONICAL_HOST', host_machine.cpu())
 cdata.set('PA_MAJOR', pa_version_major)
 cdata.set('PA_MINOR', pa_version_minor)
 cdata.set('PA_API_VERSION', pa_api_version)
@@ -117,6 +146,7 @@ cdata.set_quoted('PA_SRCDIR', join_paths(meson.current_source_dir(), 'src'))
 cdata.set_quoted('PA_BUILDDIR', meson.current_build_dir())
 cdata.set_quoted('PA_SOEXT', '.so')
 cdata.set_quoted('PA_DEFAULT_CONFIG_DIR', pulsesysconfdir)
+cdata.set('PA_DEFAULT_CONFIG_DIR_UNQUOTED', pulsesysconfdir)
 cdata.set_quoted('PA_BINARY', join_paths(bindir, 'pulseaudio'))
 cdata.set_quoted('PA_SYSTEM_RUNTIME_PATH', join_paths(localstatedir, 'run', 'pulse'))
 cdata.set_quoted('PA_SYSTEM_CONFIG_PATH', join_paths(localstatedir, 'lib', 'pulse'))
@@ -132,11 +162,21 @@ cdata.set_quoted('DESKTOPFILEDIR', join_paths(datadir, 'applications'))
 cdata.set_quoted('PULSE_LOCALEDIR', localedir)
 cdata.set_quoted('GETTEXT_PACKAGE', 'pulseaudio')
 cdata.set('ENABLE_NLS', 1)
+cdata.set('top_srcdir', meson.source_root())
 
 # Platform specifics
 # First some defaults to keep config file generation happy
 cdata.set('HAVE_COREAUDIO', 0)
 cdata.set('HAVE_WAVEOUT', 0)
+cdata.set('OS_IS_FREEBSD', 0)
+
+platform_socket_dep = []
+platform_dep = []
+
+if host_machine.endian() == 'big'
+  cdata.set('WORDS_BIGENDIAN', 1)
+endif
+
 # FIXME: This was not tested. Maybe some flags should better be CFLAGS,
 # rather than ending up in the config.h file?
 if host_machine.system() == 'darwin'
@@ -144,7 +184,22 @@ if host_machine.system() == 'darwin'
   cdata.set('_DARWIN_C_SOURCE', '200112L') # Needed to get NSIG on Mac OS
 elif host_machine.system() == 'windows'
   cdata.set('OS_IS_WIN32', 1)
+  cdata.set('HAVE_WINDOWS_H', 1)
+  cdata.set('HAVE_WAVEOUT', 1)
+  cdata.set('HAVE_WINSOCK2_H', 1)
+  cdata.set('HAVE_WS2TCPIP_H', 1)
   cdata.set('WIN32_LEAN_AND_MEAN', 1) # Needed to avoid including unnecessary headers on Windows
+  cdata.set('gid_t', 'int')
+  cdata.set('uid_t', 'int')
+  ws2_32_dep = meson.get_compiler('c').find_library('ws2_32')
+  winsock_dep = meson.get_compiler('c').find_library('wsock32')
+  ole32_dep = meson.get_compiler('c').find_library('ole32')
+  ssp_dep = meson.get_compiler('c').find_library('ssp')
+  pcreposix_dep = meson.get_compiler('c').find_library('pcreposix')
+  platform_socket_dep = [ws2_32_dep, winsock_dep]
+  platform_dep = [ole32_dep, ssp_dep, pcreposix_dep]
+elif host_machine.system() == 'freebsd'
+  cdata.set('OS_IS_FREEBSD', 1)
 #elif host_machine.system() == 'solaris'
 #  # Apparently meson has no solaris support?
 #  # Needed to get declarations for msg_control and msg_controllen on Solaris
@@ -152,14 +207,25 @@ elif host_machine.system() == 'windows'
 #  cdata.set('__EXTENSIONS__', 1)
 endif
 
+if cc.has_type('_Bool')
+  cdata.set('HAVE_STD_BOOL', 1)
+endif
+
+if host_machine.cpu_family() == 'x86_64' or cc.sizeof('void *') >= 8
+  cdata.set('HAVE_FAST_64BIT_OPERATIONS', 1)
+endif
+
 # Headers
 
 check_headers = [
   'arpa/inet.h',
+  'byteswap.h',
   'cpuid.h',
+  'dlfcn.h',
   'execinfo.h',
   'grp.h',
   'langinfo.h',
+  'linux/sockios.h',
   'locale.h',
   'netdb.h',
   'netinet/in.h',
@@ -171,18 +237,24 @@ check_headers = [
   'pwd.h',
   'regex.h',
   'sched.h',
+  'stdint.h',
+  'sys/atomic.h',
   'sys/capability.h',
+  'sys/conf.h',
+  'sys/dl.h',
   'sys/eventfd.h',
-  'sys/ioctl.h',
   'sys/filio.h',
+  'sys/ioctl.h',
   'sys/mman.h',
   'sys/prctl.h',
   'sys/resource.h',
   'sys/select.h',
   'sys/socket.h',
+  'sys/syscall.h',
+  'sys/uio.h',
   'sys/un.h',
   'sys/wait.h',
-  'valgrind/memcheck.h',
+  'syslog.h',
   'xlocale.h',
 ]
 
@@ -193,9 +265,19 @@ foreach h : check_headers
   endif
 endforeach
 
+if cc.has_header('valgrind/memcheck.h', required: get_option('valgrind'))
+  cdata.set('HAVE_VALGRIND_MEMCHECK_H', 1)
+endif
+
 # FIXME: move this to the above set
-if cc.has_header('pthread.h')
-  cdata.set('HAVE_PTHREAD', 1)
+if host_machine.system() != 'windows'
+  if cc.has_header('pthread.h')
+    cdata.set('HAVE_PTHREAD', 1)
+  endif
+endif
+
+if cc.has_header_symbol('pthread.h', 'PTHREAD_PRIO_INHERIT')
+  cdata.set('HAVE_PTHREAD_PRIO_INHERIT', 1)
 endif
 
 # Functions
@@ -203,35 +285,46 @@ endif
 check_functions = [
   'accept4',
   'clock_gettime',
+  'ctime_r',
   'fchmod',
   'fchown',
   'fork',
   'fstat',
   'getaddrinfo',
   'getgrgid_r',
+  'getgrnam_r',
   'getpwnam_r',
+  'getpwuid_r',
   'gettimeofday',
   'getuid',
+  'lrintf',
   'lstat',
   'memfd_create',
   'mkfifo',
   'mlock',
   'nanosleep',
+  'open64',
   'paccept',
   'pipe',
   'pipe2',
+  'posix_fadvise',
   'posix_madvise',
+  'posix_memalign',
+  'ppoll',
   'readlink',
   'setegid',
   'seteuid',
+  'setpgid',
   'setregid',
-  'setreuid',
   'setresgid',
   'setresuid',
+  'setreuid',
   'setsid',
   'sig2str',
   'sigaction',
+  'strerror_r',
   'strtod_l',
+  'strtof',
   'symlink',
   'sysconf',
   'uname',
@@ -240,14 +333,34 @@ check_functions = [
 foreach f : check_functions
   if cc.has_function(f)
     define = 'HAVE_' + f.underscorify().to_upper()
-    cdata.set(define, 1)
+
+    if f == 'posix_memalign' and host_machine.system() == 'windows'
+      message('Win32/mingw32 does not properly define posix_memalign.')
+    elif f == 'fork' and host_machine.system() == 'windows'
+      # __builtin_fork is defined and compiles properly, but calling __builtin_fork() does not.
+      # This causes Meson to think that Windows has a fork() which causes a link error...
+      message('Win32/mingw32 does not properly define fork.')
+    else
+      cdata.set(define, 1)
+    endif
   endif
 endforeach
 
-if cc.has_function('SYS_memfd_create', prefix : '#include <sys/syscall.h>')
+if cc.has_header_symbol('sys/syscall.h', 'SYS_memfd_create') \
+  or cc.has_function('memfd_create')
   cdata.set('HAVE_MEMFD', 1)
 endif
 
+if cc.has_function('dgettext')
+  if host_machine.system() != 'windows'
+    libintl_dep = []
+  else
+    libintl_dep = cc.find_library('intl')
+  endif
+else
+  libintl_dep = cc.find_library('intl')
+endif
+
 # Symbols
 
 if cc.has_header_symbol('signal.h', 'SIGXCPU')
@@ -261,6 +374,20 @@ if not cc.has_header_symbol('netinet/in.h', 'INADDR_NONE')
   endif
 endif
 
+check_decls = [
+  [ 'environ', 'unistd.h', '#define _GNU_SOURCE' ],
+  [ 'SOUND_PCM_READ_RATE', 'sys/soundcard.h', '' ],
+  [ 'SOUND_PCM_READ_CHANNELS', 'sys/soundcard.h', '' ],
+  [ 'SOUND_PCM_READ_BITS', 'sys/soundcard.h', '' ],
+]
+
+foreach s : check_decls
+  if cc.has_header_symbol(s[1], s[0], prefix : s[2])
+    define = 'HAVE_DECL_' + s[0].to_upper()
+    cdata.set(define, 1)
+  endif
+endforeach
+
 # Types
 
 # FIXME: do we ever care about gid_t not being defined / smaller than an int?
@@ -271,12 +398,22 @@ cdata.set('GETGROUPS_T', 'gid_t')
 configinc = include_directories('.')
 topinc = include_directories('src')
 
-# CFLAGS
+# CFLAGS/LDFLAGS
 
 pa_c_args = ['-DHAVE_CONFIG_H', '-D_GNU_SOURCE']
 server_c_args = ['-D__INCLUDED_FROM_PULSE_AUDIO']
 cdata.set('MESON_BUILD', 1)
 
+# On ELF systems we don't want the libraries to be unloaded since we don't clean them up properly,
+# so we request the nodelete flag to be enabled.
+# On other systems, we don't really know how to do that, but it's welcome if somebody can tell.
+# Windows doesn't support this flag.
+if host_machine.system() != 'windows'
+  nodelete_link_args = ['-Wl,-z,nodelete']
+else
+  nodelete_link_args = []
+endif
+
 # Code coverage
 
 if get_option('gcov')
@@ -287,21 +424,73 @@ endif
 # Core Dependencies
 
 libm_dep = cc.find_library('m', required : true)
+
 thread_dep = dependency('threads')
+foreach f : [
+  'pthread_getname_np',
+  'pthread_setaffinity_np',
+  'pthread_setname_np',
+]
+  if cc.has_function(f, dependencies : thread_dep)
+    define = 'HAVE_' + f.underscorify().to_upper()
+    cdata.set(define, 1)
+  endif
+endforeach
+
 cap_dep = cc.find_library('cap', required : false)
 
 shm_dep = cc.find_library('rt', required : false)
-if shm_dep.found()
+if cc.has_function('shm_open', dependencies : shm_dep)
   cdata.set('HAVE_SHM_OPEN', 1)
 endif
 
+dl_dep = cc.find_library('dl', required : false)
+if cc.has_function('dladdr', dependencies : dl_dep)
+  cdata.set('HAVE_DLADDR', 1)
+endif
+
+have_iconv = false
+if cc.has_function('iconv_open')
+  iconv_dep = dependency('', required : false)
+  have_iconv = true
+  # tell the libiconv header to pretend to be libc iconv
+  cdata.set('LIBICONV_PLUG', 1)
+else
+  iconv_dep = cc.find_library('iconv', required : false)
+  have_iconv = iconv_dep.found()
+endif
+if have_iconv
+  cdata.set('HAVE_ICONV', 1)
+  iconvconsttest = '''#include <iconv.h>
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+'''
+  if cc.compiles(iconvconsttest, dependencies : iconv_dep)
+    cdata.set('ICONV_CONST', '')
+  else
+    cdata.set('ICONV_CONST', 'const')
+  endif
+endif
+
+# Used for backtraces on BSD
+execinfo_dep = cc.find_library('execinfo', required : false)
+
+# Atomic operations
+
+if get_option('atomic-arm-memory-barrier')
+    cdata.set('ATOMIC_ARM_MEMORY_BARRIER_ENABLED', 1)
+endif
+
+need_libatomic_ops = false
 
 atomictest = '''void func() {
   volatile int atomic = 2;
   __sync_bool_compare_and_swap (&atomic, 2, 3);
 }
 '''
+
 if cc.compiles(atomictest)
+  cdata.set('HAVE_ATOMIC_BUILTINS', 1)
+
   newatomictest = '''void func() {
     int c = 0;
     __atomic_store_n(&c, 4, __ATOMIC_SEQ_CST);
@@ -309,16 +498,82 @@ if cc.compiles(atomictest)
   '''
 
   if(cc.compiles(newatomictest))
-    cdata.set('HAVE_ATOMIC_BUILTINS_MEMORY_MODEL', true)
+    cdata.set('HAVE_ATOMIC_BUILTINS_MEMORY_MODEL', 1)
   endif
 
-  cdata.set('HAVE_ATOMIC_BUILTINS', true)
+elif host_machine.cpu_family() == 'arm'
+  if host_machine.system() == 'linux' and get_option('atomic-arm-linux-helpers')
+    cdata.set('ATOMIC_ARM_LINUX_HELPERS', 1)
+  else
+    armatomictest = '''int func() {
+      volatile int a=0;
+      int o=0, n=1, r;
+      asm volatile (
+             "ldrex    %0, [%1]\n"
+             "subs  %0, %0, %2\n"
+             "strexeq %0, %3, [%1]\n"
+             : "=&r" (r)
+             : "r" (&a), "Ir" (o), "r" (n)
+      : "cc");
+      return (a==1 ? 0 : -1);
+    }
+    '''
+
+    if cc.compiles(armatomictest)
+      cdata.set('ATOMIC_ARM_INLINE_ASM', 1)
+    else
+      need_libatomic_ops = true
+    endif
+  endif # arm && !linux
+
+elif not ['freebsd', 'netbsd'].contains(host_machine.system())
+  need_libatomic_ops = true
+endif # !atomic helpers && !arm
+
+if need_libatomic_ops
+  assert(cc.has_header('atomic_ops.h'), 'Need libatomic_ops')
+
+  cdata.set('AO_REQUIRE_CAS', 1)
+
+  if host_machine.system() != 'windows'
+    libatomic_ops_dep = cc.find_library('atomic_ops', required : true)
+  else
+    libatomic_ops_dep = dependency('', required: false)
+  endif
 else
-  # FIXME: check if we need libatomic_ops
+  libatomic_ops_dep = dependency('', required: false)
+endif
+
+# ARM checks
+# ARMV6 instructions we need
+if host_machine.cpu_family() == 'arm'
+  armv6test = '''int func() {
+    volatile int a = -60000, b = 0xaaaabbbb, c = 0xccccdddd;
+    asm volatile ("ldr r0, %2 \n"
+                  "ldr r2, %3 \n"
+                  "ldr r3, %4 \n"
+                  "ssat r1, #8, r0 \n"
+                  "str r1, %0 \n"
+                  "pkhbt r1, r3, r2, LSL #8 \n"
+                  "str r1, %1 \n"
+                  : "=m" (a), "=m" (b)
+                  : "m" (a), "m" (b), "m" (c)
+                  : "r0", "r1", "r2", "r3", "cc");
+    return (a == -128 && b == 0xaabbdddd) ? 0 : -1;
+  }
+  '''
+
+  if cc.compiles(armv6test)
+    cdata.set('HAVE_ARMV6', 1)
+  endif
+endif
+# NEON checks are automatically done by the unstable-simd module
+
+if get_option('daemon')
+  # FIXME: make sure it's >= 2.2
+  ltdl_dep = cc.find_library('ltdl', required : true)
 endif
 
-# FIXME: make sure it's >= 2.2
-ltdl_dep = cc.find_library('ltdl', required : true)
 # FIXME: can meson support libtool -dlopen/-dlpreopen things?
 #        and do we still want to support this at all?
 cdata.set('DISABLE_LIBTOOL_PRELOAD', 1)
@@ -331,6 +586,88 @@ else
   database_dep = dependency('', required: false)
 endif
 
+# TIZEN BUILD OPTION
+vconf_dep = dependency('vconf')
+if vconf_dep.found()
+  cdata.set('HAVE_VCONF', 1)
+endif
+
+dlog_dep = dependency('dlog', required : get_option('dlog'))
+if dlog_dep.found()
+  cdata.set('TIZEN_DLOG', 1)
+endif
+
+if get_option('buffer-attribute')
+  cdata.set('TIZEN_BUFFER_ATTR', 1)
+endif
+
+if get_option('udev-usb-only')
+  cdata.set('TIZEN_UDEV_USB_ONLY', 1)
+endif
+
+if get_option('pcm-dump')
+  cdata.set('TIZEN_PCM_DUMP', 1)
+endif
+
+if get_option('udev-usb-only')
+  cdata.set('TIZEN_UDEV_USB_ONLY', 1)
+endif
+
+if get_option('pa-ready')
+  cdata.set('TIZEN_PA_READY', 1)
+endif
+
+if get_option('pa-simple-extensions')
+  cdata.set('TIZEN_PA_SIMPLE_EXT', 1)
+endif
+
+if get_option('empty-pop')
+  cdata.set('TIZEN_EMPTY_POP', 1)
+endif
+
+if get_option('volume-ramp')
+  cdata.set('TIZEN_VOLUME_RAMP', 1)
+endif
+
+if get_option('individual-volume-ratio')
+  cdata.set('TIZEN_INDIVIDUAL_VOLUME_RATIO', 1)
+endif
+
+if get_option('filter-group')
+  cdata.set('TIZEN_FILTER_GROUP', 1)
+endif
+
+if get_option('prelink')
+  cdata.set('TIZEN_TV_PROD_PRELINK', 1)
+endif
+
+if get_option('cpu-boosting')
+  cdata.set('TIZEN_TV_PROD_CPU_BOOSTING', 1)
+endif
+
+lwipc_dep = dependency('lwipc', required : get_option('lwipc'))
+if lwipc_dep.found()
+  cdata.set('TIZEN_TV_PROD_LWIPC', 1)
+endif
+
+boost_tv_dep = dependency('capi-boost-tv', required : get_option('cpu-boosting'))
+system_info_dep = dependency('capi-system-info', required : get_option('cpu-boosting'))
+
+if get_option('aec')
+  cdata.set('TIZEN_AEC', 1)
+endif
+
+enable_security = false
+cynara_client_dep = dependency('cynara-client', required : get_option('security'))
+cynara_creds_socket_dep = dependency('cynara-creds-socket', required : get_option('security'))
+cynara_session_dep = dependency('cynara-session', required : get_option('security'))
+if cynara_client_dep.found() and cynara_creds_socket_dep.found() and cynara_session_dep.found()
+  cdata.set('TIZEN_SECURITY', 1)
+  enable_security = true
+endif
+
+# TIZEN BUILD OPTION end
+
 if get_option('ipv6')
   cdata.set('HAVE_IPV6', 1)
 endif
@@ -339,6 +676,10 @@ if get_option('legacy-database-entry-format')
   cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 1)
 endif
 
+if get_option('stream-restore-clear-old-devices')
+  cdata.set('STREAM_RESTORE_CLEAR_OLD_DEVICES', 1)
+endif
+
 if get_option('running-from-build-tree')
   cdata.set('HAVE_RUNNING_FROM_BUILD_TREE', 1)
 endif
@@ -359,12 +700,15 @@ if dbus_dep.found()
   cdata.set('HAVE_DBUS', 1)
 endif
 
-gio_dep = dependency('gio-2.0', version : '>= 2.26.0', required : get_option('gsettings'))
-if gio_dep.found()
+gio_dep = dependency('gio-2.0', version : '>= 2.26.0')
+if get_option('gsettings').enabled()
+  assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)')
   cdata.set('HAVE_GSETTINGS', 1)
+else
+  cdata.set('HAVE_GSETTINGS', 0)
 endif
 
-glib_dep = dependency('glib-2.0', version : '>= 2.4.0', required: get_option('glib'))
+glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
 if glib_dep.found()
   cdata.set('HAVE_GLIB', 1)
 endif
@@ -409,6 +753,19 @@ systemd_dep = dependency('systemd', required : get_option('systemd'))
 if systemd_dep.found() and systemduserunitdir == ''
   systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
 endif
+if systemd_dep.found() and systemdsystemunitdir == ''
+  systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
+endif
+
+libelogind_dep = dependency('libelogind', required : get_option('elogind'))
+if libelogind_dep.found()
+  cdata.set('HAVE_SYSTEMD_LOGIN', 1)
+endif
+
+tcpwrap_dep = cc.find_library('wrap', required: get_option('tcpwrap'))
+if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tcpwrap_dep)
+  cdata.set('HAVE_LIBWRAP', 1)
+endif
 
 x11_dep = dependency('x11-xcb', required : get_option('x11'))
 if x11_dep.found()
@@ -417,12 +774,15 @@ if x11_dep.found()
   sm_dep   = dependency('sm',   required : true)
   xtst_dep = dependency('xtst', required : true)
   cdata.set('HAVE_X11', 1)
+  if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
+    cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
+  endif
 endif
 
 # Module dependencies
-
-if cc.has_header('sys/soundcard.h')
+if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
   cdata.set('HAVE_OSS_OUTPUT', 1)
+  # OSS wrapper
   cdata.set('HAVE_OSS_WRAPPER', 1)
   cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
 endif
@@ -434,13 +794,14 @@ endif
 avahi_dep = dependency('avahi-client', version : '>= 0.6.0', required : get_option('avahi'), disabler : true)
 if avahi_dep.found()
   cdata.set('HAVE_AVAHI', 1)
+else
+  cdata.set('HAVE_AVAHI', 0)
 endif
 
-bluez_dep = dependency('bluez', version : '>= 5.0', required : get_option('bluez5'))
-sbc_dep = dependency('sbc', version : '>= 1.0', required : false)
-if bluez_dep.found()
-  assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
+if get_option('bluez5')
+  sbc_dep = dependency('sbc', version : '>= 1.0', required : false)
   assert(sbc_dep.found(), 'BlueZ requires SBC support')
+  assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
   cdata.set('HAVE_SBC', 1)
   cdata.set('HAVE_BLUEZ', 1)
   cdata.set('HAVE_BLUEZ_5', 1)
@@ -467,7 +828,7 @@ if lirc_dep.found()
   cdata.set('HAVE_LIRC', 1)
 endif
 
-openssl_dep = dependency('openssl', version : '>= 0.9', required : get_option('openssl'))
+openssl_dep = dependency('openssl3', version : '>= 0.9', required : get_option('openssl'))
 if openssl_dep.found()
   cdata.set('HAVE_OPENSSL', 1)
 endif
@@ -487,6 +848,25 @@ if webrtc_dep.found()
   cdata.set('HAVE_WEBRTC', 1)
 endif
 
+gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('gstreamer'))
+gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('gstreamer'))
+gstrtp_dep = dependency('gstreamer-rtp-1.0', required : get_option('gstreamer'))
+
+have_gstreamer = false
+if gst_dep.found() and gstapp_dep.found() and gstrtp_dep.found()
+  assert(gio_dep.found(), 'GStreamer-based RTP needs glib I/O library (GIO)')
+  have_gstreamer = true
+endif
+
+bluez5_gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('bluez5-gstreamer'))
+bluez5_gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('bluez5-gstreamer'))
+have_bluez5_gstreamer = false
+if bluez5_gst_dep.found() and bluez5_gstapp_dep.found()
+  have_bluez5_gstreamer = true
+  cdata.set('HAVE_GSTLDAC', 1)
+  cdata.set('HAVE_GSTAPTX', 1)
+endif
+
 # These are required for the CMake file generation
 cdata.set('PA_LIBDIR', libdir)
 cdata.set('PA_INCDIR', includedir)
@@ -498,6 +878,20 @@ endif
 
 check_dep = dependency('check', version : '>= 0.9.10', required : get_option('tests'))
 
+# Subdirs
+
+if get_option('doxygen')
+  subdir('doxygen')
+endif
+subdir('po')
+if get_option('man')
+  subdir('man')
+endif
+subdir('shell-completion/bash')
+subdir('shell-completion/zsh')
+subdir('src')
+subdir('vala')
+
 # Now generate config.h from everything above
 configure_file(output : 'config.h', configuration : cdata)
 
@@ -517,10 +911,12 @@ pc_cdata.set('PA_MAJORMINOR', pa_version_major_minor)
 # get_configtool_variable() work with it, so we have no way to get this flag right,
 # unless we do all the work ourselves. See current work in glib, also meson #553.
 pc_cdata.set('PTHREAD_LIBS', '-pthread')
+pc_cdata.set('PA_DEFAULT_CONFIG_DIR', cdata.get_unquoted('PA_DEFAULT_CONFIG_DIR'))
 
 pc_files = [
   'libpulse.pc',
   'libpulse-simple.pc',
+  'pulsecore.pc',
 ]
 
 if glib_dep.found()
@@ -565,17 +961,6 @@ configure_file(
   install_dir : cmakedir,
 )
 
-# Subdirs
-
-subdir('po')
-if get_option('man')
-  subdir('man')
-endif
-subdir('shell-completion/bash')
-subdir('shell-completion/zsh')
-subdir('src')
-subdir('vala')
-
 ############################################################
 
 # Final summary
@@ -593,6 +978,7 @@ summary = [
   'sysconfdir:                    @0@'.format(sysconfdir),
   'localstatedir:                 @0@'.format(localstatedir),
   'modlibexecdir:                 @0@'.format(modlibexecdir),
+  'alsadatadir:                   @0@'.format(alsadatadir),
   'System Runtime Path:           @0@'.format(cdata.get_unquoted('PA_SYSTEM_RUNTIME_PATH')),
   'System State Path:             @0@'.format(cdata.get_unquoted('PA_SYSTEM_STATE_PATH')),
   'System Config Path:            @0@'.format(cdata.get_unquoted('PA_SYSTEM_CONFIG_PATH')),
@@ -603,17 +989,19 @@ summary = [
 #  'CPPFLAGS:                      @0@'.format(${CPPFLAGS}),
 #  'LIBS:                          @0@'.format(${LIBS}),
   '',
+  'Enable pulseaudio daemon:      @0@'.format(get_option('daemon')),
+  '',
   'Enable memfd shared memory:    @0@'.format(cdata.has('HAVE_MEMFD')),
   'Enable X11:                    @0@'.format(x11_dep.found()),
-#  'Enable OSS Output:             @0@'.format(${ENABLE_OSS_OUTPUT}),
-#  'Enable OSS Wrapper:            @0@'.format(${ENABLE_OSS_WRAPPER}),
+  '  Safe X11 I/O errors:         @0@'.format(cdata.has('HAVE_XSETIOERROREXITHANDLER')),
+  'Enable OSS Output:             @0@'.format(cdata.has('HAVE_OSS_OUTPUT')),
+  'Enable OSS Wrapper:            @0@'.format(cdata.has('HAVE_OSS_WRAPPER')),
 #  'Enable EsounD:                 @0@'.format(${ENABLE_ESOUND}),
   'Enable Alsa:                   @0@'.format(alsa_dep.found()),
 #  'Enable CoreAudio:              @0@'.format(${ENABLE_COREAUDIO}),
 #  'Enable Solaris:                @0@'.format(${ENABLE_SOLARIS}),
 #  'Enable WaveOut:                @0@'.format(${ENABLE_WAVEOUT}),
   'Enable GLib 2:                 @0@'.format(glib_dep.found()),
-#  'Enable GConf:                  @0@'.format(${ENABLE_GCONF}),
   'Enable GSettings:              @0@'.format(gio_dep.found()),
   'Enable Gtk+ 3:                 @0@'.format(gtk_dep.found()),
   'Enable Avahi:                  @0@'.format(avahi_dep.found()),
@@ -621,28 +1009,34 @@ summary = [
   'Enable Async DNS:              @0@'.format(asyncns_dep.found()),
   'Enable LIRC:                   @0@'.format(lirc_dep.found()),
   'Enable D-Bus:                  @0@'.format(dbus_dep.found()),
-  '  Enable BlueZ 5:              @0@'.format(bluez_dep.found()),
-  '    Enable native headsets:    @0@'.format(get_option('bluez5-native-headset')),
-  '    Enable  ofono headsets:    @0@'.format(get_option('bluez5-ofono-headset')),
+  '  Enable BlueZ 5:              @0@'.format(cdata.has('HAVE_BLUEZ_5')),
+  '    Enable native headsets:    @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')),
+  '    Enable  ofono headsets:    @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')),
+  '    Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
   'Enable udev:                   @0@'.format(udev_dep.found()),
   '  Enable HAL->udev compat:     @0@'.format(get_option('hal-compat')),
   'Enable systemd:                @0@'.format(libsystemd_dep.found()),
-#  'Enable TCP Wrappers:           @0@'.format(${ENABLE_TCPWRAP}),
+  'Enable elogind:                @0@'.format(libelogind_dep.found()),
+  'Enable TCP Wrappers:           @0@'.format(tcpwrap_dep.found()),
   'Enable libsamplerate:          @0@'.format(samplerate_dep.found()),
   'Enable IPv6:                   @0@'.format(get_option('ipv6')),
   'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
   'Enable FFTW:                   @0@'.format(fftw_dep.found()),
   'Enable ORC:                    @0@'.format(have_orcc),
+  'Enable GStreamer:              @0@'.format(have_gstreamer),
   'Enable Adrian echo canceller:  @0@'.format(get_option('adrian-aec')),
   'Enable Speex (resampler, AEC): @0@'.format(speex_dep.found()),
   'Enable SoXR (resampler):       @0@'.format(soxr_dep.found()),
   'Enable WebRTC echo canceller:  @0@'.format(webrtc_dep.found()),
   'Enable Gcov coverage:          @0@'.format(get_option('gcov')),
+  'Enable Valgrind:               @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
   'Enable man pages:              @0@'.format(get_option('man')),
   'Enable unit tests:             @0@'.format(get_option('tests')),
   '',
   'Database:                      @0@'.format(get_option('database')),
   'Legacy Database Entry Support: @0@'.format(get_option('legacy-database-entry-format')),
+  'module-stream-restore:',
+  '  Clear old devices:           @0@'.format(get_option('stream-restore-clear-old-devices')),
   'Running from build tree:       @0@'.format(get_option('running-from-build-tree')),
   'System User:                   @0@'.format(cdata.get_unquoted('PA_SYSTEM_USER')),
   'System Group:                  @0@'.format(cdata.get_unquoted('PA_SYSTEM_GROUP')),
@@ -650,6 +1044,22 @@ summary = [
 #  'Enable per-user EsounD socket: @0@'.format(${ENABLE_PER_USER_ESOUND_SOCKET}),
 #  'Force preopen:                 @0@'.format(${FORCE_PREOPEN}),
 #  'Preopened modules:             @0@'.format(${PREOPEN_MODS}),
+  '',
+  'Tizen options:',
+  '  dlog:                        @0@'.format(dlog_dep.found()),
+  '  buffer-attribute:            @0@'.format(get_option('buffer-attribute')),
+  '  pcm-dump:                    @0@'.format(get_option('pcm-dump')),
+  '  security:                    @0@'.format(enable_security),
+  '  udev-usb-only:               @0@'.format(get_option('udev-usb-only')),
+  '  pa-ready:                    @0@'.format(get_option('pa-ready')),
+  '  pa-simple-extensions:        @0@'.format(get_option('pa-simple-extensions')),
+  '  empty-pop:                   @0@'.format(get_option('empty-pop')),
+  '  volume-ramp:                 @0@'.format(get_option('volume-ramp')),
+  '  individual-volume-ratio:     @0@'.format(get_option('individual-volume-ratio')),
+  '  aec:                         @0@'.format(get_option('aec')),
+  '  prelink (for TV):            @0@'.format(get_option('prelink')),
+  '  lwipc (for TV):              @0@'.format(get_option('lwipc')),
+  '  cpu-boosting (for TV):       @0@'.format(get_option('cpu-boosting')),
 ]
 
 message('\n    '.join(summary))
@@ -676,7 +1086,7 @@ if host_machine.system() != 'windows'
     ]
     warning('\n' + '\n'.join(message))
   endif
-  if not udev_dep.found()
+  if host_machine.system() == 'linux' and not udev_dep.found()
     message = [
       'You do not have udev support enabled. It is strongly recommended',
       'that you enable udev support if your platform supports it as it is',