Matt Spinler | f716f32 | 2017-02-28 09:37:38 -0600 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
| 2 | AC_INIT([openpower-proc-control], [1.0], [https://github.com/openbmc/openpower-proc-control/issues]) |
| 3 | AC_LANG([C++]) |
| 4 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 5 | AM_SILENT_RULES([yes]) |
| 6 | |
| 7 | # Checks for programs |
| 8 | AC_PROG_CXX |
| 9 | AC_PROG_INSTALL #Checks/sets the install variable to be used |
| 10 | AC_PROG_MAKE_SET |
| 11 | |
| 12 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | b3d7131 | 2018-10-04 10:09:58 -0700 | [diff] [blame] | 13 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Matt Spinler | f716f32 | 2017-02-28 09:37:38 -0600 | [diff] [blame] | 14 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 15 | |
| 16 | # Checks for library functions |
| 17 | LT_INIT |
| 18 | |
Matt Spinler | 597e05c | 2017-02-28 09:59:53 -0600 | [diff] [blame] | 19 | # Check/set gtest specific functions. |
| 20 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 21 | AC_SUBST(GTEST_CPPFLAGS) |
| 22 | AC_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 | ) |
| 25 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 26 | [Path to the OE SDK SYSROOT]) |
| 27 | AS_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 Spinler | ee401e9 | 2017-09-18 14:15:31 -0500 | [diff] [blame] | 40 | #CHIPS can be passed in a from a recipe, or it will default to P9 and openfsi |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 41 | AC_ARG_VAR(CHIPS, [The list of chips to build the procedures for]) |
Ramesh Iyyar | 6230b0d | 2019-12-05 10:06:44 -0600 | [diff] [blame] | 42 | |
| 43 | AC_ARG_ENABLE([p9], AS_HELP_STRING([--enable-p9], [Use internal host initialisation procedures for POWER9 processors])) |
Jayanth Othayoth | f7d1c1d | 2020-02-12 02:25:37 -0600 | [diff] [blame^] | 44 | AS_IF([test "$enable_p9" == "yes"], [CHIPS+=" p9 common"]) |
Ramesh Iyyar | 6230b0d | 2019-12-05 10:06:44 -0600 | [diff] [blame] | 45 | |
| 46 | AC_ARG_ENABLE([openfsi], AS_HELP_STRING([--enable-openfsi], [Support Openfsi])) |
| 47 | AS_IF([test "$enable_openfsi" == "yes"], [CHIPS+=" openfsi"]) |
| 48 | |
Ramesh Iyyar | b181d3b | 2019-10-17 13:39:10 -0500 | [diff] [blame] | 49 | AC_ARG_ENABLE([phal], AS_HELP_STRING([--enable-phal], [Use host processor initialisation procedures from PHAL])]) |
| 50 | |
| 51 | AS_IF([ test "$enable_phal" == "yes" && test "$enable_p9" == "yes"], |
| 52 | [ AC_MSG_ERROR([Internal POWER9 and PHAL-provided procedures conflict, please configure only one])] |
| 53 | ) |
| 54 | |
| 55 | AS_IF([test "$enable_phal" == "yes"], |
| 56 | [ |
| 57 | AX_ABSOLUTE_HEADER([libipl.h]) |
| 58 | if test x"$gl_cv_absolute_libipl_h" == "x" ; then |
| 59 | AC_MSG_ERROR([Cannot find libipl.h path]) |
| 60 | fi |
| 61 | |
| 62 | AC_CHECK_LIB([ipl], [ipl_init]) |
| 63 | if test x"$ac_cv_lib_ipl_ipl_init" != "xyes" ; then |
| 64 | AC_MSG_ERROR([IPL library not found]) |
| 65 | fi |
| 66 | |
Jayanth Othayoth | f7d1c1d | 2020-02-12 02:25:37 -0600 | [diff] [blame^] | 67 | CHIPS+=" phal common" |
Eddie James | ce042fe | 2020-01-28 10:25:13 -0600 | [diff] [blame] | 68 | AC_CONFIG_FILES([set-spi-mux.service]) |
Ramesh Iyyar | b181d3b | 2019-10-17 13:39:10 -0500 | [diff] [blame] | 69 | ] |
| 70 | ) |
Eddie James | ce042fe | 2020-01-28 10:25:13 -0600 | [diff] [blame] | 71 | AM_CONDITIONAL([ENABLE_PHAL], [test "$enable_phal" == "yes"]) |
Ramesh Iyyar | b181d3b | 2019-10-17 13:39:10 -0500 | [diff] [blame] | 72 | |
Jayanth Othayoth | f7d1c1d | 2020-02-12 02:25:37 -0600 | [diff] [blame^] | 73 | AS_IF([test "x$CHIPS" == "x"], [CHIPS="p9 openfsi common"]) |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 74 | |
| 75 | AC_CONFIG_FILES([Makefile.generated], |
Matt Spinler | cc2403c | 2017-03-17 11:07:06 -0500 | [diff] [blame] | 76 | [${srcdir}/gen_makefile.sh ${srcdir} "$myChips" > Makefile.generated], |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 77 | [myChips="$CHIPS"]) |
| 78 | |
Andrew Jeffery | 424475d | 2019-08-02 18:45:26 +0930 | [diff] [blame] | 79 | AC_CHECK_LIB([pdbg], [thread_sreset_all]) |
| 80 | |
Patrick Venture | 3348e62 | 2019-02-13 15:12:10 -0800 | [diff] [blame] | 81 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 82 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 83 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
Matt Spinler | ee401e9 | 2017-09-18 14:15:31 -0500 | [diff] [blame] | 84 | |
Anthony Wilson | 171fbdf | 2018-11-01 13:38:50 -0500 | [diff] [blame] | 85 | PKG_PROG_PKG_CONFIG |
| 86 | AC_ARG_WITH([systemdsystemunitdir], |
| 87 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, |
| 88 | [with_systemdsystemunitdir=auto]) |
| 89 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ |
| 90 | def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 91 | |
| 92 | AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 93 | [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 94 | [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) |
| 95 | with_systemdsystemunitdir=no], |
| 96 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 97 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 98 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) |
| 99 | |
Matt Spinler | 597e05c | 2017-02-28 09:59:53 -0600 | [diff] [blame] | 100 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Anthony Wilson | 171fbdf | 2018-11-01 13:38:50 -0500 | [diff] [blame] | 101 | AC_CONFIG_FILES([pcie-poweroff@.service]) |
Lakshminarayana R. Kammath | 16ab00c | 2019-06-03 04:33:33 -0500 | [diff] [blame] | 102 | AC_CONFIG_FILES([xyz.openbmc_project.Control.Host.NMI.service]) |
Matt Spinler | f716f32 | 2017-02-28 09:37:38 -0600 | [diff] [blame] | 103 | AC_OUTPUT |