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 |
Marri Devender Rao | 7847960 | 2020-01-06 03:45:11 -0600 | [diff] [blame] | 9 | AM_PROG_AR |
Matt Spinler | f716f32 | 2017-02-28 09:37:38 -0600 | [diff] [blame] | 10 | AC_PROG_INSTALL #Checks/sets the install variable to be used |
| 11 | AC_PROG_MAKE_SET |
| 12 | |
| 13 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | b3d7131 | 2018-10-04 10:09:58 -0700 | [diff] [blame] | 14 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Ramesh Iyyar | ef767ee | 2020-09-22 02:46:51 -0500 | [diff] [blame] | 15 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror -Wno-psabi], [CXXFLAGS]) |
Matt Spinler | f716f32 | 2017-02-28 09:37:38 -0600 | [diff] [blame] | 16 | |
| 17 | # Checks for library functions |
| 18 | LT_INIT |
| 19 | |
Matt Spinler | 597e05c | 2017-02-28 09:59:53 -0600 | [diff] [blame] | 20 | # Check/set gtest specific functions. |
| 21 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 22 | AC_SUBST(GTEST_CPPFLAGS) |
| 23 | AC_ARG_ENABLE([oe-sdk], |
| 24 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 25 | ) |
| 26 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 27 | [Path to the OE SDK SYSROOT]) |
| 28 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 29 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 30 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 31 | ) |
| 32 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 33 | [ |
| 34 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 35 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 36 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 37 | ] |
| 38 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 39 | ) |
| 40 | |
Matt Spinler | ee401e9 | 2017-09-18 14:15:31 -0500 | [diff] [blame] | 41 | #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] | 42 | 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] | 43 | |
| 44 | 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] | 45 | AS_IF([test "$enable_p9" == "yes"], [CHIPS+=" p9 common"]) |
Ramesh Iyyar | 6230b0d | 2019-12-05 10:06:44 -0600 | [diff] [blame] | 46 | |
| 47 | AC_ARG_ENABLE([openfsi], AS_HELP_STRING([--enable-openfsi], [Support Openfsi])) |
| 48 | AS_IF([test "$enable_openfsi" == "yes"], [CHIPS+=" openfsi"]) |
| 49 | |
Ramesh Iyyar | b181d3b | 2019-10-17 13:39:10 -0500 | [diff] [blame] | 50 | AC_ARG_ENABLE([phal], AS_HELP_STRING([--enable-phal], [Use host processor initialisation procedures from PHAL])]) |
| 51 | |
| 52 | AS_IF([ test "$enable_phal" == "yes" && test "$enable_p9" == "yes"], |
| 53 | [ AC_MSG_ERROR([Internal POWER9 and PHAL-provided procedures conflict, please configure only one])] |
| 54 | ) |
| 55 | |
| 56 | AS_IF([test "$enable_phal" == "yes"], |
| 57 | [ |
Marri Devender Rao | 7847960 | 2020-01-06 03:45:11 -0600 | [diff] [blame] | 58 | AX_ABSOLUTE_HEADER([libipl.H]) |
| 59 | if test x"$gl_cv_absolute_libipl_H" == "x" ; then |
| 60 | AC_MSG_ERROR([Cannot find libipl.H path]) |
Ramesh Iyyar | b181d3b | 2019-10-17 13:39:10 -0500 | [diff] [blame] | 61 | fi |
Ramesh Iyyar | b181d3b | 2019-10-17 13:39:10 -0500 | [diff] [blame] | 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 | |
Marri Devender Rao | 7847960 | 2020-01-06 03:45:11 -0600 | [diff] [blame] | 67 | AX_ABSOLUTE_HEADER([libekb.H]) |
| 68 | if test x"$gl_cv_absolute_libekb_H" == "x" ; then |
| 69 | AC_MSG_ERROR([Cannot find libekb.H path]) |
| 70 | fi |
| 71 | AC_CHECK_LIB([ekb], [libekb_init]) |
| 72 | if test x"$ac_cv_lib_ekb_libekb_init" != "xyes" ; then |
| 73 | AC_MSG_ERROR([EKB library not found]) |
| 74 | fi |
| 75 | |
Lakshminarayana R. Kammath | 75912e8 | 2020-04-28 07:37:17 -0500 | [diff] [blame] | 76 | PKG_CHECK_MODULES([LIBDT_API], [libdt-api]) |
| 77 | LIBS="$LIBS $LIBDT_API_LIBS" |
| 78 | CFLAGS="$CFLAGS $LIBDT_API_CFLAGS" |
| 79 | |
Ramesh Iyyar | ef767ee | 2020-09-22 02:46:51 -0500 | [diff] [blame] | 80 | PKG_CHECK_MODULES([FMT], [fmt]) |
| 81 | LIBS="$LIBS $FMT_LIBS" |
| 82 | |
Jayanth Othayoth | f7d1c1d | 2020-02-12 02:25:37 -0600 | [diff] [blame] | 83 | CHIPS+=" phal common" |
Eddie James | ce042fe | 2020-01-28 10:25:13 -0600 | [diff] [blame] | 84 | AC_CONFIG_FILES([set-spi-mux.service]) |
Ramesh Iyyar | b20593f | 2020-09-16 10:43:37 -0500 | [diff] [blame] | 85 | AC_CONFIG_FILES([phal-reinit-devtree.service]) |
Ramesh Iyyar | b181d3b | 2019-10-17 13:39:10 -0500 | [diff] [blame] | 86 | ] |
| 87 | ) |
| 88 | |
Marri Devender Rao | 7847960 | 2020-01-06 03:45:11 -0600 | [diff] [blame] | 89 | AM_CONDITIONAL([ENABLE_PHAL], [test "$enable_phal" == "yes"]) |
Jayanth Othayoth | f7d1c1d | 2020-02-12 02:25:37 -0600 | [diff] [blame] | 90 | AS_IF([test "x$CHIPS" == "x"], [CHIPS="p9 openfsi common"]) |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 91 | |
| 92 | AC_CONFIG_FILES([Makefile.generated], |
Matt Spinler | cc2403c | 2017-03-17 11:07:06 -0500 | [diff] [blame] | 93 | [${srcdir}/gen_makefile.sh ${srcdir} "$myChips" > Makefile.generated], |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 94 | [myChips="$CHIPS"]) |
| 95 | |
Andrew Jeffery | 424475d | 2019-08-02 18:45:26 +0930 | [diff] [blame] | 96 | AC_CHECK_LIB([pdbg], [thread_sreset_all]) |
| 97 | |
Patrick Venture | 3348e62 | 2019-02-13 15:12:10 -0800 | [diff] [blame] | 98 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 99 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 100 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
Matt Spinler | ee401e9 | 2017-09-18 14:15:31 -0500 | [diff] [blame] | 101 | |
Anthony Wilson | 171fbdf | 2018-11-01 13:38:50 -0500 | [diff] [blame] | 102 | PKG_PROG_PKG_CONFIG |
| 103 | AC_ARG_WITH([systemdsystemunitdir], |
| 104 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, |
| 105 | [with_systemdsystemunitdir=auto]) |
| 106 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ |
| 107 | def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 108 | |
| 109 | AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 110 | [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 111 | [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) |
| 112 | with_systemdsystemunitdir=no], |
| 113 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 114 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 115 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) |
| 116 | |
Matt Spinler | 597e05c | 2017-02-28 09:59:53 -0600 | [diff] [blame] | 117 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Anthony Wilson | 171fbdf | 2018-11-01 13:38:50 -0500 | [diff] [blame] | 118 | AC_CONFIG_FILES([pcie-poweroff@.service]) |
Lakshminarayana R. Kammath | 16ab00c | 2019-06-03 04:33:33 -0500 | [diff] [blame] | 119 | AC_CONFIG_FILES([xyz.openbmc_project.Control.Host.NMI.service]) |
Andrew Geissler | 6a133ab | 2020-01-31 14:13:06 -0600 | [diff] [blame] | 120 | AC_CONFIG_FILES([op-stop-instructions@.service]) |
Andrew Geissler | a007668 | 2020-02-05 13:14:53 -0600 | [diff] [blame] | 121 | AC_CONFIG_FILES([op-cfam-reset.service]) |
Dhruvaraj Subhashchandran | 3506c18 | 2020-02-18 05:28:39 -0600 | [diff] [blame] | 122 | AC_CONFIG_FILES([op-continue-mpreboot@.service]) |
| 123 | AC_CONFIG_FILES([op-enter-mpreboot@.service]) |
Matt Spinler | f716f32 | 2017-02-28 09:37:38 -0600 | [diff] [blame] | 124 | AC_OUTPUT |