diff --git a/meson.build b/meson.build index 30be7e0bd..a62a8a900 100644 --- a/meson.build +++ b/meson.build @@ -179,10 +179,8 @@ foreach decl : [ ] # We get -1 if the size cannot be determined - have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 - - if have == true - conf.set10('HAVE_' + decl.underscorify().to_upper(), have) + if cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 + conf.set10('HAVE_' + decl.underscorify().to_upper(), true) endif endforeach @@ -228,9 +226,8 @@ foreach ident : [ #include '''], ] - have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') - if have == true - conf.set10('HAVE_' + ident[0].to_upper(), have) + if cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') + conf.set10('HAVE_' + ident[0].to_upper(), true) endif endforeach @@ -259,10 +256,8 @@ if libseccomp.found() ] # We get -1 if the size cannot be determined - have = cc.sizeof(decl, prefix : seccomp_headers, args : '-D_GNU_SOURCE') > 0 - - if have == true - conf.set10('HAVE_' + decl.underscorify().to_upper(), have) + if cc.sizeof(decl, prefix : seccomp_headers, args : '-D_GNU_SOURCE') > 0 + conf.set10('HAVE_' + decl.underscorify().to_upper(), true) endif endforeach endif diff --git a/src/include/meson.build b/src/include/meson.build index 85292e232..03817c157 100644 --- a/src/include/meson.build +++ b/src/include/meson.build @@ -7,7 +7,7 @@ include_sources = files( 'netns_ifaddrs.h') if cc.has_function('getline', prefix : '#include ', args : '-D_GNU_SOURCE') - conf.set10('HAVE_GETLINE', have) + conf.set10('HAVE_GETLINE', true) else include_sources += files( 'getline.c', @@ -15,7 +15,7 @@ else endif if cc.has_function('fexecve', prefix : '#include ', args : '-D_GNU_SOURCE') - conf.set10('HAVE_FEXECVE', have) + conf.set10('HAVE_FEXECVE', true) else include_sources += files( 'fexecve.c', @@ -29,7 +29,7 @@ getgr_headers = ''' ''' if cc.has_function('getgrgid_r', prefix : getgr_headers, args : '-D_GNU_SOURCE') - conf.set10('HAVE_GETGRGID_R', have) + conf.set10('HAVE_GETGRGID_R', true) else include_sources += files( 'getgrgid_r.c', @@ -43,17 +43,17 @@ mntent_headers = ''' have_hasmntopt = cc.has_function('hasmntopt', prefix : mntent_headers, args : '-D_GNU_SOURCE') if have_hasmntopt - conf.set10('HAVE_HASMNTOPT', have) + conf.set10('HAVE_HASMNTOPT', true) endif have_setmntent = cc.has_function('setmntent', prefix : mntent_headers, args : '-D_GNU_SOURCE') if have_setmntent - conf.set10('HAVE_SETMNTENT', have) + conf.set10('HAVE_SETMNTENT', true) endif have_endmntent = cc.has_function('endmntent', prefix : mntent_headers, args : '-D_GNU_SOURCE') if have_endmntent - conf.set10('HAVE_ENDMNTENT', have) + conf.set10('HAVE_ENDMNTENT', true) endif if have_hasmntopt == false or have_setmntent == false or have_endmntent == false @@ -63,7 +63,7 @@ if have_hasmntopt == false or have_setmntent == false or have_endmntent == false endif if cc.has_function('strlcpy', prefix : '#include ', args : '-D_GNU_SOURCE') - conf.set10('HAVE_STRLCPY', have) + conf.set10('HAVE_STRLCPY', true) else include_sources += files( 'strlcpy.c', @@ -71,7 +71,7 @@ else endif if cc.has_function('strlcat', prefix : '#include ', args : '-D_GNU_SOURCE') - conf.set10('HAVE_STRLCAT', have) + conf.set10('HAVE_STRLCAT', true) else include_sources += files( 'strlcat.c', @@ -79,7 +79,7 @@ else endif if cc.has_function('strchrnul', prefix : '#include ', args : '-D_GNU_SOURCE') - conf.set10('HAVE_STRCHRNUL', have) + conf.set10('HAVE_STRCHRNUL', true) else include_sources += files( 'strchrnul.c', @@ -87,7 +87,7 @@ else endif if cc.has_function('openpty', prefix : '#include ', args : '-D_GNU_SOURCE') - conf.set10('HAVE_OPENPTY', have) + conf.set10('HAVE_OPENPTY', true) else include_sources += files( 'openpty.c', diff --git a/src/lxc/tools/meson.build b/src/lxc/tools/meson.build index 1e91cdfae..40a131959 100644 --- a/src/lxc/tools/meson.build +++ b/src/lxc/tools/meson.build @@ -135,7 +135,7 @@ tools_lxc_console_sources = files( 'lxc_console.c') + tools_common_sources if cc.has_function('getsubopt', prefix : '#include ', args : '-D_GNU_SOURCE') - conf.set10('HAVE_GETSUBOPT', have) + conf.set10('HAVE_GETSUBOPT', true) else include_sources += files( 'tools/include/getsubopt.c',