DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
- CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
- $(DEBUGFLAGS)
+ CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(DEBUGFLAGS)
OPTFLAGS= -O3 -g -ffast-math $(EXTFLAGS)
CFLAGS = -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS)
-LIBS = -lm $(EXTLIBS)
+LIBS = -lm -lz $(EXTLIBS)
PROGS = fio
SCRIPTS = fio_generate_plots
UNAME := $(shell uname)
lib/num2str.c lib/ieee754.c $(wildcard crc/*.c) engines/cpu.c \
engines/mmap.c engines/sync.c engines/null.c engines/net.c \
memalign.c server.c client.c iolog.c backend.c libfio.c flow.c \
- json.c lib/zipf.c lib/axmap.c lib/lfsr.c gettime-thread.c \
- helpers.c lib/flist_sort.c lib/hweight.c lib/getrusage.c
+ cconv.c lib/prio_tree.c json.c lib/zipf.c lib/axmap.c \
+ lib/lfsr.c gettime-thread.c helpers.c lib/flist_sort.c \
- lib/hweight.c
++ lib/hweight.c lib/getrusage.c
ifdef CONFIG_64BIT_LLP64
CFLAGS += -DBITS_PER_LONG=32
CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
.c.o: .depend FORCE
- $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $<
+ $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
init.o: FIO-VERSION-FILE
- $(QUIET_CC)$(CC) -o init.o -c $(CFLAGS) $(CPPFLAGS) -c init.c
+ $(QUIET_CC)$(CC) -o init.o $(CFLAGS) $(CPPFLAGS) -c init.c
+gcompat.o: gcompat.c gcompat.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gcompat.c
+
+goptions.o: goptions.c goptions.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c goptions.c
+
+ghelpers.o: ghelpers.c ghelpers.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c ghelpers.c
+
+gerror.o: gerror.c gerror.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gerror.c
+
+gclient.o: gclient.c gclient.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gclient.c
+
+gfio.o: gfio.c ghelpers.c
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gfio.c
+
+graph.o: graph.c graph.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c graph.c
+
+cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c cairo_text_helpers.c
+
+printing.o: printing.c printing.h
+ $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c printing.c
+
t/stest: $(T_SMALLOC_OBJS)
$(QUIET_CC)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS) $(LDFLAGS)
$(PROGS): .depend
clean: FORCE
- -rm -f .depend $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core gfio FIO-VERSION-FILE config-host.mak config-host.ld cscope.out
- -rm -f .depend $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core FIO-VERSION-FILE config-host.mak cscope.out
++ -rm -f .depend $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core gfio FIO-VERSION-FILE config-host.mak cscope.out
cscope:
@cscope -b -R
cc="${CC-${cross_prefix}gcc}"
- gfio="no"
+# default options
show_help="no"
exit_val=0
++gfio="no"
# parse options
for opt do
optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
case "$opt" in
- --cc=*) CC="$optarg"
- ;;
- --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
+ --cc=*)
+ CC="$optarg"
+ ;;
++ --extra-cflags=*)
++ CFLAGS="$CFLAGS $optarg"
+ ;;
+ --enable-gfio)
+ gfio="yes"
+ ;;
--help)
- show_help="yes"
- ;;
+ show_help="yes"
+ ;;
*)
echo "Bad option $opt"
show_help="yes"
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"
- exit $exit_val
+ echo "--enable-gfio Enable building of gtk gfio"
+ exit $exit_val
fi
if check_define __linux__ ; then
echo "__thread $tls_thread"
##########################################
+# Whether or not __thread is supported for TLS
+if test "$gfio" = "yes" ; then
+ cat > $TMPC << EOF
+#include <glib.h>
+#include <cairo.h>
+#include <gtk/gtk.h>
+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"
+
+ # Check whether we have getrusage(RUSAGE_THREAD)
+ rusage_thread="no"
+ cat > $TMPC << EOF
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ int main(int argc, char **argv)
+ {
+ struct rusage ru;
+ getrusage(RUSAGE_THREAD, &ru);
+ return 0;
+ }
+ EOF
+ if compile_prog "" "" "RUSAGE_THREAD"; then
+ rusage_thread="yes"
+ fi
+ echo "RUSAGE_THREAD $rusage_thread"
+
#############################################################################
echo "# Automatically generated by configure - do not modify" > $config_host_mak
exit 1
fi
if test "$bigendian" = "yes" ; then
- echo "CONFIG_BIG_ENDIAN=y" >> $config_host_mak
+ output_sym "CONFIG_BIG_ENDIAN"
else
- echo "CONFIG_LITTLE_ENDIAN=y" >> $config_host_mak
+ output_sym "CONFIG_LITTLE_ENDIAN"
fi
if test "$libaio" = "yes" ; then
- echo "CONFIG_LIBAIO=y" >> $config_host_mak
+ output_sym "CONFIG_LIBAIO"
fi
if test "$posix_aio" = "yes" ; then
- echo "CONFIG_POSIXAIO=y" >> $config_host_mak
+ output_sym "CONFIG_POSIXAIO"
fi
if test "$posix_aio_fsync" = "yes" ; then
- echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
+ output_sym "CONFIG_POSIXAIO_FSYNC"
fi
if test "$linux_fallocate" = "yes" ; then
- echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
+ output_sym "CONFIG_LINUX_FALLOCATE"
fi
if test "$posix_fallocate" = "yes" ; then
- echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
+ output_sym "CONFIG_POSIX_FALLOCATE"
fi
if test "$fdatasync" = "yes" ; then
- echo "CONFIG_FDATASYNC=y" >> $config_host_mak
+ output_sym "CONFIG_FDATASYNC"
fi
if test "$sync_file_range" = "yes" ; then
- echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
+ output_sym "CONFIG_SYNC_FILE_RANGE"
fi
if test "$sfaa" = "yes" ; then
- echo "CONFIG_SFAA=y" >> $config_host_mak
+ output_sym "CONFIG_SFAA"
fi
if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
- echo "CONFIG_RDMA=y" >> $config_host_mak
+ output_sym "CONFIG_RDMA"
fi
if test "$clock_gettime" = "yes" ; then
- echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
+ output_sym "CONFIG_CLOCK_GETTIME"
fi
if test "$clock_monotonic" = "yes" ; then
- echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
+ output_sym "CONFIG_CLOCK_MONOTONIC"
fi
if test "$clock_monotonic_precise" = "yes" ; then
- echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
+ output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE"
fi
if test "$gettimeofday" = "yes" ; then
- echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
+ output_sym "CONFIG_GETTIMEOFDAY"
fi
if test "$posix_fadvise" = "yes" ; then
- echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
+ output_sym "CONFIG_POSIX_FADVISE"
fi
if test "$linux_3arg_affinity" = "yes" ; then
- echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
+ output_sym "CONFIG_3ARG_AFFINITY"
elif test "$linux_2arg_affinity" = "yes" ; then
- echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
+ output_sym "CONFIG_2ARG_AFFINITY"
fi
if test "$strsep" = "yes" ; then
- echo "CONFIG_STRSEP=y" >> $config_host_mak
+ output_sym "CONFIG_STRSEP"
fi
if test "$getopt_long_only" = "yes" ; then
- echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
+ output_sym "CONFIG_GETOPT_LONG_ONLY"
fi
if test "$inet_aton" = "yes" ; then
- echo "CONFIG_INET_ATON=y" >> $config_host_mak
+ output_sym "CONFIG_INET_ATON"
fi
if test "$socklen_t" = "yes" ; then
- echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
+ output_sym "CONFIG_SOCKLEN_T"
fi
if test "$ext4_me" = "yes" ; then
- echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
+ output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
fi
if test "$linux_splice" = "yes" ; then
- echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
+ output_sym "CONFIG_LINUX_SPLICE"
fi
if test "$guasi" = "yes" ; then
- echo "CONFIG_GUASI=y" >> $config_host_mak
+ output_sym "CONFIG_GUASI"
fi
if test "$fusion_aw" = "yes" ; then
- echo "CONFIG_FUSION_AW=y" >> $config_host_mak
+ output_sym "CONFIG_FUSION_AW"
fi
if test "$libnuma" = "yes" ; then
- echo "CONFIG_LIBNUMA=y" >> $config_host_mak
+ output_sym "CONFIG_LIBNUMA"
fi
if test "$solaris_aio" = "yes" ; then
- echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
+ output_sym "CONFIG_SOLARISAIO"
fi
if test "$tls_thread" = "yes" ; then
- echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
+ output_sym "CONFIG_TLS_THREAD"
+ 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
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