Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
| 2 | AC_INIT([phosphor-bmc-code-mgmt], [1.0], [https://github.com/openbmc/phosphor-bmc-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 | |
| 8 | # Checks for programs |
| 9 | AC_PROG_CXX |
| 10 | AC_PROG_INSTALL #Checks/sets the install variable to be used |
| 11 | AC_PROG_MAKE_SET |
| 12 | |
| 13 | # Check for libraries |
| 14 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
Patrick Venture | efd8e91 | 2019-02-13 15:26:00 -0800 | [diff] [blame] | 15 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
| 16 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
| 17 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
Gunnar Mills | 93c12d3 | 2017-05-10 13:11:53 -0500 | [diff] [blame] | 18 | # Check for sdbus++ |
| 19 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 20 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 21 | AC_MSG_ERROR(["Requires sdbus++"])) |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 22 | |
| 23 | # Checks for library functions |
| 24 | LT_INIT # Required for systemd linking |
| 25 | |
Adriana Kobylak | a8eb781 | 2019-04-23 14:48:58 -0500 | [diff] [blame] | 26 | PKG_PROG_PKG_CONFIG |
| 27 | AC_ARG_WITH([systemdsystemunitdir], |
| 28 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])], |
| 29 | [], |
| 30 | [with_systemdsystemunitdir=auto] |
| 31 | ) |
| 32 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], |
| 33 | [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 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 | ) |
| 38 | with_systemdsystemunitdir=no], |
| 39 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"] |
| 40 | )] |
| 41 | ) |
| 42 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 43 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])] |
| 44 | ) |
| 45 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) |
| 46 | |
Gunnar Mills | 01d55c3 | 2017-04-20 10:52:15 -0500 | [diff] [blame] | 47 | # Check/set gtest specific functions. |
| 48 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 49 | AC_SUBST(GTEST_CPPFLAGS) |
| 50 | AC_ARG_ENABLE([oe-sdk], |
| 51 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 52 | ) |
| 53 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 54 | [Path to the OE SDK SYSROOT]) |
| 55 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 56 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 57 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 58 | ) |
| 59 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 60 | [ |
| 61 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 62 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 63 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 64 | ] |
| 65 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 66 | ) |
| 67 | |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 68 | # Checks for typedefs, structures, and compiler characteristics. |
Adriana Kobylak | 71f6e73 | 2018-09-24 13:13:03 -0500 | [diff] [blame] | 69 | AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 70 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 71 | |
Gunnar Mills | 1646e8f | 2017-08-30 13:02:40 -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.]) |
Adriana Kobylak | 1254c62 | 2017-12-07 12:24:56 -0600 | [diff] [blame] | 74 | AC_DEFINE(INVENTORY_PATH, "/xyz/openbmc_project/inventory/", |
| 75 | [The inventory path root.]) |
| 76 | AC_DEFINE(BMC_INVENTORY_INTERFACE, "xyz.openbmc_project.Inventory.Item.Bmc", |
| 77 | [The BMC inventory interface]) |
Gunnar Mills | b60add1 | 2017-08-24 16:41:42 -0500 | [diff] [blame] | 78 | |
Gunnar Mills | ded875d | 2017-08-28 16:44:52 -0500 | [diff] [blame] | 79 | AC_DEFINE(ACTIVE_FWD_ASSOCIATION, "active", [The name of the active's forward association.]) |
| 80 | AC_DEFINE(ACTIVE_REV_ASSOCIATION, "software_version", [The name of the active's reverse association.]) |
| 81 | |
Gunnar Mills | 88e8a32 | 2017-09-13 11:09:28 -0500 | [diff] [blame] | 82 | AC_DEFINE(FUNCTIONAL_FWD_ASSOCIATION, "functional", [The name of the functional forward association.]) |
Adriana Kobylak | 6097e04 | 2018-05-02 10:47:03 -0500 | [diff] [blame] | 83 | AC_DEFINE(FUNCTIONAL_REV_ASSOCIATION, "software_version", [The functional reverse association.]) |
Gunnar Mills | 88e8a32 | 2017-09-13 11:09:28 -0500 | [diff] [blame] | 84 | |
AppaRao Puli | bbebec7 | 2020-01-28 23:57:41 +0530 | [diff] [blame] | 85 | AC_DEFINE(UPDATEABLE_FWD_ASSOCIATION, "updateable", [The name of the updateable forward association.]) |
| 86 | AC_DEFINE(UPDATEABLE_REV_ASSOCIATION, "software_version", [The updateable reverse association.]) |
| 87 | |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 88 | AC_ARG_VAR(VERSION_BUSNAME, [The Dbus busname to own]) |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 89 | AS_IF([test "x$VERSION_BUSNAME" == "x"], [VERSION_BUSNAME="xyz.openbmc_project.Software.Version"]) |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 90 | AC_DEFINE_UNQUOTED([VERSION_BUSNAME], ["$VERSION_BUSNAME"], [The DBus busname to own]) |
| 91 | |
| 92 | AC_ARG_VAR(SOFTWARE_OBJPATH, [The version software manager Dbus root]) |
| 93 | AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"]) |
| 94 | AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The version software manager Dbus root]) |
| 95 | |
Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 96 | AC_ARG_VAR(DOWNLOAD_BUSNAME, [The Dbus busname to own]) |
| 97 | AS_IF([test "x$DOWNLOAD_BUSNAME" == "x"], |
| 98 | [DOWNLOAD_BUSNAME="xyz.openbmc_project.Software.Download"]) |
| 99 | AC_DEFINE_UNQUOTED([DOWNLOAD_BUSNAME], ["$DOWNLOAD_BUSNAME"], [The DBus busname to own]) |
| 100 | |
Gunnar Mills | b60add1 | 2017-08-24 16:41:42 -0500 | [diff] [blame] | 101 | AC_DEFINE([MAPPER_BUSNAME], ["xyz.openbmc_project.ObjectMapper"], [Object mapper bus name]) |
| 102 | AC_DEFINE([MAPPER_INTERFACE], ["xyz.openbmc_project.ObjectMapper"], [Object mapper interface]) |
| 103 | AC_DEFINE([MAPPER_PATH], ["/xyz/openbmc_project/object_mapper"], [Object mapper DBUS path]) |
| 104 | |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 105 | AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version", |
| 106 | [The software version manager interface]) |
Saqib Khan | 19177d3 | 2017-06-20 08:11:49 -0500 | [diff] [blame] | 107 | AC_DEFINE(FILEPATH_IFACE, "xyz.openbmc_project.Common.FilePath", |
| 108 | [The common file path interface]) |
Saqib Khan | 1eef62d | 2017-08-10 15:29:34 -0500 | [diff] [blame] | 109 | AC_DEFINE(OS_RELEASE_FILE, "/etc/os-release", |
| 110 | [The name of the BMC table of contents file]) |
Adriana Kobylak | a907434 | 2018-05-08 11:52:44 -0500 | [diff] [blame] | 111 | AC_DEFINE(ALT_RWFS, "/media/alt/var/persist", |
| 112 | [The path of the alt rwfs overlay]) |
Adriana Kobylak | 687e75e | 2019-11-07 11:23:25 -0600 | [diff] [blame] | 113 | AC_DEFINE(PERSIST_DIR, "/var/lib/phosphor-bmc-code-mgmt/", |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 114 | [The dir where activation data is stored in files]) |
Michael Tritz | f2b5e0d | 2017-07-25 14:39:34 -0500 | [diff] [blame] | 115 | AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", |
| 116 | [The systemd busname]) |
| 117 | AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", |
| 118 | [The systemd path]) |
| 119 | AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", |
| 120 | [The systemd interface]) |
| 121 | |
Lei YU | 269bff3 | 2018-08-21 15:21:40 +0800 | [diff] [blame] | 122 | AC_ARG_VAR(MEDIA_DIR, [The base dir where all RO partitions are mounted]) |
Adriana Kobylak | 97d4546 | 2020-05-06 12:32:44 -0500 | [diff] [blame] | 123 | AS_IF([test "x$MEDIA_DIR" == "x"], [MEDIA_DIR="/run/media"]) |
Lei YU | 269bff3 | 2018-08-21 15:21:40 +0800 | [diff] [blame] | 124 | AC_DEFINE_UNQUOTED([MEDIA_DIR], ["$MEDIA_DIR"], [The base dir where all RO partitions are mounted]) |
| 125 | |
| 126 | AC_DEFINE_UNQUOTED(BMC_ROFS_PREFIX, "$MEDIA_DIR/rofs-", |
| 127 | [The prefix path for the versioned read-only bmc partitions]) |
| 128 | |
Deepak Kodihalli | 059e233 | 2017-04-12 06:40:53 -0500 | [diff] [blame] | 129 | AC_ARG_VAR(IMG_UPLOAD_DIR, [Directory where downloaded software images are placed]) |
| 130 | AS_IF([test "x$IMG_UPLOAD_DIR" == "x"], [IMG_UPLOAD_DIR="/tmp/images"]) |
| 131 | AC_DEFINE_UNQUOTED([IMG_UPLOAD_DIR], ["$IMG_UPLOAD_DIR"], [Directory where downloaded software images are placed]) |
| 132 | |
Adriana Kobylak | b072d1b | 2018-04-24 11:37:21 -0500 | [diff] [blame] | 133 | AC_ARG_VAR(SYNC_LIST_FILE_NAME, [The name of the sync list file]) |
| 134 | AS_IF([test "x$SYNC_LIST_FILE_NAME" == "x"], [SYNC_LIST_FILE_NAME="synclist"]) |
| 135 | AC_DEFINE_UNQUOTED([SYNC_LIST_FILE_NAME], ["$SYNC_LIST_FILE_NAME"], [The name of the sync list file]) |
| 136 | |
| 137 | AC_ARG_VAR(SYNC_LIST_DIR_PATH, [The path to the sync list file directory]) |
| 138 | AS_IF([test "x$SYNC_LIST_DIR_PATH" == "x"], [SYNC_LIST_DIR_PATH="/etc/"]) |
| 139 | AC_DEFINE_UNQUOTED([SYNC_LIST_DIR_PATH], ["$SYNC_LIST_DIR_PATH"], [The path to the sync list file directory]) |
| 140 | |
Gunnar Mills | 19e4ce5 | 2017-04-27 11:24:19 -0500 | [diff] [blame] | 141 | AC_ARG_VAR(MANIFEST_FILE_NAME, [The name of the MANIFEST file]) |
| 142 | AS_IF([test "x$MANIFEST_FILE_NAME" == "x"], [MANIFEST_FILE_NAME="MANIFEST"]) |
| 143 | AC_DEFINE_UNQUOTED([MANIFEST_FILE_NAME], ["$MANIFEST_FILE_NAME"], [The name of the MANIFEST file]) |
| 144 | |
Jayanth Othayoth | 2ab9b10 | 2018-02-21 05:27:47 -0600 | [diff] [blame] | 145 | AC_ARG_VAR(PUBLICKEY_FILE_NAME, [The name of the public key file]) |
| 146 | AS_IF([test "x$PUBLICKEY_FILE_NAME" == "x"], [PUBLICKEY_FILE_NAME="publickey"]) |
| 147 | AC_DEFINE_UNQUOTED([PUBLICKEY_FILE_NAME], ["$PUBLICKEY_FILE_NAME"], [The name of the public key file]) |
| 148 | |
| 149 | AC_ARG_VAR(HASH_FILE_NAME, [Hash file name]) |
| 150 | AS_IF([test "x$HASH_FILE_NAME" == "x"], [HASH_FILE_NAME="hashfunc"]) |
| 151 | AC_DEFINE_UNQUOTED([HASH_FILE_NAME], ["$HASH_FILE_NAME"], [The name of the hash file]) |
| 152 | |
| 153 | AC_ARG_VAR(SIGNED_IMAGE_CONF_PATH, [Path of public key and hash function files]) |
| 154 | AS_IF([test "x$SIGNED_IMAGE_CONF_PATH" == "x"], [SIGNED_IMAGE_CONF_PATH="/etc/activationdata/"]) |
| 155 | AC_DEFINE_UNQUOTED([SIGNED_IMAGE_CONF_PATH], ["$SIGNED_IMAGE_CONF_PATH"], [Path of public key and hash function files]) |
| 156 | |
| 157 | AC_ARG_VAR(SIGNATURE_FILE_EXT, [The extension of the Signature file]) |
| 158 | AS_IF([test "x$SIGNATURE_FILE_EXT" == "x"], [SIGNATURE_FILE_EXT=".sig"]) |
| 159 | AC_DEFINE_UNQUOTED([SIGNATURE_FILE_EXT], ["$SIGNATURE_FILE_EXT"], [The extension of the Signature file]) |
| 160 | |
Adriana Kobylak | 204e1e7 | 2018-01-24 16:00:05 -0600 | [diff] [blame] | 161 | AC_ARG_VAR(ACTIVE_BMC_MAX_ALLOWED, [The maximum allowed active BMC versions]) |
Adriana Kobylak | 97d4546 | 2020-05-06 12:32:44 -0500 | [diff] [blame] | 162 | AS_IF([test "x$ACTIVE_BMC_MAX_ALLOWED" == "x"], [ACTIVE_BMC_MAX_ALLOWED=1]) |
Adriana Kobylak | 204e1e7 | 2018-01-24 16:00:05 -0600 | [diff] [blame] | 163 | AC_DEFINE_UNQUOTED([ACTIVE_BMC_MAX_ALLOWED], [$ACTIVE_BMC_MAX_ALLOWED], |
| 164 | [The maximum allowed active BMC versions]) |
| 165 | |
Jayanth Othayoth | 0e0c127 | 2018-02-21 05:46:36 -0600 | [diff] [blame] | 166 | # setup signature verification |
| 167 | AC_ARG_ENABLE([verify_signature], |
| 168 | AS_HELP_STRING([--enable-verify_signature], [Enable image signature validation.])) |
| 169 | AS_IF([test "x$enable_verify_signature" == "xyes"], \ |
| 170 | [AC_DEFINE([WANT_SIGNATURE_VERIFY],[],[Enable image signature validation.])]) |
| 171 | AM_CONDITIONAL([WANT_SIGNATURE_VERIFY_BUILD], [test "x$enable_verify_signature" == "xyes"]) |
| 172 | |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 173 | AC_DEFINE(BUSNAME_UPDATER, "xyz.openbmc_project.Software.BMC.Updater", |
| 174 | [The item updater DBus busname to own.]) |
| 175 | |
Adriana Kobylak | 7e8d76b | 2018-04-20 10:03:01 -0500 | [diff] [blame] | 176 | # setup sync of filesystem files |
| 177 | AC_ARG_ENABLE([sync_bmc_files], |
| 178 | AS_HELP_STRING([--enable-sync_bmc_files], [Enable sync of filesystem files.])) |
| 179 | AS_IF([test "x$enable_sync_bmc_files" == "xyes"], \ |
| 180 | [AC_DEFINE([WANT_SYNC],[],[Enable sync of filesystem files.])]) |
| 181 | AM_CONDITIONAL([WANT_SYNC], [test "x$enable_sync_bmc_files" == "xyes"]) |
| 182 | |
Lei YU | a7853ee | 2018-05-23 11:13:12 +0800 | [diff] [blame] | 183 | # setup ubifs layout support |
| 184 | AC_ARG_ENABLE([ubifs_layout], |
| 185 | AS_HELP_STRING([--enable-ubifs_layout], [Enable ubifs support.])) |
| 186 | AS_IF([test "x$enable_ubifs_layout" == "xyes"], \ |
| 187 | [AC_DEFINE([UBIFS_LAYOUT],[],[Enable ubifs support.])]) |
| 188 | AM_CONDITIONAL([UBIFS_LAYOUT], [test "x$enable_ubifs_layout" == "xyes"]) |
| 189 | |
Vijay Khemka | e9f6c84 | 2020-01-14 14:32:39 -0800 | [diff] [blame] | 190 | # setup host bios upgrade support |
| 191 | AC_ARG_ENABLE([host_bios_upgrade], |
| 192 | AS_HELP_STRING([--enable-host_bios_upgrade], [Enable host bios upgrade support.])) |
| 193 | AS_IF([test "x$enable_host_bios_upgrade" == "xyes"], \ |
| 194 | [AC_DEFINE([HOST_BIOS_UPGRADE],[],[Enable host bios upgrade support.])]) |
| 195 | AM_CONDITIONAL([HOST_BIOS_UPGRADE], [test "x$enable_host_bios_upgrade" == "xyes"]) |
| 196 | |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 197 | # Check for header files. |
Gunnar Mills | 7a248bc | 2017-10-25 13:51:07 -0500 | [diff] [blame] | 198 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 199 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])]) |
| 200 | |
Gunnar Mills | 01d55c3 | 2017-04-20 10:52:15 -0500 | [diff] [blame] | 201 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 202 | AC_OUTPUT |