xref: /openbmc/inarp/configure.ac (revision 2af0b2d9787e4fbb41f3714c182e8ea5f433e8bb)
1*2af0b2d9SMatthew Barth# Initialization
2*2af0b2d9SMatthew BarthAC_PREREQ([2.69])
3*2af0b2d9SMatthew BarthAC_INIT([inarp], [1.0], [https://github.com/openbmc/inarp/issues])
4*2af0b2d9SMatthew BarthAC_CONFIG_HEADERS([config.h])
5*2af0b2d9SMatthew BarthAM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6*2af0b2d9SMatthew BarthAM_SILENT_RULES([yes])
7*2af0b2d9SMatthew Barth
8*2af0b2d9SMatthew Barth# Checks for programs.
9*2af0b2d9SMatthew BarthAC_PROG_CC
10*2af0b2d9SMatthew BarthAM_PROG_AR
11*2af0b2d9SMatthew BarthAC_PROG_INSTALL
12*2af0b2d9SMatthew BarthAC_PROG_MAKE_SET
13*2af0b2d9SMatthew Barth
14*2af0b2d9SMatthew Barth# Checks for libraries.
15*2af0b2d9SMatthew Barth
16*2af0b2d9SMatthew Barth# Checks for header files.
17*2af0b2d9SMatthew Barth
18*2af0b2d9SMatthew Barth# Checks for typedefs, structures, and compiler characteristics.
19*2af0b2d9SMatthew BarthAX_APPEND_COMPILE_FLAGS([-fpic -Wall -Wextra -Werror], [CFLAGS])
20*2af0b2d9SMatthew Barth
21*2af0b2d9SMatthew Barth# Checks for library functions.
22*2af0b2d9SMatthew BarthLT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
23*2af0b2d9SMatthew Barth
24*2af0b2d9SMatthew Barth# Check/set gtest specific functions.
25*2af0b2d9SMatthew BarthAX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
26*2af0b2d9SMatthew BarthAC_SUBST(GTEST_CPPFLAGS)
27*2af0b2d9SMatthew Barth
28*2af0b2d9SMatthew BarthAC_ARG_ENABLE([oe-sdk],
29*2af0b2d9SMatthew Barth    AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
30*2af0b2d9SMatthew Barth)
31*2af0b2d9SMatthew BarthAC_ARG_VAR(OECORE_TARGET_SYSROOT,
32*2af0b2d9SMatthew Barth    [Path to the OE SDK SYSROOT])
33*2af0b2d9SMatthew BarthAS_IF([test "x$enable_oe_sdk" == "xyes"],
34*2af0b2d9SMatthew Barth    AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
35*2af0b2d9SMatthew Barth          AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
36*2af0b2d9SMatthew Barth    )
37*2af0b2d9SMatthew Barth    AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
38*2af0b2d9SMatthew Barth    [
39*2af0b2d9SMatthew Barth        testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
40*2af0b2d9SMatthew Barth        testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
41*2af0b2d9SMatthew Barth        testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
42*2af0b2d9SMatthew Barth    ]
43*2af0b2d9SMatthew Barth    AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
44*2af0b2d9SMatthew Barth)
45*2af0b2d9SMatthew Barth
46*2af0b2d9SMatthew Barth# Create configured output
47*2af0b2d9SMatthew BarthAC_CONFIG_FILES([Makefile])
48*2af0b2d9SMatthew BarthAC_OUTPUT
49