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_system == 'android'
27 message('PTP not supported on Android because of permissions.')
28 elif host_system == 'windows'
29 message('PTP not supported on Windows, not ported yet.')
30 elif host_system == 'ios'
31 message('PTP not supported on iOS because of permissions.')
32 elif ['linux', 'darwin', 'netbsd', 'freebsd', 'openbsd', 'kfreebsd', 'dragonfly', 'sunos', 'gnu', 'gnu/kfreebsd'].contains(host_system)
33 message('PTP supported on ' + host_system + '.')
36 message('PTP not supported on ' + host_system + ', not ported yet.')
40 cdata.set('HAVE_PTP', 1, description : 'PTP support available')
42 if cc.compiles('''#include <sys/ioctl.h>
44 int some_func (void) {
47 ioctl(0, SIOCGIFCONF, &ifc);
48 ioctl(0, SIOCGIFFLAGS, &ifr);
49 ioctl(0, SIOCGIFHWADDR, &ifr);
50 return ifr.ifr_hwaddr.sa_data[0];
52 name : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR available')
53 cdata.set('HAVE_SIOCGIFCONF_SIOCGIFFLAGS_SIOCGIFHWADDR', 1,
54 description : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR is available')
57 if cc.compiles('''#include <ifaddrs.h>
59 #include <net/if_dl.h>
60 int some_func (void) {
61 struct ifaddrs *ifaddr;
63 return (ifaddr->ifa_flags & IFF_LOOPBACK) && ifaddr->ifa_addr->sa_family != AF_LINK;
64 }''', name : 'getifaddrs() and AF_LINK available')
65 cdata.set('HAVE_GETIFADDRS_AF_LINK', 1,
66 description : 'getifaddrs() and AF_LINK is available')
69 setcap_prog = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
70 cap_dep = dependency('libcap', required: false)
72 # user/group to change to in gst-ptp-helper
73 ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
74 if ptp_helper_setuid_user != ''
75 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_USER', ptp_helper_setuid_user,
76 description : 'PTP helper setuid user')
78 ptp_helper_setuid_group = get_option('ptp-helper-setuid-group')
79 if ptp_helper_setuid_group != ''
80 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_GROUP', ptp_helper_setuid_group,
81 description : 'PTP helper setuid group')
84 # how to install gst-ptp-helper
85 with_ptp_helper_permissions = get_option('ptp-helper-permissions')
86 if with_ptp_helper_permissions == 'auto'
87 if setcap_prog.found() and cap_dep.found()
88 with_ptp_helper_permissions = 'capabilities'
90 with_ptp_helper_permissions = 'setuid-root'
93 message('How to install gst-ptp-helper: ' + with_ptp_helper_permissions)
95 if with_ptp_helper_permissions == 'none'
97 elif with_ptp_helper_permissions == 'setuid-root'
98 cdata.set('HAVE_PTP_HELPER_SETUID', 1,
99 description : 'Use setuid-root for permissions in PTP helper')
100 elif with_ptp_helper_permissions == 'capabilities'
101 if not setcap_prog.found()
102 error('capabilities-based ptp-helper-permissions requested, but could not find setcap tool.')
103 elif not cap_dep.found()
104 error('capabilities-based ptp-helper-permissions requested, but could not find libcap.')
106 cdata.set('HAVE_PTP_HELPER_CAPABILITIES', 1,
107 description : 'Use capabilities for permissions in PTP helper')
109 error('Unexpected ptp helper permissions value: ' + with_ptp_helper_permissions)
112 executable('gst-ptp-helper', 'gst-ptp-helper.c',
114 include_directories : [configinc, libsinc],
115 dependencies : [gio_dep, gobject_dep, glib_dep, mathlib, gst_dep, cap_dep],
116 install_dir : helpers_install_dir,
119 meson.add_install_script('ptp_helper_post_install.sh',
120 helpers_install_dir, with_ptp_helper_permissions,
121 setcap_prog.found() ? setcap_prog.path() : '')
124 install_data(['gst_gdb.py', 'glib_gobject_helper.py'],
125 install_dir : join_paths(get_option('datadir'), 'gstreamer-@0@'.format(apiversion), 'gdb'))
127 gdbconf = configuration_data()
128 gdbconf.set('GST_API_VERSION', apiversion)
129 gdbconf.set('DATADIR', '@0@/@1@'.format(get_option('prefix'), get_option('datadir')))
131 if host_system != 'windows'
132 # XXX: We add a leading './' because prefix is an absolute path and we
133 # need it to be a relative path so that join_paths appends it to the end.
134 gdb_install_dir = join_paths(get_option('datadir'), 'gdb', 'auto-load', './' + get_option('prefix'), get_option('libdir'))
136 # FIXME: Cannot install on Windows because the path will contain a drive
137 # letter and colons are not allowed in paths.
138 gdb_install_dir = disabler()
140 configure_file(input : 'libgstreamer-gdb.py.in',
141 output : 'libgstreamer-@0@.so.@1@-gdb.py'.format(apiversion, libversion),
142 install_dir : gdb_install_dir,
143 configuration : gdbconf)