1 executable('gst-plugin-scanner',
2 'gst-plugin-scanner.c',
4 include_directories : [configinc],
5 dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, gst_dep],
6 link_with : [printf_lib],
7 install_dir : helpers_install_dir,
11 # Used in test env setup to make tests find plugin scanner in build tree
12 gst_scanner_dir = meson.current_build_dir()
15 executable('gst-completion-helper',
16 'gst-completion-helper.c',
18 include_directories : [configinc],
19 dependencies : [gobject_dep, glib_dep, gst_dep],
20 install_dir : helpers_install_dir,
27 if host_machine.system() == 'android'
28 message('PTP not supported on Android because of permissions.')
29 elif host_machine.system() == 'windows'
30 message('PTP not supported on Windows, not ported yet.')
31 elif host_machine.system() == 'ios' # FIXME: is it also darwing on iOS ?
32 message('PTP not supported on iOS because of permissions.')
33 elif host_machine.system() == 'darwin'
34 if cc.has_header('MobileCoreServices/MobileCoreServices.h')
35 message('PTP not supported on iOS because of permissions.')
39 elif ['linux', 'netbsd', 'freebsd', 'openbsd', 'kfreebsd', 'dragonfly', 'solaris'].contains(host_machine.system())
40 message('PTP supported on ' + host_machine.system() + '.')
45 cdata.set('HAVE_PTP', 1, description : 'PTP support available')
47 if cc.compiles('''#include <sys/ioctl.h>
49 int some_func (void) {
52 ioctl(0, SIOCGIFCONF, &ifc);
53 ioctl(0, SIOCGIFFLAGS, &ifr);
54 ioctl(0, SIOCGIFHWADDR, &ifr);
55 return ifr.ifr_hwaddr.sa_data[0];
57 name : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR available')
58 cdata.set('HAVE_SIOCGIFCONF_SIOCGIFFLAGS_SIOCGIFHWADDR', 1,
59 description : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR is available')
62 if cc.compiles('''#include <ifaddrs.h>
64 #include <net/if_dl.h>
65 int some_func (void) {
66 struct ifaddrs *ifaddr;
68 return (ifaddr->ifa_flags & IFF_LOOPBACK) && ifaddr->ifa_addr->sa_family != AF_LINK;
69 }''', name : 'getifaddrs() and AF_LINK available')
70 cdata.set('HAVE_GETIFADDRS_AF_LINK', 1,
71 description : 'getifaddrs() and AF_LINK is available')
74 gst_ptp_have_cap = false
76 if cc.has_header('sys/capability.h')
77 cap_dep = cc.find_library('cap', required : false)
78 if cap_dep.found() and cc.has_function('cap_init', dependencies : cap_dep)
79 gst_ptp_have_cap = true
83 setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
85 # user/group to change to in gst-ptp-helper
86 ptp_helper_setuid_user = get_option('with-ptp-helper-setuid-user')
87 if ptp_helper_setuid_user != ''
88 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_USER', ptp_helper_setuid_user,
89 description : 'PTP helper setuid user')
91 ptp_helper_setuid_group = get_option('with-ptp-helper-setuid-group')
92 if ptp_helper_setuid_group != ''
93 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_GROUP', ptp_helper_setuid_group,
94 description : 'PTP helper setuid group')
97 # how to install gst-ptp-helper
98 with_ptp_helper_permissions = get_option('with-ptp-helper-permissions')
99 if with_ptp_helper_permissions == 'auto'
100 if gst_ptp_have_cap and setcap.found()
101 with_ptp_helper_permissions = 'capabilities'
103 with_ptp_helper_permissions = 'setuid-root'
106 message('How to install gst-ptp-helper: ' + with_ptp_helper_permissions)
108 if with_ptp_helper_permissions == 'none'
110 elif with_ptp_helper_permissions == 'setuid-root'
111 cdata.set('HAVE_PTP_HELPER_SETUID', 1,
112 description : 'Use setuid-root for permissions in PTP helper')
113 elif with_ptp_helper_permissions == 'capabilities'
114 if not setcap.found()
115 error('capabilities-based ptp-helper-permissions requested, but could not find setcap tool.')
117 cdata.set('HAVE_PTP_HELPER_CAPABILITIES', 1,
118 description : 'Use capabilities for permissions in PTP helper')
120 error('Unexpected ptp helper permissions value: ' + with_ptp_helper_permissions)
123 executable('gst-ptp-helper', 'gst-ptp-helper.c',
125 include_directories : [configinc, libsinc],
126 dependencies : [gio_dep, gobject_dep, glib_dep, mathlib, gst_dep, cap_dep],
127 link_with : [printf_lib],
128 install_dir : helpers_install_dir,
131 meson.add_install_script('ptp_helper_post_install.sh',
132 helpers_install_dir, with_ptp_helper_permissions,
133 setcap.found() ? setcap.path() : '')