X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fmeson.build;h=43f70bfab4c7af73b8278325ee912b4fed284763;hb=34317698b8c024de5c948b6f6058730b1fdbc328;hp=3eb4bc451a806d5a85dfdca0c3977724a32b5578;hpb=6565c9690d7325537eb0d3f7c298037ca1843737;p=tinc diff --git a/src/meson.build b/src/meson.build index 3eb4bc45..43f70bfa 100644 --- a/src/meson.build +++ b/src/meson.build @@ -46,17 +46,20 @@ check_headers = [ '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', @@ -64,6 +67,11 @@ check_functions = [ 'unsetenv', ] +# Broken definition, fails to link +if os_name != 'windows' + check_functions += 'fork' +endif + check_types = [ 'struct arphdr', 'struct ether_arp', @@ -115,7 +123,6 @@ src_tincd = [ 'dummy_device.c', 'edge.c', 'event.c', - 'fd_device.c', 'graph.c', 'meta.c', 'multicast_device.c', @@ -160,6 +167,10 @@ foreach h : check_headers 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) @@ -170,14 +181,10 @@ have_prefix = ''' '''.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