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 install_dir : helpers_install_dir,
10 # Used in test env setup to make tests find plugin scanner in build tree
11 gst_scanner_dir = meson.current_build_dir()
14 executable('gst-completion-helper',
15 'gst-completion-helper.c',
17 include_directories : [configinc],
18 dependencies : [gobject_dep, glib_dep, gst_dep],
19 install_dir : helpers_install_dir,
26 if host_machine.system() == 'android'
27 message('PTP not supported on Android because of permissions.')
28 elif host_machine.system() == 'windows'
29 message('PTP not supported on Windows, not ported yet.')
30 elif host_machine.system() == 'ios' # FIXME: is it also darwing on iOS ?
31 message('PTP not supported on iOS because of permissions.')
32 elif host_machine.system() == 'darwin'
33 if cc.has_header('MobileCoreServices/MobileCoreServices.h')
34 message('PTP not supported on iOS because of permissions.')
38 elif ['linux', 'netbsd', 'freebsd', 'openbsd', 'kfreebsd', 'dragonfly', 'solaris'].contains(host_machine.system())
39 message('PTP supported on ' + host_machine.system() + '.')
44 cdata.set('HAVE_PTP', 1, description : 'PTP support available')
46 if cc.compiles('''#include <sys/ioctl.h>
48 int some_func (void) {
51 ioctl(0, SIOCGIFCONF, &ifc);
52 ioctl(0, SIOCGIFFLAGS, &ifr);
53 ioctl(0, SIOCGIFHWADDR, &ifr);
54 return ifr.ifr_hwaddr.sa_data[0];
56 name : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR available')
57 cdata.set('HAVE_SIOCGIFCONF_SIOCGIFFLAGS_SIOCGIFHWADDR', 1,
58 description : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR is available')
61 if cc.compiles('''#include <ifaddrs.h>
63 #include <net/if_dl.h>
64 int some_func (void) {
65 struct ifaddrs *ifaddr;
67 return (ifaddr->ifa_flags & IFF_LOOPBACK) && ifaddr->ifa_addr->sa_family != AF_LINK;
68 }''', name : 'getifaddrs() and AF_LINK available')
69 cdata.set('HAVE_GETIFADDRS_AF_LINK', 1,
70 description : 'getifaddrs() and AF_LINK is available')
73 gst_ptp_have_cap = false
75 if cc.has_header('sys/capability.h')
76 cap_dep = cc.find_library('cap', required : false)
77 if cap_dep.found() and cc.has_function('cap_init', dependencies : cap_dep)
78 gst_ptp_have_cap = true
82 setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
84 # user/group to change to in gst-ptp-helper
85 ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
86 if ptp_helper_setuid_user != ''
87 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_USER', ptp_helper_setuid_user,
88 description : 'PTP helper setuid user')
90 ptp_helper_setuid_group = get_option('ptp-helper-setuid-group')
91 if ptp_helper_setuid_group != ''
92 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_GROUP', ptp_helper_setuid_group,
93 description : 'PTP helper setuid group')
96 # how to install gst-ptp-helper
97 with_ptp_helper_permissions = get_option('ptp-helper-permissions')
98 if with_ptp_helper_permissions == 'auto'
99 if gst_ptp_have_cap and setcap.found()
100 with_ptp_helper_permissions = 'capabilities'
102 with_ptp_helper_permissions = 'setuid-root'
105 message('How to install gst-ptp-helper: ' + with_ptp_helper_permissions)
107 if with_ptp_helper_permissions == 'none'
109 elif with_ptp_helper_permissions == 'setuid-root'
110 cdata.set('HAVE_PTP_HELPER_SETUID', 1,
111 description : 'Use setuid-root for permissions in PTP helper')
112 elif with_ptp_helper_permissions == 'capabilities'
113 if not setcap.found()
114 error('capabilities-based ptp-helper-permissions requested, but could not find setcap tool.')
116 cdata.set('HAVE_PTP_HELPER_CAPABILITIES', 1,
117 description : 'Use capabilities for permissions in PTP helper')
119 error('Unexpected ptp helper permissions value: ' + with_ptp_helper_permissions)
122 executable('gst-ptp-helper', 'gst-ptp-helper.c',
124 include_directories : [configinc, libsinc],
125 dependencies : [gio_dep, gobject_dep, glib_dep, mathlib, gst_dep, cap_dep],
126 install_dir : helpers_install_dir,
129 meson.add_install_script('ptp_helper_post_install.sh',
130 helpers_install_dir, with_ptp_helper_permissions,
131 setcap.found() ? setcap.path() : '')