[PATCH] Make fio build again on "crippled" platforms
Some time in the future we want a proper configure setup and only
install the supported io engines, for now install limited versions
that just complain on initialization.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/engines/fio-engine-libaio.c b/engines/fio-engine-libaio.c
index 1848dcc..c0f280b 100644
--- a/engines/fio-engine-libaio.c
+++ b/engines/fio-engine-libaio.c
@@ -10,6 +10,8 @@
#include "fio.h"
#include "os.h"
+#ifdef FIO_HAVE_LIBAIO
+
#define ev_to_iou(ev) (struct io_u *) ((unsigned long) (ev)->obj)
struct libaio_data {
@@ -138,3 +140,24 @@
.event = fio_libaio_event,
.cleanup = fio_libaio_cleanup,
};
+
+#else /* FIO_HAVE_LIBAIO */
+
+/*
+ * When we have a proper configure system in place, we simply wont build
+ * and install this io engine. For now install a crippled version that
+ * just complains and fails to load.
+ */
+static int fio_libaio_init(struct thread_data fio_unused *td)
+{
+ fprintf(stderr, "fio: libaio not available\n");
+ return 1;
+}
+
+struct ioengine_ops ioengine = {
+ .name = "libaio",
+ .version = FIO_IOOPS_VERSION,
+ .init = fio_libaio_init,
+};
+
+#endif