X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=configure;h=a12177009ef5adc54cfd3d05ab91a54b9200fbe3;hb=ed24e32c0fcccbf68cbb8ad853f99d171842f270;hp=59da2f7ecc1123215261a268b3c65697c7cd8b78;hpb=e2defc22798dcd884356fbbaf8856689839b52e5;p=fio.git diff --git a/configure b/configure index 59da2f7e..a1217700 100755 --- a/configure +++ b/configure @@ -88,14 +88,14 @@ do_cc() { } compile_object() { - do_cc $CFLAGS -c -o $TMPO $TMPC + do_cc $CFLAGS -Werror-implicit-function-declaration -c -o $TMPO $TMPC } compile_prog() { local_cflags="$1" local_ldflags="$2 $LIBS" echo "Compiling test case $3" >> config.log - do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags + do_cc $CFLAGS -Werror-implicit-function-declaration $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags } feature_not_found() { @@ -381,15 +381,11 @@ CYGWIN*) # We now take the regular configuration path without having exit 0 here. # Flags below are still necessary mostly for MinGW. build_static="yes" - socklen_t="yes" rusage_thread="yes" fdatasync="yes" clock_gettime="yes" # clock_monotonic probe has dependency on this clock_monotonic="yes" - gettimeofday="yes" sched_idle="yes" - tcp_nodelay="yes" - ipv6="yes" ;; esac @@ -704,6 +700,49 @@ if compile_prog "" "$LIBS" "posix_pshared" ; then fi print_config "POSIX pshared support" "$posix_pshared" +########################################## +# POSIX pthread_condattr_setclock() probe +if test "$pthread_condattr_setclock" != "yes" ; then + pthread_condattr_setclock="no" +fi +cat > $TMPC < +int main(void) +{ + pthread_condattr_t condattr; + pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC); + return 0; +} +EOF +if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then + pthread_condattr_setclock=yes +elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then + pthread_condattr_setclock=yes + LIBS="$LIBS -lpthread" +fi +print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock" + +########################################## +# pthread_sigmask() probe +if test "$pthread_sigmask" != "yes" ; then + pthread_sigmask="no" +fi +cat > $TMPC < /* NULL */ +#include /* pthread_sigmask() */ +int main(void) +{ + return pthread_sigmask(0, NULL, NULL); +} +EOF +if compile_prog "" "$LIBS" "pthread_sigmask" ; then + pthread_sigmask=yes +elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then + pthread_sigmask=yes + LIBS="$LIBS -lpthread" +fi +print_config "pthread_sigmask()" "$pthread_sigmask" + ########################################## # solaris aio probe if test "$solaris_aio" != "yes" ; then @@ -798,7 +837,7 @@ cat > $TMPC << EOF int main(int argc, char **argv) { struct ibv_pd *pd = ibv_alloc_pd(NULL); - return 0; + return pd != NULL; } EOF if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then @@ -1091,6 +1130,59 @@ if compile_prog "" "" "fdatasync"; then fi print_config "fdatasync" "$fdatasync" +########################################## +# pipe() probe +if test "$pipe" != "yes" ; then + pipe="no" +fi +cat > $TMPC << EOF +#include +int main(int argc, char **argv) +{ + int fd[2]; + return pipe(fd); +} +EOF +if compile_prog "" "" "pipe"; then + pipe="yes" +fi +print_config "pipe()" "$pipe" + +########################################## +# pipe2() probe +if test "$pipe2" != "yes" ; then + pipe2="no" +fi +cat > $TMPC << EOF +#include +int main(int argc, char **argv) +{ + int fd[2]; + return pipe2(fd, 0); +} +EOF +if compile_prog "" "" "pipe2"; then + pipe2="yes" +fi +print_config "pipe2()" "$pipe2" + +########################################## +# pread() probe +if test "$pread" != "yes" ; then + pread="no" +fi +cat > $TMPC << EOF +#include +int main(int argc, char **argv) +{ + return pread(0, NULL, 0, 0); +} +EOF +if compile_prog "" "" "pread"; then + pread="yes" +fi +print_config "pread()" "$pread" + ########################################## # sync_file_range() probe if test "$sync_file_range" != "yes" ; then @@ -1278,7 +1370,7 @@ cat > $TMPC << EOF #include int main(int argc, char **argv) { - int c = getopt_long_only(argc, argv, NULL, NULL, NULL); + int c = getopt_long_only(argc, argv, "", NULL, NULL); return c; } EOF @@ -1293,8 +1385,12 @@ if test "$inet_aton" != "yes" ; then inet_aton="no" fi cat > $TMPC << EOF +#ifdef _WIN32 +#include +#else #include #include +#endif #include int main(int argc, char **argv) { @@ -1313,7 +1409,12 @@ if test "$socklen_t" != "yes" ; then socklen_t="no" fi cat > $TMPC << EOF +#ifdef _WIN32 +#include +#include +#else #include +#endif int main(int argc, char **argv) { socklen_t len = 0; @@ -1437,10 +1538,14 @@ if test "$tcp_nodelay" != "yes" ; then tcp_nodelay="no" fi cat > $TMPC << EOF +#ifdef _WIN32 +#include +#else #include #include #include #include +#endif int main(int argc, char **argv) { return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); @@ -1448,6 +1553,9 @@ int main(int argc, char **argv) EOF if compile_prog "" "" "TCP_NODELAY"; then tcp_nodelay="yes" +elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then + tcp_nodelay="yes" + LIBS="$LIBS -lws2_32" fi print_config "TCP_NODELAY" "$tcp_nodelay" @@ -1457,10 +1565,14 @@ if test "$window_size" != "yes" ; then window_size="no" fi cat > $TMPC << EOF +#ifdef _WIN32 +#include +#else #include #include #include #include +#endif int main(int argc, char **argv) { setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0); @@ -1469,6 +1581,9 @@ int main(int argc, char **argv) EOF if compile_prog "" "" "SO_SNDBUF"; then window_size="yes" +elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then + window_size="yes" + LIBS="$LIBS -lws2_32" fi print_config "Net engine window_size" "$window_size" @@ -1478,12 +1593,16 @@ if test "$mss" != "yes" ; then mss="no" fi cat > $TMPC << EOF +#ifdef _WIN32 +#include +#else #include #include #include #include #include #include +#endif int main(int argc, char **argv) { return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0); @@ -1491,6 +1610,9 @@ int main(int argc, char **argv) EOF if compile_prog "" "" "TCP_MAXSEG"; then mss="yes" +elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then + mss="yes" + LIBS="$LIBS -lws2_32" fi print_config "TCP_MAXSEG" "$mss" @@ -1555,10 +1677,15 @@ if test "$ipv6" != "yes" ; then ipv6="no" fi cat > $TMPC << EOF +#ifdef _WIN32 +#include +#include +#else #include #include #include #include +#endif #include int main(int argc, char **argv) { @@ -2316,22 +2443,6 @@ if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then fi print_config "cuda" "$cuda" -########################################## -# mkdir() probe. mingw apparently has a one-argument mkdir :/ -mkdir_two="no" -cat > $TMPC << EOF -#include -#include -int main(int argc, char **argv) -{ - return mkdir("/tmp/bla", 0600); -} -EOF -if compile_prog "" "" "mkdir(a, b)"; then - mkdir_two="yes" -fi -print_config "mkdir(a, b)" "$mkdir_two" - ########################################## # check for cc -march=native build_native="no" @@ -2472,6 +2583,12 @@ fi if test "$posix_pshared" = "yes" ; then output_sym "CONFIG_PSHARED" fi +if test "$pthread_condattr_setclock" = "yes" ; then + output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK" +fi +if test "$pthread_sigmask" = "yes" ; then + output_sym "CONFIG_PTHREAD_SIGMASK" +fi if test "$have_asprintf" = "yes" ; then output_sym "CONFIG_HAVE_ASPRINTF" fi @@ -2487,6 +2604,15 @@ fi if test "$fdatasync" = "yes" ; then output_sym "CONFIG_FDATASYNC" fi +if test "$pipe" = "yes" ; then + output_sym "CONFIG_PIPE" +fi +if test "$pipe2" = "yes" ; then + output_sym "CONFIG_PIPE2" +fi +if test "$pread" = "yes" ; then + output_sym "CONFIG_PREAD" +fi if test "$sync_file_range" = "yes" ; then output_sym "CONFIG_SYNC_FILE_RANGE" fi @@ -2705,9 +2831,6 @@ fi if test "$cuda" = "yes" ; then output_sym "CONFIG_CUDA" fi -if test "$mkdir_two" = "yes" ; then - output_sym "CONFIG_HAVE_MKDIR_TWO" -fi if test "$march_set" = "no" && test "$build_native" = "yes" ; then output_sym "CONFIG_BUILD_NATIVE" fi