'sys/stat.h',
'sys/time.h',
'sys/types.h',
- 'sys/un.h',
'sys/wait.h',
'syslog.h',
'termios.h',
]
+# 'struct msghdr' misses some required fields
+if os_name != 'sunos'
+ check_headers += 'sys/un.h'
+endif
+
check_functions = [
'asprintf',
'daemon',
'fchmod',
- 'fork',
'gettimeofday',
'mlockall',
'putenv',
'unsetenv',
]
+# Broken definition, fails to link
+if os_name != 'windows'
+ check_functions += 'fork'
+endif
+
check_types = [
'struct arphdr',
'struct ether_arp',
'dummy_device.c',
'edge.c',
'event.c',
- 'fd_device.c',
'graph.c',
'meta.c',
'multicast_device.c',
endif
endforeach
+if cdata.has('HAVE_SYS_UN_H')
+ src_tincd += 'fd_device.c'
+endif
+
confdata = configuration_data()
confdata.merge_from(cdata)
configure_file(output: 'meson_config.h', configuration: confdata)
'''.format(build_root, meson.current_source_dir())
foreach f : check_functions
- if f == 'fork' and os_name == 'windows'
- message('MinGW does not have correct definition for fork()')
- else
- if cc.has_function(f, prefix: have_prefix, args: cc_defs)
- cdata.set('HAVE_' + f.to_upper(),
- 1,
- description: 'function ' + f)
- endif
+ if cc.has_function(f, prefix: have_prefix, args: cc_defs)
+ cdata.set('HAVE_' + f.to_upper(),
+ 1,
+ description: 'function ' + f)
endif
endforeach
# Register helper functions
+if [ "$(uname -s)" = SunOS ]; then
+ gnu=/usr/gnu/bin
+ grep="$gnu/grep"
+
+ grep() { $gnu/grep "$@"; }
+ tail() { $gnu/tail "$@"; }
+
+ if ! tail /dev/null || ! echo '' | grep ''; then
+ echo >&2 'Sorry, native Solaris tools are not supported. Please install GNU Coreutils.'
+ exit $EXIT_SKIP_TEST
+ fi
+else
+ grep='grep'
+fi
+
# Alias gtimeout to timeout if it exists.
if type gtimeout >/dev/null; then
timeout() { gtimeout "$@"; }
new_line=$(
sh -c "
- grep -n -m $count '^$script,' <'$fifo'
+ $grep -n -m $count '^$script,' <'$fifo'
" | awk -F: 'END { print $1 }'
)