Rework conditional feature usage
Currently, the infrastructure that we have to enable a flexible
compilation environment has a few issues:
- the allocator configuration is performed at run-time, while the log
configuration is performed at compile-time
- for a standard compile (ie, standard userspace, using
autoconf+automake to build), we need a few pre-defined configuration
options.
This change adds a bit of runtime selection to the logging
infrastructure, to match the allocator setup. We also unify the
compile-time defines into config.h, using MCTP_-prefixed macro names,
allowing integration into other build systems.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
diff --git a/serial.c b/serial.c
index 22c1b4b..8c5303b 100644
--- a/serial.c
+++ b/serial.c
@@ -6,7 +6,11 @@
#include <string.h>
#include <unistd.h>
-#ifdef MCTP_FILEIO
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef MCTP_HAVE_FILEIO
#include <fcntl.h>
#endif
@@ -243,7 +247,7 @@
mctp_rx_consume_one(serial, *(uint8_t *)(buf + i));
}
-#ifdef MCTP_FILEIO
+#ifdef MCTP_HAVE_FILEIO
int mctp_serial_read(struct mctp_binding_serial *serial)
{
ssize_t len;