blob: 408fc2985eac5f9ec09e866ed266624e64fc4472 [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])
Gunnar Mills32159fb2017-01-31 21:44:36 -060015PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
16 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
17PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
18 AC_MSG_ERROR(["Requires sdbusplus package."]))
Deepak Kodihalli059e2332017-04-12 06:40:53 -050019PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
20 AC_MSG_ERROR(["Requires phosphor-logging package."]))
Gunnar Mills93c12d32017-05-10 13:11:53 -050021# Check for sdbus++
22AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
23AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
24 AC_MSG_ERROR(["Requires sdbus++"]))
Gunnar Mills01a323b2017-01-18 09:48:13 -060025
26# Checks for library functions
27LT_INIT # Required for systemd linking
28
Gunnar Mills01d55c32017-04-20 10:52:15 -050029# Check/set gtest specific functions.
30AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
31AC_SUBST(GTEST_CPPFLAGS)
32AC_ARG_ENABLE([oe-sdk],
33 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
34)
35AC_ARG_VAR(OECORE_TARGET_SYSROOT,
36 [Path to the OE SDK SYSROOT])
37AS_IF([test "x$enable_oe_sdk" == "xyes"],
38 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
39 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
40 )
41 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
42 [
43 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
44 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
45 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
46 ]
47 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
48)
49
Gunnar Mills01a323b2017-01-18 09:48:13 -060050# Checks for typedefs, structures, and compiler characteristics.
51AX_CXX_COMPILE_STDCXX_14([noext])
52AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
53
Gunnar Mills1646e8f2017-08-30 13:02:40 -050054AC_DEFINE(ACTIVATION_FWD_ASSOCIATION, "inventory", [The name of the activation's forward association.])
55AC_DEFINE(ACTIVATION_REV_ASSOCIATION, "activation", [The name of the activation's reverse association.])
Gunnar Millsb60add12017-08-24 16:41:42 -050056AC_DEFINE(CHASSIS_INVENTORY_PATH, "/xyz/openbmc_project/inventory/system/chassis/", [The chassis inventory path root.])
57
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 Mills01a323b2017-01-18 09:48:13 -060061AC_ARG_VAR(VERSION_BUSNAME, [The Dbus busname to own])
Gunnar Mills9b7c0b62017-04-24 12:59:58 -050062AS_IF([test "x$VERSION_BUSNAME" == "x"], [VERSION_BUSNAME="xyz.openbmc_project.Software.Version"])
Gunnar Mills01a323b2017-01-18 09:48:13 -060063AC_DEFINE_UNQUOTED([VERSION_BUSNAME], ["$VERSION_BUSNAME"], [The DBus busname to own])
64
65AC_ARG_VAR(SOFTWARE_OBJPATH, [The version software manager Dbus root])
66AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"])
67AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The version software manager Dbus root])
68
Gunnar Mills701e0212017-04-03 11:21:27 -050069AC_ARG_VAR(DOWNLOAD_BUSNAME, [The Dbus busname to own])
70AS_IF([test "x$DOWNLOAD_BUSNAME" == "x"],
71 [DOWNLOAD_BUSNAME="xyz.openbmc_project.Software.Download"])
72AC_DEFINE_UNQUOTED([DOWNLOAD_BUSNAME], ["$DOWNLOAD_BUSNAME"], [The DBus busname to own])
73
Gunnar Millsb60add12017-08-24 16:41:42 -050074AC_DEFINE([MAPPER_BUSNAME], ["xyz.openbmc_project.ObjectMapper"], [Object mapper bus name])
75AC_DEFINE([MAPPER_INTERFACE], ["xyz.openbmc_project.ObjectMapper"], [Object mapper interface])
76AC_DEFINE([MAPPER_PATH], ["/xyz/openbmc_project/object_mapper"], [Object mapper DBUS path])
77
Gunnar Mills2ce7da22017-05-04 15:37:56 -050078AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version",
79 [The software version manager interface])
Saqib Khan19177d32017-06-20 08:11:49 -050080AC_DEFINE(FILEPATH_IFACE, "xyz.openbmc_project.Common.FilePath",
81 [The common file path interface])
Saqib Khan1eef62d2017-08-10 15:29:34 -050082AC_DEFINE(OS_RELEASE_FILE, "/etc/os-release",
83 [The name of the BMC table of contents file])
84AC_DEFINE(MEDIA_DIR, "/media/",
85 [The base dir where all RO partitions are mounted])
Saqib Khan6fab70d2017-09-07 00:13:50 -050086AC_DEFINE(BMC_ROFS_PREFIX, "/media/rofs-",
Saqib Khan1eef62d2017-08-10 15:29:34 -050087 [The prefix path for the versioned read-only bmc partitions])
Saqib Khan5d532672017-08-09 10:44:50 -050088AC_DEFINE(PERSIST_DIR, "/var/lib/obmc/phosphor-bmc-code-mgmt/",
89 [The dir where activation data is stored in files])
Michael Tritzf2b5e0d2017-07-25 14:39:34 -050090AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1",
91 [The systemd busname])
92AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1",
93 [The systemd path])
94AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager",
95 [The systemd interface])
96
Deepak Kodihalli059e2332017-04-12 06:40:53 -050097AC_ARG_VAR(IMG_UPLOAD_DIR, [Directory where downloaded software images are placed])
98AS_IF([test "x$IMG_UPLOAD_DIR" == "x"], [IMG_UPLOAD_DIR="/tmp/images"])
99AC_DEFINE_UNQUOTED([IMG_UPLOAD_DIR], ["$IMG_UPLOAD_DIR"], [Directory where downloaded software images are placed])
100
Gunnar Mills19e4ce52017-04-27 11:24:19 -0500101AC_ARG_VAR(MANIFEST_FILE_NAME, [The name of the MANIFEST file])
102AS_IF([test "x$MANIFEST_FILE_NAME" == "x"], [MANIFEST_FILE_NAME="MANIFEST"])
103AC_DEFINE_UNQUOTED([MANIFEST_FILE_NAME], ["$MANIFEST_FILE_NAME"], [The name of the MANIFEST file])
104
Gunnar Millsec1b41c2017-05-02 12:20:36 -0500105AC_DEFINE(BUSNAME_UPDATER, "xyz.openbmc_project.Software.BMC.Updater",
106 [The item updater DBus busname to own.])
107
Gunnar Mills01a323b2017-01-18 09:48:13 -0600108# Check for header files.
109AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])])
110AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])])
111
Gunnar Mills01d55c32017-04-20 10:52:15 -0500112AC_CONFIG_FILES([Makefile test/Makefile])
Gunnar Mills01a323b2017-01-18 09:48:13 -0600113AC_OUTPUT