1 executable('gst-plugin-scanner',
2 'gst-plugin-scanner.c',
5 include_directories : [configinc],
6 dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, gst_dep],
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_system == 'android'
28 message('PTP not supported on Android because of permissions.')
29 elif host_system == 'windows'
30 message('PTP not supported on Windows, not ported yet.')
31 elif host_system == 'ios'
32 message('PTP not supported on iOS because of permissions.')
33 elif ['linux', 'darwin', 'netbsd', 'freebsd', 'openbsd', 'kfreebsd', 'dragonfly', 'sunos', 'gnu', 'gnu/kfreebsd'].contains(host_system)
34 message('PTP supported on ' + host_system + '.')
37 message('PTP not supported on ' + host_system + ', not ported yet.')
41 cdata.set('HAVE_PTP', 1, description : 'PTP support available')
43 if cc.compiles('''#include <sys/ioctl.h>
45 int some_func (void) {
48 ioctl(0, SIOCGIFCONF, &ifc);
49 ioctl(0, SIOCGIFFLAGS, &ifr);
50 ioctl(0, SIOCGIFHWADDR, &ifr);
51 return ifr.ifr_hwaddr.sa_data[0];
53 name : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR available')
54 cdata.set('HAVE_SIOCGIFCONF_SIOCGIFFLAGS_SIOCGIFHWADDR', 1,
55 description : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR is available')
58 if cc.compiles('''#include <ifaddrs.h>
60 #include <net/if_dl.h>
61 int some_func (void) {
62 struct ifaddrs *ifaddr;
64 return (ifaddr->ifa_flags & IFF_LOOPBACK) && ifaddr->ifa_addr->sa_family != AF_LINK;
65 }''', name : 'getifaddrs() and AF_LINK available')
66 cdata.set('HAVE_GETIFADDRS_AF_LINK', 1,
67 description : 'getifaddrs() and AF_LINK is available')
70 setcap_prog = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
71 cap_dep = dependency('libcap', required: false)
73 # user/group to change to in gst-ptp-helper
74 ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
75 if ptp_helper_setuid_user != ''
76 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_USER', ptp_helper_setuid_user,
77 description : 'PTP helper setuid user')
79 ptp_helper_setuid_group = get_option('ptp-helper-setuid-group')
80 if ptp_helper_setuid_group != ''
81 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_GROUP', ptp_helper_setuid_group,
82 description : 'PTP helper setuid group')
85 # how to install gst-ptp-helper
86 with_ptp_helper_permissions = get_option('ptp-helper-permissions')
87 if with_ptp_helper_permissions == 'auto'
88 if setcap_prog.found() and cap_dep.found()
89 with_ptp_helper_permissions = 'capabilities'
91 with_ptp_helper_permissions = 'setuid-root'
94 message('How to install gst-ptp-helper: ' + with_ptp_helper_permissions)
96 if with_ptp_helper_permissions == 'none'
98 elif with_ptp_helper_permissions == 'setuid-root'
99 cdata.set('HAVE_PTP_HELPER_SETUID', 1,
100 description : 'Use setuid-root for permissions in PTP helper')
101 elif with_ptp_helper_permissions == 'capabilities'
102 if not setcap_prog.found()
103 error('capabilities-based ptp-helper-permissions requested, but could not find setcap tool.')
104 elif not cap_dep.found()
105 error('capabilities-based ptp-helper-permissions requested, but could not find libcap.')
107 cdata.set('HAVE_PTP_HELPER_CAPABILITIES', 1,
108 description : 'Use capabilities for permissions in PTP helper')
110 error('Unexpected ptp helper permissions value: ' + with_ptp_helper_permissions)
113 executable('gst-ptp-helper', 'gst-ptp-helper.c',
116 include_directories : [configinc, libsinc],
117 dependencies : [gio_dep, gobject_dep, glib_dep, mathlib, gst_dep, cap_dep],
118 install_dir : helpers_install_dir,
121 meson.add_install_script('ptp_helper_post_install.sh',
122 helpers_install_dir, with_ptp_helper_permissions,
123 setcap_prog.found() ? setcap_prog.full_path() : '')
126 install_data(['gst_gdb.py', 'glib_gobject_helper.py'],
127 install_dir : join_paths(get_option('datadir'), 'gstreamer-@0@'.format(apiversion), 'gdb'))
129 gdbconf = configuration_data()
130 gdbconf.set('GST_API_VERSION', apiversion)
131 gdbconf.set('DATADIR', '@0@/@1@'.format(get_option('prefix'), get_option('datadir')))
133 if host_system != 'windows'
134 # XXX: We add a leading './' because prefix is an absolute path and we
135 # need it to be a relative path so that join_paths appends it to the end.
136 gdb_install_dir = join_paths(get_option('datadir'), 'gdb', 'auto-load', './' + get_option('prefix'), get_option('libdir'))
138 # FIXME: Cannot install on Windows because the path will contain a drive
139 # letter and colons are not allowed in paths.
140 gdb_install_dir = disabler()
142 configure_file(input : 'libgstreamer-gdb.py.in',
143 output : 'libgstreamer-@0@.so.@1@-gdb.py'.format(apiversion, libversion),
144 install_dir : gdb_install_dir,
145 configuration : gdbconf)