blob: 7ee59d69711dce66595e92675395ff8508d9e7cb [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])
Ramesh Iyyar6230b0d2019-12-05 10:06:44 -060042
43AC_ARG_ENABLE([p9], AS_HELP_STRING([--enable-p9], [Use internal host initialisation procedures for POWER9 processors]))
44AS_IF([test "$enable_p9" == "yes"], [CHIPS+=" p9"])
45
46AC_ARG_ENABLE([openfsi], AS_HELP_STRING([--enable-openfsi], [Support Openfsi]))
47AS_IF([test "$enable_openfsi" == "yes"], [CHIPS+=" openfsi"])
48
Matt Spinleree401e92017-09-18 14:15:31 -050049AS_IF([test "x$CHIPS" == "x"], [CHIPS="p9 openfsi"])
Matt Spinler12bdf052017-03-09 16:01:39 -060050
51AC_CONFIG_FILES([Makefile.generated],
Matt Spinlercc2403c2017-03-17 11:07:06 -050052 [${srcdir}/gen_makefile.sh ${srcdir} "$myChips" > Makefile.generated],
Matt Spinler12bdf052017-03-09 16:01:39 -060053 [myChips="$CHIPS"])
54
Andrew Jeffery424475d2019-08-02 18:45:26 +093055AC_CHECK_LIB([pdbg], [thread_sreset_all])
56
Patrick Venture3348e622019-02-13 15:12:10 -080057PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
58PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
59PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
60PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces])
Matt Spinleree401e92017-09-18 14:15:31 -050061
Anthony Wilson171fbdf2018-11-01 13:38:50 -050062PKG_PROG_PKG_CONFIG
63AC_ARG_WITH([systemdsystemunitdir],
64 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
65 [with_systemdsystemunitdir=auto])
66AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
67 def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
68
69 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
70 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
71 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
72 with_systemdsystemunitdir=no],
73 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
74AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
75 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
76
Matt Spinler597e05c2017-02-28 09:59:53 -060077AC_CONFIG_FILES([Makefile test/Makefile])
Anthony Wilson171fbdf2018-11-01 13:38:50 -050078AC_CONFIG_FILES([pcie-poweroff@.service])
Lakshminarayana R. Kammath16ab00c2019-06-03 04:33:33 -050079AC_CONFIG_FILES([xyz.openbmc_project.Control.Host.NMI.service])
Matt Spinlerf716f322017-02-28 09:37:38 -060080AC_OUTPUT