Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
| 2 | AC_INIT([openpower-pnor-code-mgmt], [1.0], [https://github.com/openbmc/openpower-pnor-code-mgmt/issues]) |
| 3 | AC_LANG([C++]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 6 | AM_SILENT_RULES([yes]) |
| 7 | |
Andrew Jeffery | 234ba8a | 2017-04-18 16:55:25 +0930 | [diff] [blame] | 8 | AC_CONFIG_MACRO_DIRS([m4]) |
| 9 | |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 10 | # Checks for programs |
| 11 | AC_PROG_CXX |
| 12 | AC_PROG_INSTALL #Checks/sets the install variable to be used |
| 13 | AC_PROG_MAKE_SET |
| 14 | |
| 15 | # Check for libraries |
Patrick Venture | 0d2f932 | 2019-02-13 15:15:28 -0800 | [diff] [blame] | 16 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
| 17 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
Brad Bishop | 0283f7c | 2020-11-09 10:09:26 -0500 | [diff] [blame] | 18 | PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus]) |
Patrick Venture | 0d2f932 | 2019-02-13 15:15:28 -0800 | [diff] [blame] | 19 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 20 | |
Brad Bishop | 099543e | 2020-11-09 15:37:58 -0500 | [diff] [blame] | 21 | # Check for headers |
| 22 | AC_CHECK_HEADERS([CLI/CLI.hpp], [], [AC_MSG_ERROR([CLI11 is required and was not found])]) |
| 23 | |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 24 | # Checks for library functions |
| 25 | LT_INIT # Required for systemd linking |
| 26 | |
Lei YU | 7d832d7 | 2019-03-14 13:58:07 +0800 | [diff] [blame] | 27 | PKG_PROG_PKG_CONFIG |
| 28 | AC_ARG_WITH([systemdsystemunitdir], |
| 29 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, |
| 30 | [with_systemdsystemunitdir=auto]) |
| 31 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ |
| 32 | def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 33 | |
| 34 | AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 35 | [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 36 | [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) |
| 37 | with_systemdsystemunitdir=no], |
| 38 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 39 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 40 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) |
| 41 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) |
| 42 | |
Gunnar Mills | 1ea62e1 | 2017-03-27 21:49:16 -0500 | [diff] [blame] | 43 | # Check/set gtest specific functions. |
| 44 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 45 | AC_SUBST(GTEST_CPPFLAGS) |
| 46 | AC_ARG_ENABLE([oe-sdk], |
| 47 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 48 | ) |
| 49 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 50 | [Path to the OE SDK SYSROOT]) |
| 51 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 52 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 53 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 54 | ) |
| 55 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 56 | [ |
| 57 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 58 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 59 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 60 | ] |
| 61 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 62 | ) |
| 63 | |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 64 | # Checks for typedefs, structures, and compiler characteristics. |
Adriana Kobylak | 139604e | 2018-09-24 13:21:12 -0500 | [diff] [blame] | 65 | AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 66 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 67 | |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 68 | AC_ARG_VAR(SOFTWARE_OBJPATH, [The software manager Dbus root]) |
| 69 | AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"]) |
| 70 | AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The software manager Dbus root]) |
| 71 | |
Gunnar Mills | fe07536 | 2017-08-30 13:06:30 -0500 | [diff] [blame] | 72 | AC_DEFINE(ACTIVATION_FWD_ASSOCIATION, "inventory", [The name of the activation's forward association.]) |
| 73 | AC_DEFINE(ACTIVATION_REV_ASSOCIATION, "activation", [The name of the activation's reverse association.]) |
Gunnar Mills | 3edb84b | 2017-08-18 15:13:15 -0500 | [diff] [blame] | 74 | AC_DEFINE(HOST_INVENTORY_PATH, "/xyz/openbmc_project/inventory/system/chassis", [The host inventory path.]) |
| 75 | |
Gunnar Mills | 9741cd1 | 2017-08-28 15:09:00 -0500 | [diff] [blame] | 76 | AC_DEFINE(ACTIVE_FWD_ASSOCIATION, "active", [The name of the active's forward association.]) |
| 77 | AC_DEFINE(ACTIVE_REV_ASSOCIATION, "software_version", [The name of the active's reverse association.]) |
| 78 | |
Adriana Kobylak | 3c81037 | 2020-07-15 16:47:03 -0500 | [diff] [blame] | 79 | AC_DEFINE(UPDATEABLE_FWD_ASSOCIATION, "updateable", [The name of the updateable forward association.]) |
| 80 | AC_DEFINE(UPDATEABLE_REV_ASSOCIATION, "software_version", [The updateable reverse association.]) |
| 81 | |
Gunnar Mills | 833e4f3 | 2017-09-14 12:30:27 -0500 | [diff] [blame] | 82 | AC_DEFINE(FUNCTIONAL_FWD_ASSOCIATION, "functional", [The name of the functional forward association.]) |
Adriana Kobylak | cb27317 | 2018-05-02 11:13:25 -0500 | [diff] [blame] | 83 | AC_DEFINE(FUNCTIONAL_REV_ASSOCIATION, "software_version", [The functional reverse association.]) |
Gunnar Mills | 833e4f3 | 2017-09-14 12:30:27 -0500 | [diff] [blame] | 84 | |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 85 | AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version", |
| 86 | [The software version manager interface]) |
Adriana Kobylak | 5ba6b10 | 2017-05-19 09:41:27 -0500 | [diff] [blame] | 87 | AC_DEFINE(FILEPATH_IFACE, "xyz.openbmc_project.Common.FilePath", |
| 88 | [The common file path interface]) |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 89 | |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 90 | AC_DEFINE(BUSNAME_UPDATER, "org.open_power.Software.Host.Updater", |
| 91 | [The item updater DBus busname to own.]) |
| 92 | |
Jayanth Othayoth | 4016e52 | 2018-03-20 09:39:06 -0500 | [diff] [blame] | 93 | AC_ARG_VAR(IMG_DIR, [Directory where downloaded or uploaded software images are placed and extracted]) |
| 94 | AS_IF([test "x$IMG_DIR" == "x"], [IMG_DIR="/tmp/images"]) |
| 95 | AC_DEFINE_UNQUOTED([IMG_DIR], ["$IMG_DIR"], [Directory where downloaded or uploaded software images are placed and extracted]) |
| 96 | |
Saqib Khan | 77420d2 | 2017-04-04 11:07:07 -0500 | [diff] [blame] | 97 | AC_ARG_VAR(MANIFEST_FILE, [The path to the MANIFEST file]) |
Adriana Kobylak | 5ba6b10 | 2017-05-19 09:41:27 -0500 | [diff] [blame] | 98 | AS_IF([test "x$MANIFEST_FILE" == "x"], [MANIFEST_FILE="MANIFEST"]) |
Saqib Khan | 77420d2 | 2017-04-04 11:07:07 -0500 | [diff] [blame] | 99 | AC_DEFINE_UNQUOTED([MANIFEST_FILE], ["$MANIFEST_FILE"], [The path to the MANIFEST file]) |
Gunnar Mills | 44c7729 | 2017-03-20 15:02:27 -0500 | [diff] [blame] | 100 | |
Jayanth Othayoth | 70804dc | 2018-03-20 06:31:59 -0500 | [diff] [blame] | 101 | AC_ARG_VAR(PUBLICKEY_FILE_NAME, [The name of the public key file]) |
| 102 | AS_IF([test "x$PUBLICKEY_FILE_NAME" == "x"], [PUBLICKEY_FILE_NAME="publickey"]) |
| 103 | AC_DEFINE_UNQUOTED([PUBLICKEY_FILE_NAME], ["$PUBLICKEY_FILE_NAME"], [The name of the public key file]) |
| 104 | |
| 105 | AC_ARG_VAR(HASH_FILE_NAME, [Hash file name]) |
| 106 | AS_IF([test "x$HASH_FILE_NAME" == "x"], [HASH_FILE_NAME="hashfunc"]) |
| 107 | AC_DEFINE_UNQUOTED([HASH_FILE_NAME], ["$HASH_FILE_NAME"], [The name of the hash file]) |
| 108 | |
| 109 | AC_ARG_VAR(PNOR_SIGNED_IMAGE_CONF_PATH, [Path of PNOR image public key and hash function files]) |
| 110 | AS_IF([test "x$PNOR_SIGNED_IMAGE_CONF_PATH" == "x"], [PNOR_SIGNED_IMAGE_CONF_PATH="/etc/activationdata/"]) |
| 111 | AC_DEFINE_UNQUOTED([PNOR_SIGNED_IMAGE_CONF_PATH], ["$PNOR_SIGNED_IMAGE_CONF_PATH"], [Path of PNOR image public key and hash function files]) |
| 112 | |
| 113 | AC_ARG_VAR(SIGNATURE_FILE_EXT, [The extension of the Signature file]) |
| 114 | AS_IF([test "x$SIGNATURE_FILE_EXT" == "x"], [SIGNATURE_FILE_EXT=".sig"]) |
| 115 | AC_DEFINE_UNQUOTED([SIGNATURE_FILE_EXT], ["$SIGNATURE_FILE_EXT"], [The extension of the Signature file]) |
| 116 | |
| 117 | # setup signature verification |
Adriana Kobylak | 207469f | 2018-04-17 10:35:26 -0500 | [diff] [blame] | 118 | AC_ARG_ENABLE([verify_pnor_signature], |
| 119 | AS_HELP_STRING([--enable-verify_pnor_signature], [Enable image signature validation.])) |
| 120 | AS_IF([test "x$enable_verify_pnor_signature" == "xyes"], \ |
Jayanth Othayoth | 70804dc | 2018-03-20 06:31:59 -0500 | [diff] [blame] | 121 | [AC_DEFINE([WANT_SIGNATURE_VERIFY],[],[Enable image signature validation.])]) |
Adriana Kobylak | 207469f | 2018-04-17 10:35:26 -0500 | [diff] [blame] | 122 | AM_CONDITIONAL([WANT_SIGNATURE_VERIFY_BUILD], [test "x$enable_verify_pnor_signature" == "xyes"]) |
Jayanth Othayoth | 70804dc | 2018-03-20 06:31:59 -0500 | [diff] [blame] | 123 | |
Adriana Kobylak | f3dfe65 | 2019-10-08 11:35:55 -0500 | [diff] [blame] | 124 | # setup virtual pnor support |
| 125 | AC_ARG_ENABLE([virtual-pnor], |
| 126 | AS_HELP_STRING([--enable-virtual-pnor], [Enable support for virtual pnor]) |
| 127 | ) |
| 128 | AM_CONDITIONAL([VIRTUAL_PNOR_ENABLED], [test "x$enable_virtual_pnor" == "xyes"]) |
| 129 | |
Michael Tritz | 5b75651 | 2017-10-06 16:52:01 -0500 | [diff] [blame] | 130 | AC_DEFINE(CHASSIS_STATE_PATH, "/xyz/openbmc_project/state/chassis0", |
| 131 | [The chassis state path.]) |
| 132 | AC_DEFINE(CHASSIS_STATE_OBJ, "xyz.openbmc_project.State.Chassis", |
| 133 | [The chassis state interface.]) |
| 134 | AC_DEFINE(CHASSIS_STATE_OFF, "xyz.openbmc_project.State.Chassis.PowerState.Off", |
| 135 | [The chassis state off property value.]) |
| 136 | |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 137 | AC_DEFINE(MAPPER_BUSNAME, "xyz.openbmc_project.ObjectMapper", |
| 138 | [The object mapper busname.]) |
| 139 | AC_DEFINE(MAPPER_PATH, "/xyz/openbmc_project/object_mapper", |
| 140 | [The object mapper path.]) |
| 141 | AC_DEFINE(MAPPER_INTERFACE, "xyz.openbmc_project.ObjectMapper", |
| 142 | [The object mapper interface.]) |
| 143 | |
Adriana Kobylak | 692b555 | 2017-04-17 14:02:58 -0500 | [diff] [blame] | 144 | AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", |
| 145 | [systemd busname.]) |
| 146 | AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", |
| 147 | [systemd path.]) |
| 148 | AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", |
| 149 | [systemd interface.]) |
Michael Tritz | 5b75651 | 2017-10-06 16:52:01 -0500 | [diff] [blame] | 150 | AC_DEFINE(SYSTEMD_PROPERTY_INTERFACE, "org.freedesktop.DBus.Properties", |
| 151 | [systemd properties interface.]) |
John Wang | d05d472 | 2019-09-11 15:18:15 +0800 | [diff] [blame] | 152 | AC_DEFINE(ASSOCIATIONS_INTERFACE, "xyz.openbmc_project.Association.Definitions", |
Adriana Kobylak | ea4e6ae | 2018-10-30 12:17:31 -0500 | [diff] [blame] | 153 | [The associations interface.]) |
Adriana Kobylak | 692b555 | 2017-04-17 14:02:58 -0500 | [diff] [blame] | 154 | |
Adriana Kobylak | 55f9e83 | 2017-05-14 16:13:00 -0500 | [diff] [blame] | 155 | AC_DEFINE(PNOR_TOC_FILE, "pnor.toc", |
| 156 | [The name of the PNOR table of contents file]) |
Saqib Khan | 4c5d744 | 2017-07-18 00:43:52 -0500 | [diff] [blame] | 157 | AC_DEFINE(MEDIA_DIR, "/media/", |
| 158 | [The base dir where all PNOR RO AND RW partitions are mounted]) |
Michael Tritz | 60bc20f | 2017-07-29 23:32:21 -0500 | [diff] [blame] | 159 | AC_DEFINE(PERSIST_DIR, "/var/lib/obmc/openpower-pnor-code-mgmt/", |
| 160 | [The dir where activation data is stored in files]) |
Adriana Kobylak | 55f9e83 | 2017-05-14 16:13:00 -0500 | [diff] [blame] | 161 | AC_DEFINE(PNOR_RO_PREFIX, "/media/pnor-ro-", |
| 162 | [The prefix path for the versioned read-only pnor partitions]) |
| 163 | AC_DEFINE(PNOR_RW_PREFIX, "/media/pnor-rw-", |
| 164 | [The prefix path for the versioned read-write pnor partitions]) |
| 165 | AC_DEFINE(PNOR_PRSV, "/media/pnor-prsv", |
| 166 | [The path for the preserved pnor partitions]) |
| 167 | AC_DEFINE(PNOR_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/", |
| 168 | [Path to the active pnor partitions]) |
| 169 | AC_DEFINE(PNOR_RO_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/ro", |
| 170 | [Path to the active read-only pnor partitions]) |
| 171 | AC_DEFINE(PNOR_RW_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/rw", |
| 172 | [Path to the active read-write pnor partitions]) |
| 173 | AC_DEFINE(PNOR_PRSV_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/prsv", |
| 174 | [Path to the active preserved pnor partitions]) |
| 175 | |
Lei YU | f3ce433 | 2019-02-21 14:09:49 +0800 | [diff] [blame] | 176 | # Setup ubifs layout support |
Lei YU | f3ce433 | 2019-02-21 14:09:49 +0800 | [diff] [blame] | 177 | AC_ARG_ENABLE([ubifs_layout], |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 178 | AS_HELP_STRING([--enable-ubifs_layout], [Enable ubifs support.])) |
| 179 | AS_IF([test "x$enable_ubifs_layout" == "xyes"], \ |
Lei YU | f3ce433 | 2019-02-21 14:09:49 +0800 | [diff] [blame] | 180 | [AC_DEFINE([UBIFS_LAYOUT],[],[Enable ubifs support.])]) |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 181 | AM_CONDITIONAL([UBIFS_LAYOUT], [test "x$enable_ubifs_layout" == "xyes"]) |
| 182 | |
| 183 | # Setup MMC layout support |
| 184 | AC_ARG_ENABLE([mmc_layout], |
| 185 | AS_HELP_STRING([--enable-mmc_layout], [Enable MMC support.])) |
| 186 | AS_IF([test "x$enable_mmc_layout" == "xyes"], \ |
| 187 | [AC_DEFINE([MMC_LAYOUT],[],[Enable MMC support.])]) |
| 188 | AM_CONDITIONAL([MMC_LAYOUT], [test "x$enable_mmc_layout" == "xyes"]) |
| 189 | |
| 190 | # Setup static layout support (default) |
| 191 | AS_IF([test "x$enable_ubifs_layout" != "xyes" -a "x$enable_mmc_layout" != "xyes"], \ |
| 192 | [AC_DEFINE([STATIC_LAYOUT],[],[Enable static layout support.])]) |
| 193 | AM_CONDITIONAL([STATIC_LAYOUT], [test "x$enable_ubifs_layout" != "xyes" -a "x$enable_mmc_layout" != "xyes"]) |
Lei YU | f3ce433 | 2019-02-21 14:09:49 +0800 | [diff] [blame] | 194 | |
Saqib Khan | 2cbfa03 | 2017-08-17 14:52:37 -0500 | [diff] [blame] | 195 | AC_ARG_VAR(ACTIVE_PNOR_MAX_ALLOWED, [The maximum allowed active pnor versions]) |
| 196 | AS_IF([test "x$ACTIVE_PNOR_MAX_ALLOWED" == "x"], [ACTIVE_PNOR_MAX_ALLOWED=2]) |
| 197 | AC_DEFINE_UNQUOTED([ACTIVE_PNOR_MAX_ALLOWED], [$ACTIVE_PNOR_MAX_ALLOWED], [The maximum allowed active pnor versions]) |
| 198 | |
Adriana Kobylak | 4772a94 | 2018-10-09 15:26:44 -0500 | [diff] [blame] | 199 | AC_ARG_VAR(PNOR_MSL, [The PNOR minimum ship level]) |
| 200 | AS_IF([test "x$PNOR_MSL" == "x"], [PNOR_MSL=""]) |
| 201 | AC_DEFINE_UNQUOTED([PNOR_MSL], ["$PNOR_MSL"], [The PNOR minimum ship level]) |
| 202 | |
| 203 | AC_ARG_VAR(PNOR_VERSION_PARTITION, [The name of the PNOR version partition]) |
| 204 | AS_IF([test "x$PNOR_VERSION_PARTITION" == "x"], [PNOR_VERSION_PARTITION="VERSION"]) |
| 205 | AC_DEFINE_UNQUOTED([PNOR_VERSION_PARTITION], ["$PNOR_VERSION_PARTITION"], |
| 206 | [The name of the PNOR version partition]) |
| 207 | |
Gunnar Mills | 1ea62e1 | 2017-03-27 21:49:16 -0500 | [diff] [blame] | 208 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 209 | AC_OUTPUT |