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 |
| 16 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ |
| 17 | AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
| 18 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, |
| 19 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
Gunnar Mills | 44c7729 | 2017-03-20 15:02:27 -0500 | [diff] [blame] | 20 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, |
| 21 | [AC_MSG_ERROR([The openbmc/phosphor-logging package is required])]) |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 22 | |
Saqib Khan | c350c61 | 2017-08-13 13:36:44 -0500 | [diff] [blame] | 23 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 24 | |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 25 | # Checks for library functions |
| 26 | LT_INIT # Required for systemd linking |
| 27 | |
Gunnar Mills | 1ea62e1 | 2017-03-27 21:49:16 -0500 | [diff] [blame] | 28 | # Check/set gtest specific functions. |
| 29 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 30 | AC_SUBST(GTEST_CPPFLAGS) |
| 31 | AC_ARG_ENABLE([oe-sdk], |
| 32 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 33 | ) |
| 34 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 35 | [Path to the OE SDK SYSROOT]) |
| 36 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 37 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 38 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 39 | ) |
| 40 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 41 | [ |
| 42 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 43 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 44 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 45 | ] |
| 46 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 47 | ) |
| 48 | |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 49 | # Checks for typedefs, structures, and compiler characteristics. |
| 50 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 51 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 52 | |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 53 | AC_ARG_VAR(SOFTWARE_OBJPATH, [The software manager Dbus root]) |
| 54 | AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"]) |
| 55 | AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The software manager Dbus root]) |
| 56 | |
Gunnar Mills | fe07536 | 2017-08-30 13:06:30 -0500 | [diff] [blame] | 57 | AC_DEFINE(ACTIVATION_FWD_ASSOCIATION, "inventory", [The name of the activation's forward association.]) |
| 58 | 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] | 59 | AC_DEFINE(HOST_INVENTORY_PATH, "/xyz/openbmc_project/inventory/system/chassis", [The host inventory path.]) |
| 60 | |
Gunnar Mills | 9741cd1 | 2017-08-28 15:09:00 -0500 | [diff] [blame] | 61 | AC_DEFINE(ACTIVE_FWD_ASSOCIATION, "active", [The name of the active's forward association.]) |
| 62 | AC_DEFINE(ACTIVE_REV_ASSOCIATION, "software_version", [The name of the active's reverse association.]) |
| 63 | |
Gunnar Mills | 833e4f3 | 2017-09-14 12:30:27 -0500 | [diff] [blame] | 64 | AC_DEFINE(FUNCTIONAL_FWD_ASSOCIATION, "functional", [The name of the functional forward association.]) |
| 65 | AC_DEFINE(FUNCTIONAL_REV_ASSOCIATION, "software_version", [The functional reverse association.]) |
| 66 | |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 67 | AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version", |
| 68 | [The software version manager interface]) |
Adriana Kobylak | 5ba6b10 | 2017-05-19 09:41:27 -0500 | [diff] [blame] | 69 | AC_DEFINE(FILEPATH_IFACE, "xyz.openbmc_project.Common.FilePath", |
| 70 | [The common file path interface]) |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 71 | |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 72 | AC_DEFINE(BUSNAME_UPDATER, "org.open_power.Software.Host.Updater", |
| 73 | [The item updater DBus busname to own.]) |
| 74 | |
Saqib Khan | 77420d2 | 2017-04-04 11:07:07 -0500 | [diff] [blame] | 75 | AC_ARG_VAR(MANIFEST_FILE, [The path to the MANIFEST file]) |
Adriana Kobylak | 5ba6b10 | 2017-05-19 09:41:27 -0500 | [diff] [blame] | 76 | AS_IF([test "x$MANIFEST_FILE" == "x"], [MANIFEST_FILE="MANIFEST"]) |
Saqib Khan | 77420d2 | 2017-04-04 11:07:07 -0500 | [diff] [blame] | 77 | 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] | 78 | |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 79 | AC_DEFINE(MAPPER_BUSNAME, "xyz.openbmc_project.ObjectMapper", |
| 80 | [The object mapper busname.]) |
| 81 | AC_DEFINE(MAPPER_PATH, "/xyz/openbmc_project/object_mapper", |
| 82 | [The object mapper path.]) |
| 83 | AC_DEFINE(MAPPER_INTERFACE, "xyz.openbmc_project.ObjectMapper", |
| 84 | [The object mapper interface.]) |
| 85 | |
Adriana Kobylak | 692b555 | 2017-04-17 14:02:58 -0500 | [diff] [blame] | 86 | AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", |
| 87 | [systemd busname.]) |
| 88 | AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", |
| 89 | [systemd path.]) |
| 90 | AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", |
| 91 | [systemd interface.]) |
| 92 | |
Adriana Kobylak | 55f9e83 | 2017-05-14 16:13:00 -0500 | [diff] [blame] | 93 | AC_DEFINE(PNOR_TOC_FILE, "pnor.toc", |
| 94 | [The name of the PNOR table of contents file]) |
Saqib Khan | 4c5d744 | 2017-07-18 00:43:52 -0500 | [diff] [blame] | 95 | AC_DEFINE(MEDIA_DIR, "/media/", |
| 96 | [The base dir where all PNOR RO AND RW partitions are mounted]) |
Michael Tritz | 60bc20f | 2017-07-29 23:32:21 -0500 | [diff] [blame] | 97 | AC_DEFINE(PERSIST_DIR, "/var/lib/obmc/openpower-pnor-code-mgmt/", |
| 98 | [The dir where activation data is stored in files]) |
Adriana Kobylak | 55f9e83 | 2017-05-14 16:13:00 -0500 | [diff] [blame] | 99 | AC_DEFINE(PNOR_RO_PREFIX, "/media/pnor-ro-", |
| 100 | [The prefix path for the versioned read-only pnor partitions]) |
| 101 | AC_DEFINE(PNOR_RW_PREFIX, "/media/pnor-rw-", |
| 102 | [The prefix path for the versioned read-write pnor partitions]) |
| 103 | AC_DEFINE(PNOR_PRSV, "/media/pnor-prsv", |
| 104 | [The path for the preserved pnor partitions]) |
| 105 | AC_DEFINE(PNOR_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/", |
| 106 | [Path to the active pnor partitions]) |
| 107 | AC_DEFINE(PNOR_RO_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/ro", |
| 108 | [Path to the active read-only pnor partitions]) |
| 109 | AC_DEFINE(PNOR_RW_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/rw", |
| 110 | [Path to the active read-write pnor partitions]) |
| 111 | AC_DEFINE(PNOR_PRSV_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/prsv", |
| 112 | [Path to the active preserved pnor partitions]) |
| 113 | |
Saqib Khan | 2cbfa03 | 2017-08-17 14:52:37 -0500 | [diff] [blame] | 114 | AC_ARG_VAR(ACTIVE_PNOR_MAX_ALLOWED, [The maximum allowed active pnor versions]) |
| 115 | AS_IF([test "x$ACTIVE_PNOR_MAX_ALLOWED" == "x"], [ACTIVE_PNOR_MAX_ALLOWED=2]) |
| 116 | AC_DEFINE_UNQUOTED([ACTIVE_PNOR_MAX_ALLOWED], [$ACTIVE_PNOR_MAX_ALLOWED], [The maximum allowed active pnor versions]) |
| 117 | |
Gunnar Mills | 1ea62e1 | 2017-03-27 21:49:16 -0500 | [diff] [blame] | 118 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 119 | AC_OUTPUT |