diff options
author | Patrick Venture <venture@google.com> | 2018-11-21 21:37:23 -0800 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2019-01-14 12:31:35 -0800 |
commit | 9a7ef7c639a5cb538759cf13d078282d69ae6111 (patch) | |
tree | 7c85b6483f404c41784cc603a4ec6146e9a1b400 | |
parent | 99b95815550d2d84140d00032e341b8206fa9601 (diff) | |
download | phosphor-hwmon-9a7ef7c639a5cb538759cf13d078282d69ae6111.tar.gz phosphor-hwmon-9a7ef7c639a5cb538759cf13d078282d69ae6111.zip |
build: cleanup configure script PKG_CHECK_MODULES
Cleanup the configure script package include lines. There isn't a set
style for this yet, but this is an attempt to improve readability
whereas it's often one long line per library.
Change-Id: I9df8c9384b54bba30bb49193ee2dd6e532f99249
Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r-- | configure.ac | 121 |
1 files changed, 98 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index aafc80e..6bfb254 100644 --- a/configure.ac +++ b/configure.ac @@ -13,11 +13,36 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET # Checks for libraries. -PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], [], [AC_MSG_ERROR(["sdbusplus required and not found."])]) -PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus], [], [AC_MSG_ERROR(["sdeventplus required and not found."])]) -PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], [], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])]) -PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging], [], [AC_MSG_ERROR(["phosphor-logging required and not found."])]) -PKG_CHECK_MODULES([GPIOPLUS], [gpioplus],, [AC_MSG_ERROR([Could not find gpioplus...openbmc/gpioplus package required])]) +PKG_CHECK_MODULES( + [SDBUSPLUS], + [sdbusplus], + [], + [AC_MSG_ERROR(["sdbusplus required and not found."])] +) +PKG_CHECK_MODULES( + [SDEVENTPLUS], + [sdeventplus], + [], + [AC_MSG_ERROR(["sdeventplus required and not found."])] +) +PKG_CHECK_MODULES( + [PHOSPHOR_DBUS_INTERFACES], + [phosphor-dbus-interfaces], + [], + [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])] +) +PKG_CHECK_MODULES( + [PHOSPHOR_LOGGING], + [phosphor-logging], + [], + [AC_MSG_ERROR(["phosphor-logging required and not found."])] +) +PKG_CHECK_MODULES( + [GPIOPLUS], + [gpioplus], + [], + [AC_MSG_ERROR([Could not find gpioplus...openbmc/gpioplus package required])] +) AX_PTHREAD([], [AC_MSG_ERROR(["pthread required and not found"])]) # Checks for typedefs, structures, and compiler characteristics. @@ -25,24 +50,49 @@ AX_CXX_COMPILE_STDCXX_17([noext]) AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) # Checks for header files. -AC_CHECK_HEADER(experimental/filesystem, [], [AC_MSG_ERROR([Could not find experimental/filesystem...libstdc++fs development package required])]) +AC_CHECK_HEADER( + experimental/filesystem, + [], + [AC_MSG_ERROR( + [Could not find experimental/filesystem...libstdc++fs development package required]) + ] +) # Checks for library functions. LT_INIT # Check/set gtest specific functions. -PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])]) -PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])]) -PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main], [], [AC_MSG_NOTICE([gtest_main not found, tests will not build])]) +PKG_CHECK_MODULES( + [GTEST], + [gtest], + [], + [AC_MSG_NOTICE([gtest not found, tests will not build])] +) +PKG_CHECK_MODULES( + [GMOCK], + [gmock], + [], + [AC_MSG_NOTICE([gmock not found, tests will not build])] +) +PKG_CHECK_MODULES( + [GTEST_MAIN], + [gtest_main], + [], + [AC_MSG_NOTICE([gtest_main not found, tests will not build])] +) # Add --enable-oe-sdk flag to configure script AC_ARG_ENABLE([oe-sdk], - AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) + AS_HELP_STRING( + [--enable-oe-sdk], + [Link testcases absolutely against OE SDK so they can be ran within it.] + ) ) # Check for OECORE_TARGET_SYSROOT in the environment. AC_ARG_VAR(OECORE_TARGET_SYSROOT, - [Path to the OE SDK SYSROOT]) + [Path to the OE SDK SYSROOT] +) # Configure OESDK_TESTCASE_FLAGS environment variable, which will be later # used in test/Makefile.am @@ -61,14 +111,22 @@ AS_IF([test "x$enable_oe_sdk" == "xyes"], # When a sensor access fails, just remove the sensor from dbus instead of exiting the daemon. AC_ARG_ENABLE([remove-from-dbus-on-fail], - AS_HELP_STRING([--enable-remove-from-dbus-on-fail], [Remove properties from D-Bus on access failures]) + AS_HELP_STRING( + [--enable-remove-from-dbus-on-fail], + [Remove properties from D-Bus on access failures] + ) ) AC_ARG_VAR(REMOVE_ON_FAIL, [Remove properties from D-Bus on access failures]) -AS_IF([test "x$enable_remove_from_dbus_on_fail" == "xyes"], - [REMOVE_ON_FAIL="yes"] - AC_DEFINE_UNQUOTED([REMOVE_ON_FAIL], ["$REMOVE_ON_FAIL"], [Remove properties from D-Bus on access failures]) +AS_IF( + [test "x$enable_remove_from_dbus_on_fail" == "xyes"], + [REMOVE_ON_FAIL="yes"] + AC_DEFINE_UNQUOTED( + [REMOVE_ON_FAIL], + ["$REMOVE_ON_FAIL"], + [Remove properties from D-Bus on access failures] + ) ) # When a sensor read fails, set the Value on dbus with -errno. @@ -78,18 +136,35 @@ AC_ARG_ENABLE([negative-errno-on-fail], ) AC_ARG_VAR(NEGATIVE_ERRNO_ON_FAIL, [Set sensor value to -errno on read failures]) - -AS_IF([test "x$enable_negative_errno_on_fail" == "xyes"], - [NEGATIVE_ERRNO_ON_FAIL="yes"] - AC_DEFINE_UNQUOTED([NEGATIVE_ERRNO_ON_FAIL], ["$NEGATIVE_ERRNO_ON_FAIL"], [Set sensor value to -errno on read failures]) +AS_IF( + [test "x$enable_negative_errno_on_fail" == "xyes"], + [NEGATIVE_ERRNO_ON_FAIL="yes"] + AC_DEFINE_UNQUOTED( + [NEGATIVE_ERRNO_ON_FAIL], + ["$NEGATIVE_ERRNO_ON_FAIL"], [Set sensor value to -errno on read failures] + ) ) AC_ARG_VAR(BUSNAME_PREFIX, [The DBus busname prefix.]) AC_ARG_VAR(SENSOR_ROOT, [The DBus sensors namespace root.]) -AS_IF([test "x$BUSNAME_PREFIX" == "x"], [BUSNAME_PREFIX="xyz.openbmc_project.Hwmon"]) -AS_IF([test "x$SENSOR_ROOT" == "x"], [SENSOR_ROOT="/xyz/openbmc_project/sensors"]) -AC_DEFINE_UNQUOTED([BUSNAME_PREFIX], ["$BUSNAME_PREFIX"], [The DBus busname prefix.]) -AC_DEFINE_UNQUOTED([SENSOR_ROOT], ["$SENSOR_ROOT"], [The DBus sensors namespace root.]) +AS_IF( + [test "x$BUSNAME_PREFIX" == "x"], + [BUSNAME_PREFIX="xyz.openbmc_project.Hwmon"] +) +AS_IF( + [test "x$SENSOR_ROOT" == "x"], + [SENSOR_ROOT="/xyz/openbmc_project/sensors"] +) +AC_DEFINE_UNQUOTED( + [BUSNAME_PREFIX], + ["$BUSNAME_PREFIX"], + [The DBus busname prefix.] +) +AC_DEFINE_UNQUOTED( + [SENSOR_ROOT], + ["$SENSOR_ROOT"], + [The DBus sensors namespace root.] +) # Create configured output AC_CONFIG_FILES([Makefile test/Makefile tools/Makefile msl/Makefile]) |