diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 71 |
1 files changed, 50 insertions, 21 deletions
@@ -1082,7 +1082,7 @@ fi # check that the C compiler works. cat > $TMPC <<EOF -int main(void) {} +int main(void) { return 0; } EOF if compile_object ; then @@ -1274,11 +1274,11 @@ if test "$nptl" != "no" ; then cat > $TMPC <<EOF #include <sched.h> #include <linux/futex.h> -void foo() -{ +int main(void) { #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) #error bork #endif + return 0; } EOF @@ -1317,10 +1317,30 @@ fi if test "$xen" != "no" ; then xen_libs="-lxenstore -lxenctrl -lxenguest" - # Xen unstable + # First we test whether Xen headers and libraries are available. + # If no, we are done and there is no Xen support. + # If yes, more tests are run to detect the Xen version. + + # Xen (any) cat > $TMPC <<EOF #include <xenctrl.h> #include <xs.h> +int main(void) { + return 0; +} +EOF + if ! compile_prog "" "$xen_libs" ; then + # Xen not found + if test "$xen" = "yes" ; then + feature_not_found "xen" + fi + xen=no + + # Xen unstable + elif ( + cat > $TMPC <<EOF +#include <xenctrl.h> +#include <xs.h> #include <stdint.h> #include <xen/hvm/hvm_info_table.h> #if !defined(HVM_MAX_VCPUS) @@ -1336,7 +1356,8 @@ int main(void) { return 0; } EOF - if compile_prog "" "$xen_libs" ; then + compile_prog "" "$xen_libs" + ) ; then xen_ctrl_version=410 xen=yes @@ -1407,10 +1428,10 @@ EOF xen_ctrl_version=330 xen=yes - # Xen not found or unsupported + # Xen version unsupported else if test "$xen" = "yes" ; then - feature_not_found "xen" + feature_not_found "xen (unsupported version)" fi xen=no fi @@ -1670,6 +1691,7 @@ fi # xfsctl() probe, used for raw-posix if test "$xfs" != "no" ; then cat > $TMPC << EOF +#include <stddef.h> /* NULL */ #include <xfs/xfs.h> int main(void) { @@ -1841,7 +1863,11 @@ if test "$curses" != "no" ; then #ifdef __OpenBSD__ #define resize_term resizeterm #endif -int main(void) { resize_term(0, 0); return curses_version(); } +int main(void) { + const char *s = curses_version(); + resize_term(0, 0); + return s != 0; +} EOF for curses_lib in $curses_list; do if compile_prog "" "$curses_lib" ; then @@ -1947,7 +1973,12 @@ PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" pthread=no cat > $TMPC << EOF #include <pthread.h> -int main(void) { pthread_create(0,0,0,0); return 0; } +static void *f(void *p) { return NULL; } +int main(void) { + pthread_t thread; + pthread_create(&thread, 0, f, 0); + return 0; +} EOF if compile_prog "" "" ; then pthread=yes @@ -2051,7 +2082,7 @@ cat > $TMPC <<EOF #include <sys/types.h> #include <sys/uio.h> #include <unistd.h> -int main(void) { struct iovec iov; return 0; } +int main(void) { return sizeof(struct iovec); } EOF iovec=no if compile_prog "" "" ; then @@ -2064,7 +2095,7 @@ cat > $TMPC <<EOF #include <sys/types.h> #include <sys/uio.h> #include <unistd.h> -int main(void) { preadv; } +int main(void) { return preadv == preadv; } EOF preadv=no if compile_prog "" "" ; then @@ -2097,7 +2128,7 @@ if test "$opengl" != "no" ; then #include <X11/Xlib.h> #include <GL/gl.h> #include <GL/glx.h> -int main(void) { GL_VERSION; return 0; } +int main(void) { return GL_VERSION != 0; } EOF if compile_prog "" "-lGL" ; then opengl=yes @@ -2228,7 +2259,7 @@ cat > $TMPC << EOF int main(void) { - int len, fd; + int len, fd = 0; len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); return 0; @@ -2242,7 +2273,6 @@ fi # signalfd probe signalfd="no" cat > $TMPC << EOF -#define _GNU_SOURCE #include <unistd.h> #include <sys/syscall.h> #include <signal.h> @@ -2260,8 +2290,7 @@ cat > $TMPC << EOF int main(void) { - int efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); - return 0; + return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); } EOF if compile_prog "" "" ; then @@ -2361,8 +2390,7 @@ int main(void) * warning but not an error, and will proceed to fail the * qemu compile where we compile with -Werror.) */ - epoll_create1; - return 0; + return epoll_create1 == epoll_create1; } EOF if compile_prog "$ARCH_CFLAGS" "" ; then @@ -2441,7 +2469,7 @@ fi cat > $TMPC <<EOF #include <signal.h> #include <time.h> -int main(void) { clockid_t id; return clock_gettime(id, NULL); } +int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); } EOF if compile_prog "" "" ; then @@ -2651,7 +2679,7 @@ ucontext_coroutine=no if test "$darwin" != "yes"; then cat > $TMPC << EOF #include <ucontext.h> -int main(void) { makecontext(0, 0, 0); } +int main(void) { makecontext(0, 0, 0); return 0; } EOF if compile_prog "" "" ; then ucontext_coroutine=yes @@ -2664,7 +2692,7 @@ fi open_by_hande_at=no cat > $TMPC << EOF #include <fcntl.h> -int main(void) { struct file_handle fh; open_by_handle_at(0, &fh, 0); } +int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } EOF if compile_prog "" "" ; then open_by_handle_at=yes @@ -2677,6 +2705,7 @@ linux_magic_h=no cat > $TMPC << EOF #include <linux/magic.h> int main(void) { + return 0; } EOF if compile_prog "" "" ; then |