Enable conditional compilation flag for virtual pnor
Change-Id: I70e1b1f8d709ce79e0664d5f916115e77427b1e8
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/configure.ac b/configure.ac
index e9512b2..7057512 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,7 @@
# Checks for typedefs, structures, and compiler characteristics.
AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CFLAGS])
+AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CXXFLAGS])
# Checks for library functions.
LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
@@ -43,6 +44,20 @@
AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
)
+AC_ARG_ENABLE([virtual-pnor],
+ AS_HELP_STRING([--enable-virtual-pnor], [Turn on virtual pnor])
+)
+AS_IF([test "x$enable_virtual_pnor" == "xno"],
+ [
+ AM_CONDITIONAL(VIRTUAL_PNOR_ENABLED, false)
+ ],
+ [
+ AM_CONDITIONAL(VIRTUAL_PNOR_ENABLED, true)
+ AX_APPEND_COMPILE_FLAGS([-DVIRTUAL_PNOR_ENABLED], [CXXFLAGS])
+ AX_APPEND_COMPILE_FLAGS([-DVIRTUAL_PNOR_ENABLED], [CFLAGS])
+ ]
+)
+
AX_CODE_COVERAGE
PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd, , AC_MSG_ERROR([libsytemd not found]))