From 91f94d5b88b72c300be4f27ef6630e16af890db6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 24 Jan 2013 10:25:42 -0700 Subject: [PATCH] configure: add --enable-gfio Signed-off-by: Jens Axboe --- Makefile | 7 ++++--- configure | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index dbf30494..9d3465c4 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,6 @@ PROGS = fio SCRIPTS = fio_generate_plots UNAME := $(shell uname) -GTK_CFLAGS = `pkg-config --cflags gtk+-2.0 gthread-2.0` -GTK_LDFLAGS = `pkg-config --libs gtk+-2.0 gthread-2.0` - ifneq ($(wildcard config-host.mak),) all: include config-host.mak @@ -25,6 +22,10 @@ all: include config-host.mak endif +ifdef CONFIG_GFIO + PROGS += gfio +endif + SOURCE := gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \ eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \ lib/rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \ diff --git a/configure b/configure index f730dfdb..09e985e0 100755 --- a/configure +++ b/configure @@ -102,12 +102,19 @@ cpu="" cc="${CC-${cross_prefix}gcc}" +# default options +gfio="no" + # parse options for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case "$opt" in - --cc=*) CC="$optarg" - ;; + --cc=*) + CC="$optarg" + ;; + --enable-gfio) + gfio="yes" + ;; *) echo "Bad option $opt" exit 1 @@ -789,6 +796,43 @@ if compile_prog "" "" "__thread"; then 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(); + gtk_main(); + gdk_threads_leave(); + return 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 + gfio="yes" + LIBS="$LIBS $GTK_LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" +else + echo "Please install gtk and gdk libraries" + gfio="no" +fi +fi + +echo "gfio $gfio" + ############################################################################# echo "# Automatically generated by configure - do not modify" > $config_host_mak @@ -889,6 +933,10 @@ fi if test "$tls_thread" = "yes" ; then echo "CONFIG_TLS_THREAD=y" >> $config_host_mak fi +if test "$gfio" = "yes" ; then + echo "CONFIG_GFIO=y" >> $config_host_mak +fi echo "LIBS+=$LIBS" >> $config_host_mak +echo "CFLAGS+=$CFLAGS" >> $config_host_mak echo "CC=$cc" >> $config_host_mak -- 2.25.1