blob: f720c7cc118897a6cf988ea9afcf8074b231ab13 [file] [log] [blame]
Matthew Barthc91be8e2016-09-15 14:51:57 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([obmc-console], 1.0, [https://github.com/openbmc/obmc-console/issues])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
Jeremy Kerra58cf442016-03-16 12:09:00 +08006AM_SILENT_RULES([yes])
7
Matthew Barthc91be8e2016-09-15 14:51:57 -05008# Checks for programs.
Jeremy Kerra58cf442016-03-16 12:09:00 +08009AC_PROG_CC
Matthew Barthc91be8e2016-09-15 14:51:57 -050010AM_PROG_AR
11AC_PROG_INSTALL
12AC_PROG_MAKE_SET
Jeremy Kerra58cf442016-03-16 12:09:00 +080013
Matthew Barthc91be8e2016-09-15 14:51:57 -050014# Checks for libraries.
Cheng C Yangf9c8f6c2019-03-04 18:39:52 +080015PKG_CHECK_MODULES([SYSTEMD], [libsystemd > 221])
Matthew Barthc91be8e2016-09-15 14:51:57 -050016
17# Checks for header files.
18
19# Checks for typedefs, structures, and compiler characteristics.
20AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS])
21
22# Checks for library functions.
23LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
24
25# Check/set gtest specific functions.
26AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPP_FLAGS="-DGTEST_HAS_PTHREAD=0"])
27AC_SUBST(GTEST_CPPFLAGS)
28
29AC_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)
32AC_ARG_VAR(OECORE_TARGET_SYSROOT,
33 [Path to the OE SDK SYSROOT])
Kun Yi9747d632018-06-22 15:32:05 -070034AS_IF([test "x$enable_oe_sdk" == "xyes"],
Matthew Barthc91be8e2016-09-15 14:51:57 -050035 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 Kerrc9775ce2017-02-07 16:25:34 +080048AC_CONFIG_FILES([Makefile test/Makefile])
Jeremy Kerra58cf442016-03-16 12:09:00 +080049AC_OUTPUT