1acdc2a90SMatthew Barth# Initialization 2acdc2a90SMatthew BarthAC_PREREQ([2.69]) 3acdc2a90SMatthew BarthAC_INIT([phosphor-event], [1.0], [https://github.com/openbmc/phosphor-event/issues]) 4acdc2a90SMatthew BarthAC_CONFIG_HEADERS([config.h]) 5acdc2a90SMatthew BarthAM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) 6acdc2a90SMatthew BarthAM_SILENT_RULES([yes]) 7c03bbc37SPatrick VentureAC_LANG([C++]) 8acdc2a90SMatthew Barth 9acdc2a90SMatthew Barth# Checks for programs. 10acdc2a90SMatthew BarthAC_PROG_CXX 11acdc2a90SMatthew BarthAC_PROG_CC 12acdc2a90SMatthew BarthAM_PROG_AR 13acdc2a90SMatthew BarthAC_PROG_INSTALL 14acdc2a90SMatthew BarthAC_PROG_MAKE_SET 15acdc2a90SMatthew Barth 16acdc2a90SMatthew Barth# Checks for libraries. 17acdc2a90SMatthew BarthPKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) 18acdc2a90SMatthew Barth 19acdc2a90SMatthew Barth# Checks for header files. 2017fb7868SGunnar MillsAC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) 21acdc2a90SMatthew Barth 22acdc2a90SMatthew Barth# Checks for typedefs, structures, and compiler characteristics. 23*3ed566dcSPatrick VentureAX_CXX_COMPILE_STDCXX([17], [noext]) 24acdc2a90SMatthew BarthAX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS]) 25acdc2a90SMatthew BarthAX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) 26acdc2a90SMatthew Barth 27acdc2a90SMatthew Barth# Checks for library functions. 28acdc2a90SMatthew BarthLT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' 29acdc2a90SMatthew Barth 30acdc2a90SMatthew Barth# Check/set gtest specific functions. 31acdc2a90SMatthew BarthAX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) 32acdc2a90SMatthew BarthAC_SUBST(GTEST_CPPFLAGS) 33acdc2a90SMatthew Barth 34acdc2a90SMatthew BarthAC_ARG_ENABLE([oe-sdk], 35acdc2a90SMatthew Barth AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) 36acdc2a90SMatthew Barth) 37acdc2a90SMatthew BarthAC_ARG_VAR(OECORE_TARGET_SYSROOT, 38acdc2a90SMatthew Barth [Path to the OE SDK SYSROOT]) 39acdc2a90SMatthew BarthAS_IF([test "x$enable_oe_sdk" == "xyes"], 40acdc2a90SMatthew Barth AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], 41acdc2a90SMatthew Barth AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) 42acdc2a90SMatthew Barth ) 43acdc2a90SMatthew Barth AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) 44acdc2a90SMatthew Barth [ 45acdc2a90SMatthew Barth testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" 46acdc2a90SMatthew Barth testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" 47acdc2a90SMatthew Barth testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" 48acdc2a90SMatthew Barth ] 49acdc2a90SMatthew Barth AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) 50acdc2a90SMatthew Barth) 51acdc2a90SMatthew Barth 52acdc2a90SMatthew Barth# Create configured output 5337fd9a65SJosh KingAC_CONFIG_FILES([ 5437fd9a65SJosh King Makefile 5537fd9a65SJosh King test/Makefile]) 56acdc2a90SMatthew BarthAC_OUTPUT 57