This commit introduces the BUILD_MESSAGE() macro. It uses _Pragma("message"),
with compilers that support that, to output a warning-like compile-time message
without blocking the compilation.
Used by next commit.
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
AC_SUBST(KARCH)
OVS_CHECK_LINUX
OVS_CHECK_DPDK
+OVS_CHECK_PRAGMA_MESSAGE
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(datapath/Makefile)
#define OVS_PREFETCH_WRITE(addr)
#endif
+/* Output a message (not an error) while compiling without failing the
+ * compilation process */
+#if HAVE_PRAGMA_MESSAGE
+#define DO_PRAGMA(x) _Pragma(#x)
+#define BUILD_MESSAGE(x) \
+ DO_PRAGMA(message(x))
+#else
+#define BUILD_MESSAGE(x)
+#endif
+
#endif /* compiler.h */
AC_DEFUN([OVS_CHECK_INCLUDE_NEXT],
[AC_REQUIRE([gl_CHECK_NEXT_HEADERS])
gl_CHECK_NEXT_HEADERS([$1])])
+
+dnl OVS_CHECK_PRAGMA_MESSAGE
+AC_DEFUN([OVS_CHECK_PRAGMA_MESSAGE],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[_Pragma("message(\"Checking for pragma message\")")
+ ]])],
+ [AC_DEFINE(HAVE_PRAGMA_MESSAGE,1,[Define if compiler supports #pragma
+ message directive])])
+ ])