summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-03-12 15:38:28 -0700
committerBart Van Assche <bart.vanassche@wdc.com>2018-03-19 10:39:28 -0700
commit44e8e956254815d90472076951b81bc933f83fd5 (patch)
tree69abcdb147d5477f69eb0a20c0f0ca26b9ecd66d /configure
parentd3d378218e9e03411749b65451b32d7a7466ff61 (diff)
downloadfio-44e8e956254815d90472076951b81bc933f83fd5.tar.gz
fio-44e8e956254815d90472076951b81bc933f83fd5.tar.bz2
Add an asprintf() implementation
Since I would like to use the asprintf() function in the ZBC code and since that function is not available on every platform supported by fio, add an asprintf() implementation. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure b/configure
index ddf03a6b..f6358630 100755
--- a/configure
+++ b/configure
@@ -784,6 +784,40 @@ fi
print_config "rdmacm" "$rdmacm"
##########################################
+# asprintf() and vasprintf() probes
+if test "$have_asprintf" != "yes" ; then
+ have_asprintf="no"
+fi
+cat > $TMPC << EOF
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ return asprintf(NULL, "%s", "str") == 0;
+}
+EOF
+if compile_prog "" "" "have_asprintf"; then
+ have_asprintf="yes"
+fi
+print_config "asprintf()" "$have_asprintf"
+
+if test "$have_vasprintf" != "yes" ; then
+ have_vasprintf="no"
+fi
+cat > $TMPC << EOF
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ return vasprintf(NULL, "%s", NULL) == 0;
+}
+EOF
+if compile_prog "" "" "have_vasprintf"; then
+ have_vasprintf="yes"
+fi
+print_config "vasprintf()" "$have_vasprintf"
+
+##########################################
# Linux fallocate probe
if test "$linux_fallocate" != "yes" ; then
linux_fallocate="no"
@@ -2169,6 +2203,12 @@ fi
if test "$posix_pshared" = "yes" ; then
output_sym "CONFIG_PSHARED"
fi
+if test "$have_asprintf" = "yes" ; then
+ output_sym "HAVE_ASPRINTF"
+fi
+if test "$have_vasprintf" = "yes" ; then
+ output_sym "HAVE_VASPRINTF"
+fi
if test "$linux_fallocate" = "yes" ; then
output_sym "CONFIG_LINUX_FALLOCATE"
fi