Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([pldm], [1.0], |
| 4 | [https://github.com/openbmc/pldm/issues]) |
| 5 | AC_LANG([C++]) |
| 6 | AC_CONFIG_HEADERS([config.h]) |
| 7 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 8 | AM_SILENT_RULES([yes]) |
Jinu Joy Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 9 | AC_CONFIG_MACRO_DIRS([m4]) |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 10 | |
Priyanga | fb4bec9 | 2019-03-25 11:51:31 +0530 | [diff] [blame] | 11 | # Make sure the default CFLAGS of `-O2 -g` don't override CODE_COVERAGE_CFLAGS |
| 12 | # It is important that this comes before AC_PROG_C{C,XX}, as we are attempting |
| 13 | # to stop them from populating default CFLAGS and CXXFLAGS. |
| 14 | #AS_IF([test "x$enable_tests" = "xno"], [enable_code_coverage=no]) |
| 15 | AS_IF([test "x$enable_code_coverage" != "xno"], [ |
| 16 | AS_IF([test "x${CXXFLAGS+set}" != "xset"], [ |
| 17 | AC_SUBST(CXXFLAGS, [""]) |
| 18 | ]) |
| 19 | AS_IF([test "x${CFLAGS+set}" != "xset"], [ |
| 20 | AC_SUBST(CFLAGS, [""]) |
| 21 | ]) |
| 22 | ]) |
| 23 | |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 24 | # Checks for programs. |
| 25 | AC_PROG_CXX |
| 26 | AC_PROG_CC |
| 27 | AM_PROG_AR |
| 28 | AC_PROG_INSTALL |
| 29 | |
| 30 | # Checks for typedefs, structures, and compiler characteristics. |
| 31 | AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) |
| 32 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 33 | |
| 34 | # For linking |
| 35 | LT_INIT |
| 36 | |
Priyanga | fb4bec9 | 2019-03-25 11:51:31 +0530 | [diff] [blame] | 37 | # Code coverage |
| 38 | AX_CODE_COVERAGE |
| 39 | AM_EXTRA_RECURSIVE_TARGETS([check-code-coverage]) |
| 40 | m4_ifdef([_AX_CODE_COVERAGE_RULES], |
| 41 | [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [true])], |
| 42 | [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [false])]) |
| 43 | AX_ADD_AM_MACRO_STATIC([]) |
| 44 | |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 45 | AX_PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 46 | AX_PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 47 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 48 | |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 49 | # Check/set gtest specific functions. |
| 50 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 51 | AC_SUBST(GTEST_CPPFLAGS) |
| 52 | AC_ARG_ENABLE([oe-sdk], |
| 53 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 54 | ) |
| 55 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 56 | [Path to the OE SDK SYSROOT]) |
| 57 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 58 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 59 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 60 | ) |
| 61 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 62 | [ |
| 63 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 64 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 65 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 66 | ] |
| 67 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 68 | ) |
| 69 | |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 70 | # Setup IBM OEM commands support for PLDM |
| 71 | AC_ARG_ENABLE([oem-ibm], AS_HELP_STRING([ |
| 72 | --enable-oem-ibm |
| 73 | ], [ |
| 74 | Enable PLDM OEM command support For IBM. |
| 75 | ])) |
| 76 | AM_CONDITIONAL([OEM_IBM], [test "x$enable_oem_ibm" = "xyes"]) |
Jinu Joy Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 77 | AS_IF([test "x$enable_oem_ibm" == "xyes"], [ |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 78 | AX_APPEND_COMPILE_FLAGS([-DOEM_IBM], [CXXFLAGS]) |
Jinu Joy Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 79 | AX_APPEND_COMPILE_FLAGS([-DOEM_IBM], [CFLAGS]) |
Deepak Kodihalli | 832d4ca | 2019-08-01 05:14:18 -0500 | [diff] [blame^] | 80 | AC_DEFINE(FILE_TABLE_JSON, "/etc/default/obmc/pldm/fileTable.json", [JSON file containing file info for File I/O]) |
Jinu Joy Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 81 | ]) |
| 82 | |
| 83 | # Setup verbose option |
| 84 | AC_ARG_ENABLE([verbose], AS_HELP_STRING([ |
| 85 | --enable-verbose |
| 86 | ], [ |
| 87 | Enable verbosity for PLDM Daemon. |
| 88 | ])) |
| 89 | AS_IF([test "x$enable_verbose" == "xyes"], [ |
| 90 | AX_APPEND_COMPILE_FLAGS([-DVERBOSE], [CXXFLAGS]) |
| 91 | AX_APPEND_COMPILE_FLAGS([-DVERBOSE], [CFLAGS]) |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 92 | ]) |
| 93 | |
Deepak Kodihalli | 832d4ca | 2019-08-01 05:14:18 -0500 | [diff] [blame^] | 94 | AC_DEFINE(BIOS_JSONS_DIR, "/etc/default/obmc/pldm/bios", [Directory housing the json files for BIOS tables]) |
Sampa Misra | b37be31 | 2019-07-03 02:26:41 -0500 | [diff] [blame] | 95 | AC_DEFINE(BIOS_TABLES_DIR, "/var/lib/pldm/bios", [Directory housing actual BIOS tables]) |
| 96 | |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 97 | # Create configured output |
| 98 | AC_CONFIG_FILES([Makefile libpldm/Makefile libpldmresponder/Makefile test/Makefile]) |
| 99 | AC_CONFIG_FILES([libpldm/libpldm.pc]) |
| 100 | AC_OUTPUT |