]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
build: remove unneeded variables
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 13 Sep 2021 08:09:45 +0000 (10:09 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 13 Sep 2021 08:09:45 +0000 (10:09 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
meson.build
src/include/meson.build
src/lxc/tools/meson.build

index 30be7e0bd6aba24f7c114b013e95a1c3cb1d1267..a62a8a900661537190fa12891beda776df127ca1 100644 (file)
@@ -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 <sys/resource.h>'''],
 ]
 
-        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
index 85292e232c92b9946c01f8d69fa04d4ea0632f29..03817c157fcdd7bd69432d27d372bcebe34dcc04 100644 (file)
@@ -7,7 +7,7 @@ include_sources = files(
        'netns_ifaddrs.h')
 
 if cc.has_function('getline', prefix : '#include <stdio.h>', 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 <unistd.h>', 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 <string.h>', 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 <string.h>', 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 <string.h>', 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 <pty.h>', args : '-D_GNU_SOURCE')
-       conf.set10('HAVE_OPENPTY', have)
+       conf.set10('HAVE_OPENPTY', true)
 else
        include_sources += files(
                'openpty.c',
index 1e91cdfae379e0f5ae347886d6112fc5cab9fece..40a131959805e0d8a2d6507ced7b808f86b7424b 100644 (file)
@@ -135,7 +135,7 @@ tools_lxc_console_sources = files(
        'lxc_console.c') + tools_common_sources
 
 if cc.has_function('getsubopt', prefix : '#include <stdlib.h>', args : '-D_GNU_SOURCE')
-       conf.set10('HAVE_GETSUBOPT', have)
+       conf.set10('HAVE_GETSUBOPT', true)
 else
        include_sources += files(
                'tools/include/getsubopt.c',