blob: 743b210e00e9824e8013970f433527bcdbbb85e2 [file] [log] [blame]
Matt Spinlerf716f322017-02-28 09:37:38 -06001AC_PREREQ([2.69])
2AC_INIT([openpower-proc-control], [1.0], [https://github.com/openbmc/openpower-proc-control/issues])
3AC_LANG([C++])
4AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
5AM_SILENT_RULES([yes])
6
7# Checks for programs
8AC_PROG_CXX
9AC_PROG_INSTALL #Checks/sets the install variable to be used
10AC_PROG_MAKE_SET
11
12# Checks for typedefs, structures, and compiler characteristics.
Vernon Maueryb3d71312018-10-04 10:09:58 -070013AX_CXX_COMPILE_STDCXX_17([noext])
Matt Spinlerf716f322017-02-28 09:37:38 -060014AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
15
16# Checks for library functions
17LT_INIT
18
Matt Spinler597e05c2017-02-28 09:59:53 -060019# Check/set gtest specific functions.
20AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
21AC_SUBST(GTEST_CPPFLAGS)
22AC_ARG_ENABLE([oe-sdk],
23 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
24)
25AC_ARG_VAR(OECORE_TARGET_SYSROOT,
26 [Path to the OE SDK SYSROOT])
27AS_IF([test "x$enable_oe_sdk" == "xyes"],
28 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
29 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
30 )
31 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
32 [
33 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
34 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
35 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
36 ]
37 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
38)
39
Matt Spinleree401e92017-09-18 14:15:31 -050040#CHIPS can be passed in a from a recipe, or it will default to P9 and openfsi
Matt Spinler12bdf052017-03-09 16:01:39 -060041AC_ARG_VAR(CHIPS, [The list of chips to build the procedures for])
Matt Spinleree401e92017-09-18 14:15:31 -050042AS_IF([test "x$CHIPS" == "x"], [CHIPS="p9 openfsi"])
Matt Spinler12bdf052017-03-09 16:01:39 -060043
44AC_CONFIG_FILES([Makefile.generated],
Matt Spinlercc2403c2017-03-17 11:07:06 -050045 [${srcdir}/gen_makefile.sh ${srcdir} "$myChips" > Makefile.generated],
Matt Spinler12bdf052017-03-09 16:01:39 -060046 [myChips="$CHIPS"])
47
Matt Spinlerf716f322017-02-28 09:37:38 -060048PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])])
Dhruvaraj Subhashchandran7ce535c2017-05-15 05:06:36 -050049PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], [], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])])
Matt Spinleree401e92017-09-18 14:15:31 -050050PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces], [], [AC_MSG_ERROR(["openpower-dbus-interfaces required and not found."])])
51
Matt Spinler597e05c2017-02-28 09:59:53 -060052AC_CONFIG_FILES([Makefile test/Makefile])
Matt Spinlerf716f322017-02-28 09:37:38 -060053AC_OUTPUT