summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2017-12-29 03:40:05 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-01-16 15:22:21 +0000
commitcf4fdca920c93d137d537cf59ad36c1bcb9a52d6 (patch)
tree85373bc458bf3d5565b9f3a6a617d33f1d55abfa
parentdae2d940092520c839a0af00970b448ca4c36a88 (diff)
downloadopenpower-occ-control-cf4fdca920c93d137d537cf59ad36c1bcb9a52d6.zip
openpower-occ-control-cf4fdca920c93d137d537cf59ad36c1bcb9a52d6.tar.gz
Install error yaml files to shared location
Change-Id: Id7ffc23fbea28f303521bb04faaaa13b931a3e09 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
-rw-r--r--Makefile.am8
-rw-r--r--configure.ac111
2 files changed, 68 insertions, 51 deletions
diff --git a/Makefile.am b/Makefile.am
index 3044e38..b883f94 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,4 @@
+if !INSTALL_ERROR_YAML
# Build these headers, don't install them
noinst_HEADERS = \
occ_pass_through.hpp \
@@ -75,3 +76,10 @@ org/open_power/OCC/Device/error.cpp: ${top_srcdir}/org/open_power/OCC/Device.err
$(SDBUSPLUSPLUS) -r $(top_srcdir) error exception-cpp org.open_power.OCC.Device > $@
SUBDIRS = . test
+endif
+
+# Export error YAML to shared location
+yamldir = ${datadir}/phosphor-dbus-yaml/yaml
+nobase_yaml_DATA = \
+ org/open_power/OCC/Device.errors.yaml \
+ org/open_power/OCC/Device.metadata.yaml
diff --git a/configure.ac b/configure.ac
index 980ef40..0cabd36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,63 +10,72 @@ AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_MAKE_SET
-# Suppress the --with-libtool-sysroot error
-LT_INIT
-
-# gtest
-# Check/set gtest specific functions.
-AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
-AC_SUBST(GTEST_CPPFLAGS)
-
-# Test cases require SDK so only build if we're told to (and SDK is available)
-AC_ARG_ENABLE([oe-sdk],
- AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
-)
-AC_ARG_VAR(OECORE_TARGET_SYSROOT,
- [Path to the OE SDK SYSROOT])
-AS_IF([test "x$enable_oe_sdk" == "xyes"],
- AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
- AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
+# Check for compiler, packages only when install_error_yaml optional feature
+# is disabled
+AC_ARG_ENABLE([install_error_yaml],
+ AS_HELP_STRING([--enable-install_error_yaml], [Enable installing error yaml file]),
+ [], [install_error_yaml=yes])
+AM_CONDITIONAL([INSTALL_ERROR_YAML], [test "x$enable_install_error_yaml" = "xyes"])
+AS_IF([test "x$enable_install_error_yaml" != "xyes"], [
+
+ # Suppress the --with-libtool-sysroot error
+ LT_INIT
+
+ # gtest
+ # Check/set gtest specific functions.
+ AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
+ AC_SUBST(GTEST_CPPFLAGS)
+
+ # Test cases require SDK so only build if we're told to (and SDK is available)
+ AC_ARG_ENABLE([oe-sdk],
+ AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
+ )
+ AC_ARG_VAR(OECORE_TARGET_SYSROOT,
+ [Path to the OE SDK SYSROOT])
+ AS_IF([test "x$enable_oe_sdk" == "xyes"],
+ AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
+ AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
+ )
+ AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
+ [
+ testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
+ testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
+ testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
+ ]
+ AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
)
- AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
- [
- testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
- testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
- testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
- ]
- AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
-)
-PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
- AC_MSG_ERROR(["Requires sdbusplus package."]))
-PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
- AC_MSG_ERROR(["Requires phosphor-logging package."]))
-PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,\
- AC_MSG_ERROR(["Requires openpower-dbus-interfaces package."]))
-PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
- AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
+ PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
+ AC_MSG_ERROR(["Requires sdbusplus package."]))
+ PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
+ AC_MSG_ERROR(["Requires phosphor-logging package."]))
+ PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,\
+ AC_MSG_ERROR(["Requires openpower-dbus-interfaces package."]))
+ PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
+ AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
-# Check for sdbusplus
-PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])])
+ # Check for sdbusplus
+ PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])])
-# Check for sdbus++ tool
-AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
-AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
+ # Check for sdbus++ tool
+ AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
+ AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
-# Checks for typedefs, structures, and compiler characteristics.
-AX_CXX_COMPILE_STDCXX_14([noext])
-AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
+ # Checks for typedefs, structures, and compiler characteristics.
+ AX_CXX_COMPILE_STDCXX_14([noext])
+ AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
-AC_ARG_ENABLE([i2c-occ],
- AS_HELP_STRING([--enable-i2c-occ], [Enable I2C OCC support])
-)
-AS_IF([test "x$enable_i2c_occ" == "xyes"],
- AC_MSG_NOTICE([Enabling I2C OCC])
- [
- cpp_flags="-DI2C_OCC"
- ]
- AC_SUBST([CPPFLAGS], [$cpp_flags])
-)
+ AC_ARG_ENABLE([i2c-occ],
+ AS_HELP_STRING([--enable-i2c-occ], [Enable I2C OCC support])
+ )
+ AS_IF([test "x$enable_i2c_occ" == "xyes"],
+ AC_MSG_NOTICE([Enabling I2C OCC])
+ [
+ cpp_flags="-DI2C_OCC"
+ ]
+ AC_SUBST([CPPFLAGS], [$cpp_flags])
+ )
+])
AC_ARG_VAR(OCC_CONTROL_BUSNAME, [The Dbus busname to own])
AS_IF([test "x$OCC_CONTROL_BUSNAME" == "x"], [OCC_CONTROL_BUSNAME="org.open_power.OCC.Control"])
OpenPOWER on IntegriCloud