X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=configure;h=5dd683c673dae80a270f42b2b638ab29635e1316;hp=836d7ade7940979f1e39b2c40baa959f4f1321b0;hb=62232d0618e3f5aa4805b4be34e872895ba1beb2;hpb=d9d9db0f8000fec31a0996c602a0fb76b4c2a548 diff --git a/configure b/configure index 836d7ade..5dd683c6 100755 --- a/configure +++ b/configure @@ -38,8 +38,8 @@ fatal() { } # Default CFLAGS -CFLAGS="-D_GNU_SOURCE" -EXTFLAGS="-include config-host.h" +CFLAGS="-D_GNU_SOURCE -include config-host.h" +BUILD_CFLAGS="" # Print a helpful header at the top of config.log echo "# FIO configure log $(date)" >> config.log @@ -129,8 +129,10 @@ cpu="" cross_prefix=${cross_prefix-${CROSS_COMPILE}} cc="${CC-${cross_prefix}gcc}" +# default options show_help="no" exit_val=0 +gfio="no" # parse options for opt do @@ -144,9 +146,12 @@ for opt do ;; --build-32bit-win=*) build_32bit_win="$optarg" ;; - --help) - show_help="yes" + --enable-gfio) + gfio="yes" ;; + --help) + show_help="yes" + ;; *) echo "Bad option $opt" show_help="yes" @@ -159,6 +164,7 @@ if test "$show_help" = "yes" ; then echo "--cc= Specify compiler to use" echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" 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 @@ -230,7 +236,7 @@ CYGWIN*) 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 + echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak exit 0 ;; esac @@ -911,6 +917,48 @@ fi echo "__thread $tls_thread" ########################################## +# Whether or not __thread is supported for TLS +if test "$gfio" = "yes" ; then + cat > $TMPC << EOF +#include +#include +#include +int main(void) +{ + gdk_threads_enter(); + gdk_threads_leave(); + + printf("%d", GTK_CHECK_VERSION(2, 18, 0)); +} +EOF +GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0) +if test "$?" != "0" ; then + echo "configure: gtk and gthread not found" + exit 1 +fi +GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0) +if test "$?" != "0" ; then + echo "configure: gtk and gthread not found" + exit 1 +fi +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" +fi +fi + +echo "gfio $gfio" + # Check whether we have getrusage(RUSAGE_THREAD) rusage_thread="no" cat > $TMPC << EOF @@ -1076,6 +1124,9 @@ fi if test "$rusage_thread" = "yes" ; then output_sym "CONFIG_RUSAGE_THREAD" 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 @@ -1087,5 +1138,6 @@ if test "$rlimit_memlock" = "yes" ; then fi echo "LIBS+=$LIBS" >> $config_host_mak +echo "CFLAGS+=$CFLAGS" >> $config_host_mak echo "CC=$cc" >> $config_host_mak -echo "EXTFLAGS=$EXTFLAGS $CFLAGS" >> $config_host_mak +echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak