configure: convert compiler tests to meson, part 2
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e66420ac6d
commit
ed3b3f1764
49
configure
vendored
49
configure
vendored
@ -3783,46 +3783,6 @@ if compile_prog "" "" ; then
|
|||||||
posix_syslog=yes
|
posix_syslog=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################################
|
|
||||||
# check if we have sem_timedwait
|
|
||||||
|
|
||||||
sem_timedwait=no
|
|
||||||
cat > $TMPC << EOF
|
|
||||||
#include <semaphore.h>
|
|
||||||
int main(void) { sem_t s; struct timespec t = {0}; return sem_timedwait(&s, &t); }
|
|
||||||
EOF
|
|
||||||
if compile_prog "" "" ; then
|
|
||||||
sem_timedwait=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# check if we have strchrnul
|
|
||||||
|
|
||||||
strchrnul=no
|
|
||||||
cat > $TMPC << EOF
|
|
||||||
#include <string.h>
|
|
||||||
int main(void);
|
|
||||||
// Use a haystack that the compiler shouldn't be able to constant fold
|
|
||||||
char *haystack = (char*)&main;
|
|
||||||
int main(void) { return strchrnul(haystack, 'x') != &haystack[6]; }
|
|
||||||
EOF
|
|
||||||
if compile_prog "" "" ; then
|
|
||||||
strchrnul=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
#########################################
|
|
||||||
# check if we have st_atim
|
|
||||||
|
|
||||||
st_atim=no
|
|
||||||
cat > $TMPC << EOF
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
int main(void) { return offsetof(struct stat, st_atim); }
|
|
||||||
EOF
|
|
||||||
if compile_prog "" "" ; then
|
|
||||||
st_atim=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# check if trace backend exists
|
# check if trace backend exists
|
||||||
|
|
||||||
@ -4967,15 +4927,6 @@ fi
|
|||||||
if test "$inotify1" = "yes" ; then
|
if test "$inotify1" = "yes" ; then
|
||||||
echo "CONFIG_INOTIFY1=y" >> $config_host_mak
|
echo "CONFIG_INOTIFY1=y" >> $config_host_mak
|
||||||
fi
|
fi
|
||||||
if test "$sem_timedwait" = "yes" ; then
|
|
||||||
echo "CONFIG_SEM_TIMEDWAIT=y" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
if test "$strchrnul" = "yes" ; then
|
|
||||||
echo "HAVE_STRCHRNUL=y" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
if test "$st_atim" = "yes" ; then
|
|
||||||
echo "HAVE_STRUCT_STAT_ST_ATIM=y" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
if test "$gio" = "yes" ; then
|
if test "$gio" = "yes" ; then
|
||||||
echo "CONFIG_GIO=y" >> $config_host_mak
|
echo "CONFIG_GIO=y" >> $config_host_mak
|
||||||
echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
|
echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
|
||||||
|
@ -1274,12 +1274,14 @@ config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate'))
|
|||||||
config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
|
config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
|
||||||
config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll'))
|
config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll'))
|
||||||
config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include <sys/uio.h>'))
|
config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include <sys/uio.h>'))
|
||||||
|
config_host_data.set('CONFIG_SEM_TIMEDWAIT', cc.has_function('sem_timedwait', dependencies: threads))
|
||||||
config_host_data.set('CONFIG_SENDFILE', cc.has_function('sendfile'))
|
config_host_data.set('CONFIG_SENDFILE', cc.has_function('sendfile'))
|
||||||
config_host_data.set('CONFIG_SETNS', cc.has_function('setns') and cc.has_function('unshare'))
|
config_host_data.set('CONFIG_SETNS', cc.has_function('setns') and cc.has_function('unshare'))
|
||||||
config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs'))
|
config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs'))
|
||||||
config_host_data.set('CONFIG_SYNC_FILE_RANGE', cc.has_function('sync_file_range'))
|
config_host_data.set('CONFIG_SYNC_FILE_RANGE', cc.has_function('sync_file_range'))
|
||||||
config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create'))
|
config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create'))
|
||||||
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
|
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
|
||||||
|
config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))
|
||||||
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
|
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
|
||||||
|
|
||||||
# has_header_symbol
|
# has_header_symbol
|
||||||
@ -1306,6 +1308,9 @@ config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK',
|
|||||||
config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',
|
config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',
|
||||||
cc.has_member('struct sigevent', 'sigev_notify_thread_id',
|
cc.has_member('struct sigevent', 'sigev_notify_thread_id',
|
||||||
prefix: '#include <signal.h>'))
|
prefix: '#include <signal.h>'))
|
||||||
|
config_host_data.set('HAVE_STRUCT_STAT_ST_ATIM',
|
||||||
|
cc.has_member('struct stat', 'st_atim',
|
||||||
|
prefix: '#include <sys/stat.h>'))
|
||||||
|
|
||||||
# Some versions of Mac OS X incorrectly define SIZE_MAX
|
# Some versions of Mac OS X incorrectly define SIZE_MAX
|
||||||
config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
|
config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
|
||||||
|
Loading…
Reference in New Issue
Block a user