blob: 2c083ca09856aaef1df907c42b74e15183aef26f [file] [log] [blame]
Matthew Barthae0e96c2017-01-20 13:54:59 -06001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-fan-presence], [1.0],
4[https://github.com/openbmc/phosphor-fan-presence/issues])
5AC_LANG([C++])
6AC_CONFIG_HEADERS([config.h])
7AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
8AM_SILENT_RULES([yes])
9
10# Checks for programs.
11AC_PROG_CXX
12AM_PROG_AR
13AC_PROG_INSTALL
14AC_PROG_MAKE_SET
Matthew Barth681c98d2017-02-17 16:05:57 -060015# Python
16AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])],
17[AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
Matthew Barthae0e96c2017-01-20 13:54:59 -060018
19# Checks for typedefs, structures, and compiler characteristics.
20AX_CXX_COMPILE_STDCXX_14([noext])
21AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
22
23# Checks for libraries.
Matthew Barth293477d2017-02-17 15:39:36 -060024PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,
25[AC_MSG_ERROR([The openbmc/sdbusplus package is required])])
Matthew Barthfefdc452017-02-22 11:15:56 -060026PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging], ,
27[AC_MSG_ERROR([The openbmc/phosphor-logging package is required])])
Matthew Barth293477d2017-02-17 15:39:36 -060028
29# Checks for header files.
Matthew Barthae0e96c2017-01-20 13:54:59 -060030
31# Checks for library functions.
32LT_INIT # Required for systemd linking
33
Matthew Barth681c98d2017-02-17 16:05:57 -060034# Add optional yaml file argument
35AC_ARG_VAR(FAN_DETECT_YAML_FILE,
36[The fan presence detection definition file to use])
37AS_IF([test "x$FAN_DETECT_YAML_FILE" == "x"],
38[FAN_DETECT_YAML_FILE="${srcdir}/example/fan-detect.yaml"])
39AC_DEFINE_UNQUOTED([FAN_DETECT_YAML_FILE], ["$FAN_DETECT_YAML_FILE"],
40[The fan presence detection definition file to use])
41
Matthew Barthae0e96c2017-01-20 13:54:59 -060042# Create configured output
Matthew Barth681c98d2017-02-17 16:05:57 -060043AC_SUBST([GEN_FAN_DETECT_DEFS],
44[$PYTHON ${srcdir}/gen-fan-detect-defs.py -y $FAN_DETECT_YAML_FILE])
Matt Spinlere73446e2017-04-10 13:55:52 -050045AC_CONFIG_FILES([Makefile control/Makefile])
Matthew Barthae0e96c2017-01-20 13:54:59 -060046AC_OUTPUT