blob: 648d0186addb7bd23fa37ae9c13f4a0b0275d1ac [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])])
26
27# Checks for header files.
Matthew Barthae0e96c2017-01-20 13:54:59 -060028
29# Checks for library functions.
30LT_INIT # Required for systemd linking
31
Matthew Barth681c98d2017-02-17 16:05:57 -060032# Add optional yaml file argument
33AC_ARG_VAR(FAN_DETECT_YAML_FILE,
34[The fan presence detection definition file to use])
35AS_IF([test "x$FAN_DETECT_YAML_FILE" == "x"],
36[FAN_DETECT_YAML_FILE="${srcdir}/example/fan-detect.yaml"])
37AC_DEFINE_UNQUOTED([FAN_DETECT_YAML_FILE], ["$FAN_DETECT_YAML_FILE"],
38[The fan presence detection definition file to use])
39
Matthew Barthae0e96c2017-01-20 13:54:59 -060040# Create configured output
Matthew Barth681c98d2017-02-17 16:05:57 -060041AC_SUBST([GEN_FAN_DETECT_DEFS],
42[$PYTHON ${srcdir}/gen-fan-detect-defs.py -y $FAN_DETECT_YAML_FILE])
Matthew Barthae0e96c2017-01-20 13:54:59 -060043AC_CONFIG_FILES([Makefile])
44AC_OUTPUT