blob: 05530374bed3fa095a414fadbcf9dcc8bc3c135f [file] [log] [blame]
Matthew Barth2af0b2d2016-10-13 16:00:04 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([inarp], [1.0], [https://github.com/openbmc/inarp/issues])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
7
8# Checks for programs.
9AC_PROG_CC
10AM_PROG_AR
11AC_PROG_INSTALL
12AC_PROG_MAKE_SET
13
14# Checks for libraries.
15
16# Checks for header files.
17
18# Checks for typedefs, structures, and compiler characteristics.
19AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Wextra -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_CPPFLAGS="-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
47AC_CONFIG_FILES([Makefile])
48AC_OUTPUT