Skip to content

Commit 96a63ae

Browse files
committed
configure, meson: move remaining HAVE_* compiler tests to Meson
Remove some special cases by moving them to Meson. Reviewed-by: Marc-André Lureau <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent a76a1f6 commit 96a63ae

File tree

2 files changed

+18
-38
lines changed

2 files changed

+18
-38
lines changed

configure

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,18 +2403,6 @@ else
24032403
l2tpv3=no
24042404
fi
24052405

2406-
cat > $TMPC <<EOF
2407-
#include <sys/mman.h>
2408-
int main(int argc, char *argv[]) {
2409-
return mlockall(MCL_FUTURE);
2410-
}
2411-
EOF
2412-
if compile_prog "" "" ; then
2413-
have_mlockall=yes
2414-
else
2415-
have_mlockall=no
2416-
fi
2417-
24182406
#########################################
24192407
# vhost interdependencies and host support
24202408

@@ -3842,21 +3830,6 @@ if test "$fortify_source" != "no"; then
38423830
fi
38433831
fi
38443832

3845-
##########################################
3846-
# check if struct fsxattr is available via linux/fs.h
3847-
3848-
have_fsxattr=no
3849-
cat > $TMPC << EOF
3850-
#include <linux/fs.h>
3851-
struct fsxattr foo;
3852-
int main(void) {
3853-
return 0;
3854-
}
3855-
EOF
3856-
if compile_prog "" "" ; then
3857-
have_fsxattr=yes
3858-
fi
3859-
38603833
##########################################
38613834
# check for usable membarrier system call
38623835
if test "$membarrier" = "yes"; then
@@ -4358,13 +4331,6 @@ if test "$gdbus_codegen" != "" ; then
43584331
fi
43594332
echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
43604333

4361-
# Work around a system header bug with some kernel/XFS header
4362-
# versions where they both try to define 'struct fsxattr':
4363-
# xfs headers will not try to redefine structs from linux headers
4364-
# if this macro is set.
4365-
if test "$have_fsxattr" = "yes" ; then
4366-
echo "HAVE_FSXATTR=y" >> $config_host_mak
4367-
fi
43684334
if test "$xen" = "enabled" ; then
43694335
echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
43704336
echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
@@ -4569,9 +4535,6 @@ fi
45694535
if test "$parallels" = "yes" ; then
45704536
echo "CONFIG_PARALLELS=y" >> $config_host_mak
45714537
fi
4572-
if test "$have_mlockall" = "yes" ; then
4573-
echo "HAVE_MLOCKALL=y" >> $config_host_mak
4574-
fi
45754538

45764539
if test "$plugins" = "yes" ; then
45774540
echo "CONFIG_PLUGIN=y" >> $config_host_mak

meson.build

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,23 @@ config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
16011601
return 0;
16021602
}'''))
16031603

1604+
config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
1605+
#include <sys/mman.h>
1606+
int main(int argc, char *argv[]) {
1607+
return mlockall(MCL_FUTURE);
1608+
}'''))
1609+
1610+
# Work around a system header bug with some kernel/XFS header
1611+
# versions where they both try to define 'struct fsxattr':
1612+
# xfs headers will not try to redefine structs from linux headers
1613+
# if this macro is set.
1614+
config_host_data.set('HAVE_FSXATTR', cc.links('''
1615+
#include <linux/fs.h>'
1616+
struct fsxattr foo;
1617+
int main(void) {
1618+
return 0;
1619+
}'''))
1620+
16041621
# Some versions of Mac OS X incorrectly define SIZE_MAX
16051622
config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
16061623
#include <stdint.h>
@@ -1625,7 +1642,7 @@ foreach k, v: config_host
16251642
config_host_data.set('HOST_' + v.to_upper(), 1)
16261643
elif strings.contains(k)
16271644
config_host_data.set_quoted(k, v)
1628-
elif k.startswith('CONFIG_') or k.startswith('HAVE_')
1645+
elif k.startswith('CONFIG_')
16291646
config_host_data.set(k, v == 'y' ? 1 : v)
16301647
endif
16311648
endforeach

0 commit comments

Comments
 (0)