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 | |
| 23 | # Checks for library functions |
| 24 | LT_INIT # Required for systemd linking |
| 25 | |
Gunnar Mills | 1ea62e1 | 2017-03-27 21:49:16 -0500 | [diff] [blame] | 26 | # Check/set gtest specific functions. |
| 27 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 28 | AC_SUBST(GTEST_CPPFLAGS) |
| 29 | AC_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 | ) |
| 32 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 33 | [Path to the OE SDK SYSROOT]) |
| 34 | AS_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 Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 47 | # Checks for typedefs, structures, and compiler characteristics. |
| 48 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 49 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 50 | |
| 51 | AC_ARG_VAR(VERSION_BUSNAME, [The Dbus busname to own]) |
| 52 | AS_IF([test "x$VERSION_BUSNAME" == "x"], |
| 53 | [VERSION_BUSNAME="org.open_power.Software.Host.Version"]) |
| 54 | AC_DEFINE_UNQUOTED([VERSION_BUSNAME], ["$VERSION_BUSNAME"], [The DBus busname to own]) |
| 55 | |
| 56 | AC_ARG_VAR(SOFTWARE_OBJPATH, [The software manager Dbus root]) |
| 57 | AS_IF([test "x$SOFTWARE_OBJPATH" == "x"], [SOFTWARE_OBJPATH="/xyz/openbmc_project/software"]) |
| 58 | AC_DEFINE_UNQUOTED([SOFTWARE_OBJPATH], ["$SOFTWARE_OBJPATH"], [The software manager Dbus root]) |
| 59 | |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 60 | AC_DEFINE(VERSION_IFACE, "xyz.openbmc_project.Software.Version", |
| 61 | [The software version manager interface]) |
| 62 | |
Adriana Kobylak | 2d8fa22 | 2017-03-15 12:34:32 -0500 | [diff] [blame] | 63 | AC_DEFINE(BUSNAME_UPDATER, "org.open_power.Software.Host.Updater", |
| 64 | [The item updater DBus busname to own.]) |
| 65 | |
Saqib Khan | 77420d2 | 2017-04-04 11:07:07 -0500 | [diff] [blame] | 66 | AC_ARG_VAR(MANIFEST_FILE, [The path to the MANIFEST file]) |
| 67 | AS_IF([test "x$MANIFEST_FILE" == "x"], [MANIFEST_FILE="/tmp/pnor/MANIFEST"]) |
| 68 | 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] | 69 | |
Adriana Kobylak | b66ac3a | 2017-03-28 13:33:20 -0500 | [diff] [blame] | 70 | AC_DEFINE(MAPPER_BUSNAME, "xyz.openbmc_project.ObjectMapper", |
| 71 | [The object mapper busname.]) |
| 72 | AC_DEFINE(MAPPER_PATH, "/xyz/openbmc_project/object_mapper", |
| 73 | [The object mapper path.]) |
| 74 | AC_DEFINE(MAPPER_INTERFACE, "xyz.openbmc_project.ObjectMapper", |
| 75 | [The object mapper interface.]) |
| 76 | |
Gunnar Mills | 1ea62e1 | 2017-03-27 21:49:16 -0500 | [diff] [blame] | 77 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Gunnar Mills | 9df1316 | 2017-03-08 15:00:08 -0600 | [diff] [blame] | 78 | AC_OUTPUT |
| 79 | |