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]) |
Gunnar Mills | 32159fb | 2017-01-31 21:44:36 -0600 | [diff] [blame] | 15 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ |
| 16 | AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
| 17 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, |
| 18 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
Deepak Kodihalli | 059e233 | 2017-04-12 06:40:53 -0500 | [diff] [blame] | 19 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 20 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
Gunnar Mills | 93c12d3 | 2017-05-10 13:11:53 -0500 | [diff] [blame] | 21 | # Check for sdbus++ |
| 22 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 23 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 24 | AC_MSG_ERROR(["Requires sdbus++"])) |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 25 | |
| 26 | # Checks for library functions |
| 27 | LT_INIT # Required for systemd linking |
| 28 | |
Gunnar Mills | 01d55c3 | 2017-04-20 10:52:15 -0500 | [diff] [blame] | 29 | # Check/set gtest specific functions. |
| 30 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 31 | AC_SUBST(GTEST_CPPFLAGS) |
| 32 | AC_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 | ) |
| 35 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 36 | [Path to the OE SDK SYSROOT]) |
| 37 | AS_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 Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 50 | # Checks for typedefs, structures, and compiler characteristics. |
| 51 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 52 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 53 | |
| 54 | AC_ARG_VAR(VERSION_BUSNAME, [The Dbus busname to own]) |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 55 | 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] | 56 | AC_DEFINE_UNQUOTED([VERSION_BUSNAME], ["$VERSION_BUSNAME"], [The DBus busname to own]) |
| 57 | |
| 58 | AC_ARG_VAR(SOFTWARE_OBJPATH, [The version software manager Dbus root]) |
| 59 | AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"]) |
| 60 | AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The version software manager Dbus root]) |
| 61 | |
Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 62 | AC_ARG_VAR(DOWNLOAD_BUSNAME, [The Dbus busname to own]) |
| 63 | AS_IF([test "x$DOWNLOAD_BUSNAME" == "x"], |
| 64 | [DOWNLOAD_BUSNAME="xyz.openbmc_project.Software.Download"]) |
| 65 | AC_DEFINE_UNQUOTED([DOWNLOAD_BUSNAME], ["$DOWNLOAD_BUSNAME"], [The DBus busname to own]) |
| 66 | |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 67 | AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version", |
| 68 | [The software version manager interface]) |
| 69 | |
Deepak Kodihalli | 059e233 | 2017-04-12 06:40:53 -0500 | [diff] [blame] | 70 | AC_ARG_VAR(IMG_UPLOAD_DIR, [Directory where downloaded software images are placed]) |
| 71 | AS_IF([test "x$IMG_UPLOAD_DIR" == "x"], [IMG_UPLOAD_DIR="/tmp/images"]) |
| 72 | AC_DEFINE_UNQUOTED([IMG_UPLOAD_DIR], ["$IMG_UPLOAD_DIR"], [Directory where downloaded software images are placed]) |
| 73 | |
Gunnar Mills | 19e4ce5 | 2017-04-27 11:24:19 -0500 | [diff] [blame] | 74 | AC_ARG_VAR(MANIFEST_FILE_NAME, [The name of the MANIFEST file]) |
| 75 | AS_IF([test "x$MANIFEST_FILE_NAME" == "x"], [MANIFEST_FILE_NAME="MANIFEST"]) |
| 76 | AC_DEFINE_UNQUOTED([MANIFEST_FILE_NAME], ["$MANIFEST_FILE_NAME"], [The name of the MANIFEST file]) |
| 77 | |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 78 | AC_DEFINE(BUSNAME_UPDATER, "xyz.openbmc_project.Software.BMC.Updater", |
| 79 | [The item updater DBus busname to own.]) |
| 80 | |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 81 | # Check for header files. |
| 82 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])]) |
| 83 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])]) |
| 84 | |
Gunnar Mills | 01d55c3 | 2017-04-20 10:52:15 -0500 | [diff] [blame] | 85 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 86 | AC_OUTPUT |