blob: a306b31b25d654ce1ab993b2e458078b03d95607 [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.
15
16# Checks for header files.
17
18# Checks for typedefs, structures, and compiler characteristics.
19AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS])
20
21# Checks for library functions.
22LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
23
24# Check/set gtest specific functions.
25AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPP_FLAGS="-DGTEST_HAS_PTHREAD=0"])
26AC_SUBST(GTEST_CPPFLAGS)
27
28AC_ARG_ENABLE([oe-sdk],
29 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
30)
31AC_ARG_VAR(OECORE_TARGET_SYSROOT,
32 [Path to the OE SDK SYSROOT])
33AS_IF([test "x$enable_oe-sdk" == "xyes"],
34 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
35 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
36 )
37 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
38 [
39 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
40 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
41 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
42 ]
43 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
44)
45
46# Create configured output
Jeremy Kerrc9775ce2017-02-07 16:25:34 +080047AC_CONFIG_FILES([Makefile test/Makefile])
Jeremy Kerra58cf442016-03-16 12:09:00 +080048AC_OUTPUT