X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=configure;h=748977525aff99ab77dbd46251596b63e14a8dda;hp=172b235bc540ef63ae25125a725a398c96d018a1;hb=f6cbf8ac4f70c800bbbfc23c5dcf44ed619c0acc;hpb=1527dc50fa754694473d126990111d45001ec562 diff --git a/configure b/configure index 172b235b..74897752 100755 --- a/configure +++ b/configure @@ -135,11 +135,14 @@ show_help="no" exit_val=0 gfio_check="no" libhdfs="no" +prefix=/usr/local # parse options for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case "$opt" in + --prefix=*) prefix="$optarg" + ;; --cpu=*) cpu="$optarg" ;; # esx is cross compiled and cannot be detect through simple uname calls @@ -165,6 +168,10 @@ for opt do ;; --enable-libhdfs) libhdfs="yes" ;; + --disable-shm) no_shm="yes" + ;; + --disable-optimizations) disable_opt="yes" + ;; --help) show_help="yes" ;; @@ -176,6 +183,7 @@ for opt do done if test "$show_help" = "yes" ; then + echo "--prefix= Use this directory as installation prefix" echo "--cpu= Specify target CPU if auto-detect fails" echo "--cc= Specify compiler to use" echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" @@ -184,7 +192,10 @@ if test "$show_help" = "yes" ; then echo "--esx Configure build options for esx" echo "--enable-gfio Enable building of gtk gfio" echo "--disable-numa Disable libnuma even if found" + echo "--disable-gfapi Disable gfapi" echo "--enable-libhdfs Enable hdfs support" + echo "--disable-shm Disable SHM support" + echo "--disable-optimizations Don't enable compiler optimizations" exit $exit_val fi @@ -212,6 +223,14 @@ printf " '%s'" "$0" "$@" >> $config_host_mak echo >> $config_host_mak echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak +if test "$no_shm" = "yes" ; then + output_sym "CONFIG_NO_SHM" +fi + +if test "$disable_opt" = "yes" ; then + output_sym "CONFIG_FIO_NO_OPT" +fi + # Some host OSes need non-standard checks for which CPU to use. # Note that these checks are broken for cross-compilation: if you're # cross-compiling to one of these OSes then you'll need to specify @@ -539,17 +558,18 @@ fi echo "Solaris AIO support $solaris_aio" ########################################## -# __sync_fetch_and_and test +# __sync_fetch_and_add test sfaa="no" cat > $TMPC << EOF -static int sfaa(int *ptr) +#include +static int sfaa(uint64_t *ptr) { return __sync_fetch_and_add(ptr, 0); } int main(int argc, char **argv) { - int val = 42; + uint64_t val = 42; sfaa(&val); return val; } @@ -714,6 +734,24 @@ EOF fi echo "CLOCK_MONOTONIC $clock_monotonic" +########################################## +# CLOCK_MONOTONIC_RAW probe +clock_monotonic_raw="no" +if test "$clock_gettime" = "yes" ; then + cat > $TMPC << EOF +#include +#include +int main(int argc, char **argv) +{ + return clock_gettime(CLOCK_MONOTONIC_RAW, NULL); +} +EOF + if compile_prog "" "$LIBS" "clock monotonic"; then + clock_monotonic_raw="yes" + fi +fi +echo "CLOCK_MONOTONIC_RAW $clock_monotonic_raw" + ########################################## # CLOCK_MONOTONIC_PRECISE probe clock_monotonic_precise="no" @@ -854,8 +892,8 @@ int main(int argc, char **argv) return nvm_atomic_write(handle, 0, 0, 0); } EOF -if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then - LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS" +if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then + LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS" fusion_aw="yes" fi echo "Fusion-io atomic engine $fusion_aw" @@ -885,7 +923,7 @@ cat > $TMPC << EOF int main(int argc, char **argv) { struct bitmask *mask = numa_parse_nodestring(NULL); - return 0; + return mask->size == 0; } EOF if compile_prog "" "" "libnuma api"; then @@ -901,7 +939,8 @@ cat > $TMPC << EOF #include int main(int argc, char **argv) { - strsep(NULL, NULL); + static char *string = "This is a string"; + strsep(&string, "needle"); return 0; } EOF @@ -925,6 +964,25 @@ if compile_prog "" "" "strcasestr"; then fi echo "strcasestr $strcasestr" +########################################## +# strlcat() probe +strlcat="no" +cat > $TMPC << EOF +#include +int main(int argc, char **argv) +{ + static char dst[64]; + static char *string = "This is a string"; + memset(dst, 0, sizeof(dst)); + strlcat(dst, string, sizeof(dst)); + return 0; +} +EOF +if compile_prog "" "" "strlcat"; then + strlcat="yes" +fi +echo "strlcat $strlcat" + ########################################## # getopt_long_only() probe getopt_long_only="no" @@ -1367,6 +1425,27 @@ if test "$libhdfs" = "yes" ; then fi echo "HDFS engine $libhdfs" +########################################## +# Check whether we have MTD +mtd="no" +cat > $TMPC << EOF +#include +#include +#include +int main(int argc, char **argv) +{ + struct mtd_write_req ops; + struct mtd_info_user info; + memset(&ops, 0, sizeof(ops)); + info.type = MTD_MLCNANDFLASH; + return ioctl(0, MEMGETINFO, &info); +} +EOF +if compile_prog "" "" "mtd"; then + mtd="yes" +fi +echo "MTD $mtd" + # Check if we have lex/yacc available yacc="no" yacc_is_bison="no" @@ -1411,6 +1490,74 @@ fi echo "lex/yacc for arithmetic $arith" +########################################## +# Check whether we have setmntent/getmntent +getmntent="no" +cat > $TMPC << EOF +#include +#include +int main(int argc, char **argv) +{ + FILE *mtab = setmntent(NULL, "r"); + struct mntent *mnt = getmntent(mtab); + endmntent(mtab); + return 0; +} +EOF +if compile_prog "" "" "getmntent"; then + getmntent="yes" +fi +echo "getmntent $getmntent" + +########################################## +# Check whether we have getmntinfo +getmntinfo="no" +cat > $TMPC << EOF +#include +#include +#include +int main(int argc, char **argv) +{ + struct statfs st; + return getmntinfo(&st, MNT_NOWAIT); +} +EOF +if compile_prog "" "" "getmntinfo"; then + getmntinfo="yes" +fi +echo "getmntinfo $getmntinfo" + +########################################## +# Check whether we have _Static_assert +static_assert="no" +cat > $TMPC << EOF +#include +#include +#undef offsetof +#ifdef __compiler_offsetof +#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) +#else +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif + +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +struct foo { + int a, b; +}; + +int main(int argc, char **argv) +{ + _Static_assert(offsetof(struct foo, a) == 0 , "Check"); + return 0 ; +} +EOF +if compile_prog "" "" "static_assert"; then + static_assert="yes" +fi +echo "Static Assert $static_assert" ############################################################################# if test "$wordsize" = "64" ; then @@ -1461,6 +1608,9 @@ fi if test "$clock_monotonic" = "yes" ; then output_sym "CONFIG_CLOCK_MONOTONIC" fi +if test "$clock_monotonic_raw" = "yes" ; then + output_sym "CONFIG_CLOCK_MONOTONIC_RAW" +fi if test "$clock_monotonic_precise" = "yes" ; then output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" fi @@ -1481,6 +1631,9 @@ fi if test "$strcasestr" = "yes" ; then output_sym "CONFIG_STRCASESTR" fi +if test "$strlcat" = "yes" ; then + output_sym "CONFIG_STRLCAT" +fi if test "$getopt_long_only" = "yes" ; then output_sym "CONFIG_GETOPT_LONG_ONLY" fi @@ -1570,6 +1723,9 @@ if test "$libhdfs" = "yes" ; then echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak fi +if test "$mtd" = "yes" ; then + output_sym "CONFIG_MTD" +fi if test "$arith" = "yes" ; then output_sym "CONFIG_ARITHMETIC" if test "$yacc_is_bison" = "yes" ; then @@ -1578,6 +1734,15 @@ if test "$arith" = "yes" ; then echo "YACC=$YACC" >> $config_host_mak fi fi +if test "$getmntent" = "yes" ; then + output_sym "CONFIG_GETMNTENT" +fi +if test "$getmntinfo" = "yes" ; then + output_sym "CONFIG_GETMNTINFO" +fi +if test "$static_assert" = "yes" ; then + output_sym "CONFIG_STATIC_ASSERT" +fi if test "$zlib" = "no" ; then echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it." @@ -1589,3 +1754,11 @@ echo "CFLAGS+=$CFLAGS" >> $config_host_mak echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak echo "CC=$cc" >> $config_host_mak echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak +echo "INSTALL_PREFIX=$prefix" >> $config_host_mak + +if [ `dirname $0` != "." -a ! -e Makefile ]; then + cat > Makefile <