Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([obmc-console], 1.0, [https://github.com/openbmc/obmc-console/issues]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 6 | AM_SILENT_RULES([yes]) |
| 7 | |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 8 | # Checks for programs. |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 9 | AC_PROG_CC |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 10 | AM_PROG_AR |
| 11 | AC_PROG_INSTALL |
| 12 | AC_PROG_MAKE_SET |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 13 | |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 14 | # Checks for libraries. |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame^] | 15 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd > 221]) |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 16 | |
| 17 | # Checks for header files. |
| 18 | |
| 19 | # Checks for typedefs, structures, and compiler characteristics. |
| 20 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 21 | |
| 22 | # Checks for library functions. |
| 23 | LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' |
| 24 | |
| 25 | # Check/set gtest specific functions. |
| 26 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPP_FLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 27 | AC_SUBST(GTEST_CPPFLAGS) |
| 28 | |
| 29 | AC_ARG_ENABLE([oe-sdk], |
| 30 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 31 | ) |
| 32 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 33 | [Path to the OE SDK SYSROOT]) |
Kun Yi | 9747d63 | 2018-06-22 15:32:05 -0700 | [diff] [blame] | 34 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 35 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 36 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 37 | ) |
| 38 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 39 | [ |
| 40 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 41 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 42 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 43 | ] |
| 44 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 45 | ) |
| 46 | |
| 47 | # Create configured output |
Jeremy Kerr | c9775ce | 2017-02-07 16:25:34 +0800 | [diff] [blame] | 48 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 49 | AC_OUTPUT |