blob: fd8a17d681448b17759652c153fe6390e2436dd1 [file] [log] [blame]
Gunnar Mills9df13162017-03-08 15:00:08 -06001AC_PREREQ([2.69])
2AC_INIT([openpower-pnor-code-mgmt], [1.0], [https://github.com/openbmc/openpower-pnor-code-mgmt/issues])
3AC_LANG([C++])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
7
Andrew Jeffery234ba8a2017-04-18 16:55:25 +09308AC_CONFIG_MACRO_DIRS([m4])
9
Gunnar Mills9df13162017-03-08 15:00:08 -060010# Checks for programs
11AC_PROG_CXX
12AC_PROG_INSTALL #Checks/sets the install variable to be used
13AC_PROG_MAKE_SET
14
15# Check for libraries
16PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
17 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
18PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
19 AC_MSG_ERROR(["Requires sdbusplus package."]))
Gunnar Mills44c77292017-03-20 15:02:27 -050020PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,
21 [AC_MSG_ERROR([The openbmc/phosphor-logging package is required])])
Gunnar Mills9df13162017-03-08 15:00:08 -060022
Saqib Khanc350c612017-08-13 13:36:44 -050023AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
24
Gunnar Mills9df13162017-03-08 15:00:08 -060025# Checks for library functions
26LT_INIT # Required for systemd linking
27
Gunnar Mills1ea62e12017-03-27 21:49:16 -050028# Check/set gtest specific functions.
29AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
30AC_SUBST(GTEST_CPPFLAGS)
31AC_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)
34AC_ARG_VAR(OECORE_TARGET_SYSROOT,
35 [Path to the OE SDK SYSROOT])
36AS_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 Mills9df13162017-03-08 15:00:08 -060049# Checks for typedefs, structures, and compiler characteristics.
50AX_CXX_COMPILE_STDCXX_14([noext])
51AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
52
Gunnar Mills9df13162017-03-08 15:00:08 -060053AC_ARG_VAR(SOFTWARE_OBJPATH, [The software manager Dbus root])
54AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"])
55AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The software manager Dbus root])
56
Gunnar Millsfe075362017-08-30 13:06:30 -050057AC_DEFINE(ACTIVATION_FWD_ASSOCIATION, "inventory", [The name of the activation's forward association.])
58AC_DEFINE(ACTIVATION_REV_ASSOCIATION, "activation", [The name of the activation's reverse association.])
Gunnar Mills3edb84b2017-08-18 15:13:15 -050059AC_DEFINE(HOST_INVENTORY_PATH, "/xyz/openbmc_project/inventory/system/chassis", [The host inventory path.])
60
Gunnar Mills9741cd12017-08-28 15:09:00 -050061AC_DEFINE(ACTIVE_FWD_ASSOCIATION, "active", [The name of the active's forward association.])
62AC_DEFINE(ACTIVE_REV_ASSOCIATION, "software_version", [The name of the active's reverse association.])
63
Gunnar Mills833e4f32017-09-14 12:30:27 -050064AC_DEFINE(FUNCTIONAL_FWD_ASSOCIATION, "functional", [The name of the functional forward association.])
Gunnar Millsee697122018-02-23 21:31:27 -060065AC_DEFINE(FUNCTIONAL_REV_ASSOCIATION, "functional", [The name of the functional reverse association.])
Gunnar Mills833e4f32017-09-14 12:30:27 -050066
Adriana Kobylakb66ac3a2017-03-28 13:33:20 -050067AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version",
68 [The software version manager interface])
Adriana Kobylak5ba6b102017-05-19 09:41:27 -050069AC_DEFINE(FILEPATH_IFACE, "xyz.openbmc_project.Common.FilePath",
70 [The common file path interface])
Adriana Kobylakb66ac3a2017-03-28 13:33:20 -050071
Adriana Kobylak2d8fa222017-03-15 12:34:32 -050072AC_DEFINE(BUSNAME_UPDATER, "org.open_power.Software.Host.Updater",
73 [The item updater DBus busname to own.])
74
Jayanth Othayoth4016e522018-03-20 09:39:06 -050075AC_ARG_VAR(IMG_DIR, [Directory where downloaded or uploaded software images are placed and extracted])
76AS_IF([test "x$IMG_DIR" == "x"], [IMG_DIR="/tmp/images"])
77AC_DEFINE_UNQUOTED([IMG_DIR], ["$IMG_DIR"], [Directory where downloaded or uploaded software images are placed and extracted])
78
Saqib Khan77420d22017-04-04 11:07:07 -050079AC_ARG_VAR(MANIFEST_FILE, [The path to the MANIFEST file])
Adriana Kobylak5ba6b102017-05-19 09:41:27 -050080AS_IF([test "x$MANIFEST_FILE" == "x"], [MANIFEST_FILE="MANIFEST"])
Saqib Khan77420d22017-04-04 11:07:07 -050081AC_DEFINE_UNQUOTED([MANIFEST_FILE], ["$MANIFEST_FILE"], [The path to the MANIFEST file])
Gunnar Mills44c77292017-03-20 15:02:27 -050082
Jayanth Othayoth70804dc2018-03-20 06:31:59 -050083AC_ARG_VAR(PUBLICKEY_FILE_NAME, [The name of the public key file])
84AS_IF([test "x$PUBLICKEY_FILE_NAME" == "x"], [PUBLICKEY_FILE_NAME="publickey"])
85AC_DEFINE_UNQUOTED([PUBLICKEY_FILE_NAME], ["$PUBLICKEY_FILE_NAME"], [The name of the public key file])
86
87AC_ARG_VAR(HASH_FILE_NAME, [Hash file name])
88AS_IF([test "x$HASH_FILE_NAME" == "x"], [HASH_FILE_NAME="hashfunc"])
89AC_DEFINE_UNQUOTED([HASH_FILE_NAME], ["$HASH_FILE_NAME"], [The name of the hash file])
90
91AC_ARG_VAR(PNOR_SIGNED_IMAGE_CONF_PATH, [Path of PNOR image public key and hash function files])
92AS_IF([test "x$PNOR_SIGNED_IMAGE_CONF_PATH" == "x"], [PNOR_SIGNED_IMAGE_CONF_PATH="/etc/activationdata/"])
93AC_DEFINE_UNQUOTED([PNOR_SIGNED_IMAGE_CONF_PATH], ["$PNOR_SIGNED_IMAGE_CONF_PATH"], [Path of PNOR image public key and hash function files])
94
95AC_ARG_VAR(SIGNATURE_FILE_EXT, [The extension of the Signature file])
96AS_IF([test "x$SIGNATURE_FILE_EXT" == "x"], [SIGNATURE_FILE_EXT=".sig"])
97AC_DEFINE_UNQUOTED([SIGNATURE_FILE_EXT], ["$SIGNATURE_FILE_EXT"], [The extension of the Signature file])
98
99# setup signature verification
100AC_ARG_ENABLE([verify_signature],
101 AS_HELP_STRING([--enable-verify_signature], [Enable image signature validation.]))
102AS_IF([test "x$enable_verify_signature" == "xyes"], \
103 [AC_DEFINE([WANT_SIGNATURE_VERIFY],[],[Enable image signature validation.])])
104AM_CONDITIONAL([WANT_SIGNATURE_VERIFY_BUILD], [test "x$enable_verify_signature" == "xyes"])
105
Michael Tritz5b756512017-10-06 16:52:01 -0500106AC_DEFINE(CHASSIS_STATE_PATH, "/xyz/openbmc_project/state/chassis0",
107 [The chassis state path.])
108AC_DEFINE(CHASSIS_STATE_OBJ, "xyz.openbmc_project.State.Chassis",
109 [The chassis state interface.])
110AC_DEFINE(CHASSIS_STATE_OFF, "xyz.openbmc_project.State.Chassis.PowerState.Off",
111 [The chassis state off property value.])
112
Adriana Kobylakb66ac3a2017-03-28 13:33:20 -0500113AC_DEFINE(MAPPER_BUSNAME, "xyz.openbmc_project.ObjectMapper",
114 [The object mapper busname.])
115AC_DEFINE(MAPPER_PATH, "/xyz/openbmc_project/object_mapper",
116 [The object mapper path.])
117AC_DEFINE(MAPPER_INTERFACE, "xyz.openbmc_project.ObjectMapper",
118 [The object mapper interface.])
119
Adriana Kobylak692b5552017-04-17 14:02:58 -0500120AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1",
121 [systemd busname.])
122AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1",
123 [systemd path.])
124AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager",
125 [systemd interface.])
Michael Tritz5b756512017-10-06 16:52:01 -0500126AC_DEFINE(SYSTEMD_PROPERTY_INTERFACE, "org.freedesktop.DBus.Properties",
127 [systemd properties interface.])
Adriana Kobylak692b5552017-04-17 14:02:58 -0500128
Adriana Kobylak55f9e832017-05-14 16:13:00 -0500129AC_DEFINE(PNOR_TOC_FILE, "pnor.toc",
130 [The name of the PNOR table of contents file])
Saqib Khan4c5d7442017-07-18 00:43:52 -0500131AC_DEFINE(MEDIA_DIR, "/media/",
132 [The base dir where all PNOR RO AND RW partitions are mounted])
Michael Tritz60bc20f2017-07-29 23:32:21 -0500133AC_DEFINE(PERSIST_DIR, "/var/lib/obmc/openpower-pnor-code-mgmt/",
134 [The dir where activation data is stored in files])
Adriana Kobylak55f9e832017-05-14 16:13:00 -0500135AC_DEFINE(PNOR_RO_PREFIX, "/media/pnor-ro-",
136 [The prefix path for the versioned read-only pnor partitions])
137AC_DEFINE(PNOR_RW_PREFIX, "/media/pnor-rw-",
138 [The prefix path for the versioned read-write pnor partitions])
139AC_DEFINE(PNOR_PRSV, "/media/pnor-prsv",
140 [The path for the preserved pnor partitions])
141AC_DEFINE(PNOR_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/",
142 [Path to the active pnor partitions])
143AC_DEFINE(PNOR_RO_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/ro",
144 [Path to the active read-only pnor partitions])
145AC_DEFINE(PNOR_RW_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/rw",
146 [Path to the active read-write pnor partitions])
147AC_DEFINE(PNOR_PRSV_ACTIVE_PATH, "/var/lib/phosphor-software-manager/pnor/prsv",
148 [Path to the active preserved pnor partitions])
149
Saqib Khan2cbfa032017-08-17 14:52:37 -0500150AC_ARG_VAR(ACTIVE_PNOR_MAX_ALLOWED, [The maximum allowed active pnor versions])
151AS_IF([test "x$ACTIVE_PNOR_MAX_ALLOWED" == "x"], [ACTIVE_PNOR_MAX_ALLOWED=2])
152AC_DEFINE_UNQUOTED([ACTIVE_PNOR_MAX_ALLOWED], [$ACTIVE_PNOR_MAX_ALLOWED], [The maximum allowed active pnor versions])
153
Gunnar Mills1ea62e12017-03-27 21:49:16 -0500154AC_CONFIG_FILES([Makefile test/Makefile])
Gunnar Mills9df13162017-03-08 15:00:08 -0600155AC_OUTPUT