blob: 0286aa629dde412b9cc2162c97b35d7cb1262668 [file] [log] [blame]
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +05301# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-led-manager], [1.0], [https://github.com/openbmc/phosphor-led-manager/issues])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +05304AC_LANG([C++])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +05305AC_CONFIG_HEADERS([config.h])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
9# Checks for programs.
10AC_PROG_CXX
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053011AC_PROG_INSTALL
12AC_PROG_MAKE_SET
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053013
14# Checks for typedefs, structures, and compiler characteristics.
15AX_CXX_COMPILE_STDCXX_14([noext])
16AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053017
18# Python
19AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
20
21# Checks for libraries.
22PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
23
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053024LT_INIT # Removes WARNING: unrecognized options: --with-libtool-sysroot
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053025# Check/set gtest specific functions.
26AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
27AC_SUBST(GTEST_CPPFLAGS)
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053028AC_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)
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053045
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053046# Checks for header files.
47AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053048AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053049
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053050# Dbus service name
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053051AC_ARG_VAR(BUSNAME, [The Dbus busname to own])
Vishwanatha Subbannaa1c7f6a2017-02-02 14:51:42 +053052AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.LED.GroupManager"])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053053AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The Dbus busname to own])
54
55# Service dbus root
Vishwanatha Subbannaa1c7f6a2017-02-02 14:51:42 +053056AC_ARG_VAR(OBJPATH, [The LED group Dbus root])
57AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/led/groups"])
58AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The LED group Dbus root])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053059
Vishwanatha Subbannaa3523762017-01-23 17:26:46 +053060# Handling configuration files
61AC_ARG_VAR(YAML_PATH, [The path to the yaml config files.])
62AS_IF([test "x$YAML_PATH" == "x"], [YAML_PATH="$srcdir"])
Brad Bishop513f58e2017-02-08 13:25:17 -050063LEDGEN="$PYTHON $srcdir/parse_led.py -i $YAML_PATH"
Brad Bishopd782d8e2017-02-01 21:23:50 -050064AC_SUBST(LEDGEN)
Vishwanatha Subbannaa3523762017-01-23 17:26:46 +053065
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053066# Create configured output
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053067AC_CONFIG_FILES([Makefile test/Makefile])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053068AC_OUTPUT