Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-net-ipmid], [1.0], [https://github.com/openbmc/phosphor-net-ipmid/issues]) |
| 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 | AM_PROG_AR |
| 11 | AC_PROG_INSTALL |
| 12 | AC_PROG_MAKE_SET |
| 13 | |
| 14 | # Surpress the --with-libtool-sysroot error |
| 15 | LT_INIT |
| 16 | |
Tom Joseph | 1e5a76a | 2017-01-30 19:25:06 +0530 | [diff] [blame] | 17 | # Check/set gtest specific functions. |
| 18 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 19 | AC_SUBST(GTEST_CPPFLAGS) |
| 20 | AC_ARG_ENABLE([oe-sdk], |
| 21 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 22 | ) |
| 23 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 24 | [Path to the OE SDK SYSROOT]) |
| 25 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 26 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 27 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 28 | ) |
| 29 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 30 | [ |
| 31 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 32 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 33 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 34 | ] |
| 35 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 36 | ) |
| 37 | |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 38 | # Checks for typedefs, structures, and compiler characteristics. |
| 39 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 40 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 41 | |
| 42 | # Checks for libraries. |
| 43 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 44 | PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g], ,[AC_MSG_ERROR([can't find openssl libcrypto])]) |
Tom Joseph | 7fd26dd | 2017-03-14 15:26:26 +0530 | [diff] [blame] | 45 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])]) |
Tom Joseph | 19b4f40 | 2017-08-02 17:59:30 +0530 | [diff] [blame] | 46 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 47 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 48 | AC_CHECK_LIB([mapper], [mapper_get_service], ,[AC_MSG_ERROR([Could not find libmapper...openbmc/phosphor-objmgr package required])]) |
| 49 | |
| 50 | # Checks for header files. |
| 51 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])]) |
Tom Joseph | c0f5b5d | 2017-02-09 17:47:50 +0530 | [diff] [blame] | 52 | AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...openbmc/phosphor-host-ipmid package required])]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 53 | |
Tom | 485038e | 2016-12-02 13:44:45 +0530 | [diff] [blame] | 54 | # Checks for library functions. |
| 55 | LT_INIT([dlopen disable-static shared]) |
| 56 | LT_LIB_DLLOAD |
| 57 | |
Tom Joseph | 1e5a76a | 2017-01-30 19:25:06 +0530 | [diff] [blame] | 58 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 59 | AC_OUTPUT |