blob: 8e31832f4dd0b36b2211ed0e08182295a6809346 [file] [log] [blame]
Gunnar Mills01a323b2017-01-18 09:48:13 -06001AC_PREREQ([2.69])
2AC_INIT([phosphor-bmc-code-mgmt], [1.0], [https://github.com/openbmc/phosphor-bmc-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
8# Checks for programs
9AC_PROG_CXX
10AC_PROG_INSTALL #Checks/sets the install variable to be used
11AC_PROG_MAKE_SET
12
13# Check for libraries
14PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
Patrick Ventureefd8e912019-02-13 15:26:00 -080015PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
16PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
17PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
Gunnar Mills93c12d32017-05-10 13:11:53 -050018# Check for sdbus++
19AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
20AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
21 AC_MSG_ERROR(["Requires sdbus++"]))
Gunnar Mills01a323b2017-01-18 09:48:13 -060022
23# Checks for library functions
24LT_INIT # Required for systemd linking
25
Gunnar Mills01d55c32017-04-20 10:52:15 -050026# Check/set gtest specific functions.
27AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
28AC_SUBST(GTEST_CPPFLAGS)
29AC_ARG_ENABLE([oe-sdk],
30 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
31)
32AC_ARG_VAR(OECORE_TARGET_SYSROOT,
33 [Path to the OE SDK SYSROOT])
34AS_IF([test "x$enable_oe_sdk" == "xyes"],
35 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
36 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
37 )
38 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
39 [
40 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
41 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
42 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
43 ]
44 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
45)
46
Gunnar Mills01a323b2017-01-18 09:48:13 -060047# Checks for typedefs, structures, and compiler characteristics.
Adriana Kobylak71f6e732018-09-24 13:13:03 -050048AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
Gunnar Mills01a323b2017-01-18 09:48:13 -060049AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
50
Gunnar Mills1646e8f2017-08-30 13:02:40 -050051AC_DEFINE(ACTIVATION_FWD_ASSOCIATION, "inventory", [The name of the activation's forward association.])
52AC_DEFINE(ACTIVATION_REV_ASSOCIATION, "activation", [The name of the activation's reverse association.])
Adriana Kobylak1254c622017-12-07 12:24:56 -060053AC_DEFINE(INVENTORY_PATH, "/xyz/openbmc_project/inventory/",
54 [The inventory path root.])
55AC_DEFINE(BMC_INVENTORY_INTERFACE, "xyz.openbmc_project.Inventory.Item.Bmc",
56 [The BMC inventory interface])
Gunnar Millsb60add12017-08-24 16:41:42 -050057
Gunnar Millsded875d2017-08-28 16:44:52 -050058AC_DEFINE(ACTIVE_FWD_ASSOCIATION, "active", [The name of the active's forward association.])
59AC_DEFINE(ACTIVE_REV_ASSOCIATION, "software_version", [The name of the active's reverse association.])
60
Gunnar Mills88e8a322017-09-13 11:09:28 -050061AC_DEFINE(FUNCTIONAL_FWD_ASSOCIATION, "functional", [The name of the functional forward association.])
Adriana Kobylak6097e042018-05-02 10:47:03 -050062AC_DEFINE(FUNCTIONAL_REV_ASSOCIATION, "software_version", [The functional reverse association.])
Gunnar Mills88e8a322017-09-13 11:09:28 -050063
Gunnar Mills01a323b2017-01-18 09:48:13 -060064AC_ARG_VAR(VERSION_BUSNAME, [The Dbus busname to own])
Gunnar Mills9b7c0b62017-04-24 12:59:58 -050065AS_IF([test "x$VERSION_BUSNAME" == "x"], [VERSION_BUSNAME="xyz.openbmc_project.Software.Version"])
Gunnar Mills01a323b2017-01-18 09:48:13 -060066AC_DEFINE_UNQUOTED([VERSION_BUSNAME], ["$VERSION_BUSNAME"], [The DBus busname to own])
67
68AC_ARG_VAR(SOFTWARE_OBJPATH, [The version software manager Dbus root])
69AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"])
70AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The version software manager Dbus root])
71
Gunnar Mills701e0212017-04-03 11:21:27 -050072AC_ARG_VAR(DOWNLOAD_BUSNAME, [The Dbus busname to own])
73AS_IF([test "x$DOWNLOAD_BUSNAME" == "x"],
74 [DOWNLOAD_BUSNAME="xyz.openbmc_project.Software.Download"])
75AC_DEFINE_UNQUOTED([DOWNLOAD_BUSNAME], ["$DOWNLOAD_BUSNAME"], [The DBus busname to own])
76
Gunnar Millsb60add12017-08-24 16:41:42 -050077AC_DEFINE([MAPPER_BUSNAME], ["xyz.openbmc_project.ObjectMapper"], [Object mapper bus name])
78AC_DEFINE([MAPPER_INTERFACE], ["xyz.openbmc_project.ObjectMapper"], [Object mapper interface])
79AC_DEFINE([MAPPER_PATH], ["/xyz/openbmc_project/object_mapper"], [Object mapper DBUS path])
80
Gunnar Mills2ce7da22017-05-04 15:37:56 -050081AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version",
82 [The software version manager interface])
Saqib Khan19177d32017-06-20 08:11:49 -050083AC_DEFINE(FILEPATH_IFACE, "xyz.openbmc_project.Common.FilePath",
84 [The common file path interface])
Saqib Khan1eef62d2017-08-10 15:29:34 -050085AC_DEFINE(OS_RELEASE_FILE, "/etc/os-release",
86 [The name of the BMC table of contents file])
Adriana Kobylaka9074342018-05-08 11:52:44 -050087AC_DEFINE(ALT_RWFS, "/media/alt/var/persist",
88 [The path of the alt rwfs overlay])
Saqib Khan5d532672017-08-09 10:44:50 -050089AC_DEFINE(PERSIST_DIR, "/var/lib/obmc/phosphor-bmc-code-mgmt/",
90 [The dir where activation data is stored in files])
Michael Tritzf2b5e0d2017-07-25 14:39:34 -050091AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1",
92 [The systemd busname])
93AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1",
94 [The systemd path])
95AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager",
96 [The systemd interface])
97
Lei YU269bff32018-08-21 15:21:40 +080098AC_ARG_VAR(MEDIA_DIR, [The base dir where all RO partitions are mounted])
99AS_IF([test "x$MEDIA_DIR" == "x"], [MEDIA_DIR="/media"])
100AC_DEFINE_UNQUOTED([MEDIA_DIR], ["$MEDIA_DIR"], [The base dir where all RO partitions are mounted])
101
102AC_DEFINE_UNQUOTED(BMC_ROFS_PREFIX, "$MEDIA_DIR/rofs-",
103 [The prefix path for the versioned read-only bmc partitions])
104
Deepak Kodihalli059e2332017-04-12 06:40:53 -0500105AC_ARG_VAR(IMG_UPLOAD_DIR, [Directory where downloaded software images are placed])
106AS_IF([test "x$IMG_UPLOAD_DIR" == "x"], [IMG_UPLOAD_DIR="/tmp/images"])
107AC_DEFINE_UNQUOTED([IMG_UPLOAD_DIR], ["$IMG_UPLOAD_DIR"], [Directory where downloaded software images are placed])
108
Adriana Kobylakb072d1b2018-04-24 11:37:21 -0500109AC_ARG_VAR(SYNC_LIST_FILE_NAME, [The name of the sync list file])
110AS_IF([test "x$SYNC_LIST_FILE_NAME" == "x"], [SYNC_LIST_FILE_NAME="synclist"])
111AC_DEFINE_UNQUOTED([SYNC_LIST_FILE_NAME], ["$SYNC_LIST_FILE_NAME"], [The name of the sync list file])
112
113AC_ARG_VAR(SYNC_LIST_DIR_PATH, [The path to the sync list file directory])
114AS_IF([test "x$SYNC_LIST_DIR_PATH" == "x"], [SYNC_LIST_DIR_PATH="/etc/"])
115AC_DEFINE_UNQUOTED([SYNC_LIST_DIR_PATH], ["$SYNC_LIST_DIR_PATH"], [The path to the sync list file directory])
116
Gunnar Mills19e4ce52017-04-27 11:24:19 -0500117AC_ARG_VAR(MANIFEST_FILE_NAME, [The name of the MANIFEST file])
118AS_IF([test "x$MANIFEST_FILE_NAME" == "x"], [MANIFEST_FILE_NAME="MANIFEST"])
119AC_DEFINE_UNQUOTED([MANIFEST_FILE_NAME], ["$MANIFEST_FILE_NAME"], [The name of the MANIFEST file])
120
Jayanth Othayoth2ab9b102018-02-21 05:27:47 -0600121AC_ARG_VAR(PUBLICKEY_FILE_NAME, [The name of the public key file])
122AS_IF([test "x$PUBLICKEY_FILE_NAME" == "x"], [PUBLICKEY_FILE_NAME="publickey"])
123AC_DEFINE_UNQUOTED([PUBLICKEY_FILE_NAME], ["$PUBLICKEY_FILE_NAME"], [The name of the public key file])
124
125AC_ARG_VAR(HASH_FILE_NAME, [Hash file name])
126AS_IF([test "x$HASH_FILE_NAME" == "x"], [HASH_FILE_NAME="hashfunc"])
127AC_DEFINE_UNQUOTED([HASH_FILE_NAME], ["$HASH_FILE_NAME"], [The name of the hash file])
128
129AC_ARG_VAR(SIGNED_IMAGE_CONF_PATH, [Path of public key and hash function files])
130AS_IF([test "x$SIGNED_IMAGE_CONF_PATH" == "x"], [SIGNED_IMAGE_CONF_PATH="/etc/activationdata/"])
131AC_DEFINE_UNQUOTED([SIGNED_IMAGE_CONF_PATH], ["$SIGNED_IMAGE_CONF_PATH"], [Path of public key and hash function files])
132
133AC_ARG_VAR(SIGNATURE_FILE_EXT, [The extension of the Signature file])
134AS_IF([test "x$SIGNATURE_FILE_EXT" == "x"], [SIGNATURE_FILE_EXT=".sig"])
135AC_DEFINE_UNQUOTED([SIGNATURE_FILE_EXT], ["$SIGNATURE_FILE_EXT"], [The extension of the Signature file])
136
Adriana Kobylak204e1e72018-01-24 16:00:05 -0600137AC_ARG_VAR(ACTIVE_BMC_MAX_ALLOWED, [The maximum allowed active BMC versions])
138AS_IF([test "x$ACTIVE_BMC_MAX_ALLOWED" == "x"], [ACTIVE_BMC_MAX_ALLOWED=2])
139AC_DEFINE_UNQUOTED([ACTIVE_BMC_MAX_ALLOWED], [$ACTIVE_BMC_MAX_ALLOWED],
140 [The maximum allowed active BMC versions])
141
Jayanth Othayoth0e0c1272018-02-21 05:46:36 -0600142# setup signature verification
143AC_ARG_ENABLE([verify_signature],
144 AS_HELP_STRING([--enable-verify_signature], [Enable image signature validation.]))
145AS_IF([test "x$enable_verify_signature" == "xyes"], \
146 [AC_DEFINE([WANT_SIGNATURE_VERIFY],[],[Enable image signature validation.])])
147AM_CONDITIONAL([WANT_SIGNATURE_VERIFY_BUILD], [test "x$enable_verify_signature" == "xyes"])
148
Gunnar Millsec1b41c2017-05-02 12:20:36 -0500149AC_DEFINE(BUSNAME_UPDATER, "xyz.openbmc_project.Software.BMC.Updater",
150 [The item updater DBus busname to own.])
151
Adriana Kobylak7e8d76b2018-04-20 10:03:01 -0500152# setup sync of filesystem files
153AC_ARG_ENABLE([sync_bmc_files],
154 AS_HELP_STRING([--enable-sync_bmc_files], [Enable sync of filesystem files.]))
155AS_IF([test "x$enable_sync_bmc_files" == "xyes"], \
156 [AC_DEFINE([WANT_SYNC],[],[Enable sync of filesystem files.])])
157AM_CONDITIONAL([WANT_SYNC], [test "x$enable_sync_bmc_files" == "xyes"])
158
Lei YUa7853ee2018-05-23 11:13:12 +0800159# setup ubifs layout support
160AC_ARG_ENABLE([ubifs_layout],
161 AS_HELP_STRING([--enable-ubifs_layout], [Enable ubifs support.]))
162AS_IF([test "x$enable_ubifs_layout" == "xyes"], \
163 [AC_DEFINE([UBIFS_LAYOUT],[],[Enable ubifs support.])])
164AM_CONDITIONAL([UBIFS_LAYOUT], [test "x$enable_ubifs_layout" == "xyes"])
165
Gunnar Mills01a323b2017-01-18 09:48:13 -0600166# Check for header files.
Gunnar Mills7a248bc2017-10-25 13:51:07 -0500167AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
Gunnar Mills01a323b2017-01-18 09:48:13 -0600168AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])])
169
Gunnar Mills01d55c32017-04-20 10:52:15 -0500170AC_CONFIG_FILES([Makefile test/Makefile])
Gunnar Mills01a323b2017-01-18 09:48:13 -0600171AC_OUTPUT