X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=configure;h=1c8b2bb0d78821979e0c79430e36cf6292a8e8dc;hb=9db01ef976006c002b05fa4e4ec589eb029aac5b;hp=ff87acc58b54d2ed460a29658b41656ac0c5db8e;hpb=135be493d843d4cae2966a35cbd22a3058ec8e4b;p=fio.git diff --git a/configure b/configure index ff87acc5..1c8b2bb0 100755 --- a/configure +++ b/configure @@ -137,9 +137,11 @@ for opt do --extra-cflags=*) CFLAGS="$CFLAGS $optarg" ;; + --build-32bit-win=*) build_32bit_win="$optarg" + ;; --enable-gfio) - gfio="yes" - ;; + gfio="yes" + ;; --help) show_help="yes" ;; @@ -151,10 +153,11 @@ for opt do done if test "$show_help" = "yes" ; then - echo "--cc= Specify compiler to use" + echo "--cc= Specify compiler to use" echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" - echo "--enable-gfio Enable building of gtk gfio" - exit $exit_val + echo "--build-32bit-win= Specify yes for a 32-bit build on Windows" + echo "--enable-gfio Enable building of gtk gfio" + exit $exit_val fi if check_define __linux__ ; then @@ -191,23 +194,30 @@ SunOS) CYGWIN*) echo "Forcing known good options on Windows" if test -z "$CC" ; then - CC="x86_64-w64-mingw32-gcc" + if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then + CC="i686-w64-mingw32-gcc" + else + CC="x86_64-w64-mingw32-gcc" + fi fi output_sym "CONFIG_LITTLE_ENDIAN" - output_sym "CONFIG_64BIT_LLP64" - output_sym "CONFIG_CLOCK_GETTIME" - output_sym "CONFIG_CLOCK_MONOTONIC" - output_sym "CONFIG_GETTIMEOFDAY" + if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then + output_sym "CONFIG_32BIT" + else + output_sym "CONFIG_64BIT_LLP64" + fi output_sym "CONFIG_FADVISE" output_sym "CONFIG_SOCKLEN_T" - output_sym "CONFIG_POSIX_FALLOCATE" output_sym "CONFIG_FADVISE" output_sym "CONFIG_SFAA" output_sym "CONFIG_RUSAGE_THREAD" output_sym "CONFIG_WINDOWSAIO" output_sym "CONFIG_FDATASYNC" + output_sym "CONFIG_CLOCK_MONOTONIC" output_sym "CONFIG_GETTIMEOFDAY" output_sym "CONFIG_CLOCK_GETTIME" + output_sym "CONFIG_SCHED_IDLE" + output_sym "CONFIG_TCP_NODELAY" echo "CC=$CC" >> $config_host_mak echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak exit 0 @@ -844,9 +854,9 @@ if test "$gfio" = "yes" ; then int main(void) { gdk_threads_enter(); - gtk_main(); gdk_threads_leave(); - return 0; + + printf("%d", GTK_CHECK_VERSION(2, 18, 0)); } EOF GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0) @@ -859,10 +869,16 @@ if test "$?" != "0" ; then echo "configure: gtk and gthread not found" exit 1 fi -if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio"; then - gfio="yes" - LIBS="$LIBS $GTK_LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" +if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then + r=$($TMPE) + if test "$r" != "0" ; then + gfio="yes" + LIBS="$LIBS $GTK_LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + else + echo "GTK found, but need version 2.18 or higher" + gfio="no" + fi else echo "Please install gtk and gdk libraries" gfio="no" @@ -888,6 +904,40 @@ if compile_prog "" "" "RUSAGE_THREAD"; then fi echo "RUSAGE_THREAD $rusage_thread" +########################################## +# Check whether we have SCHED_IDLE +sched_idle="no" +cat > $TMPC << EOF +#include +int main(int argc, char **argv) +{ + struct sched_param p; + return sched_setscheduler(0, SCHED_IDLE, &p); +} +EOF +if compile_prog "" "" "SCHED_IDLE"; then + sched_idle="yes" +fi +echo "SCHED_IDLE $sched_idle" + +########################################## +# Check whether we have TCP_NODELAY +tcp_nodelay="no" +cat > $TMPC << EOF +#include +#include +#include +#include +int main(int argc, char **argv) +{ + return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); +} +EOF +if compile_prog "" "" "TCP_NODELAY"; then + tcp_nodelay="yes" +fi +echo "TCP_NODELAY $tcp_nodelay" + ############################################################################# echo "# Automatically generated by configure - do not modify" > $config_host_mak @@ -994,6 +1044,12 @@ fi if test "$gfio" = "yes" ; then echo "CONFIG_GFIO=y" >> $config_host_mak fi +if test "$sched_idle" = "yes" ; then + output_sym "CONFIG_SCHED_IDLE" +fi +if test "$tcp_nodelay" = "yes" ; then + output_sym "CONFIG_TCP_NODELAY" +fi echo "LIBS+=$LIBS" >> $config_host_mak echo "CFLAGS+=$CFLAGS" >> $config_host_mak