Matthew Barth | ae0e96c | 2017-01-20 13:54:59 -0600 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-fan-presence], [1.0], |
| 4 | [https://github.com/openbmc/phosphor-fan-presence/issues]) |
| 5 | AC_LANG([C++]) |
| 6 | AC_CONFIG_HEADERS([config.h]) |
| 7 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 8 | AM_SILENT_RULES([yes]) |
| 9 | |
| 10 | # Checks for programs. |
| 11 | AC_PROG_CXX |
| 12 | AM_PROG_AR |
| 13 | AC_PROG_INSTALL |
| 14 | AC_PROG_MAKE_SET |
Matthew Barth | 681c98d | 2017-02-17 16:05:57 -0600 | [diff] [blame^] | 15 | # Python |
| 16 | AM_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 Barth | ae0e96c | 2017-01-20 13:54:59 -0600 | [diff] [blame] | 18 | |
| 19 | # Checks for typedefs, structures, and compiler characteristics. |
| 20 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 21 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 22 | |
| 23 | # Checks for libraries. |
Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 24 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], , |
| 25 | [AC_MSG_ERROR([The openbmc/sdbusplus package is required])]) |
| 26 | |
| 27 | # Checks for header files. |
Matthew Barth | ae0e96c | 2017-01-20 13:54:59 -0600 | [diff] [blame] | 28 | |
| 29 | # Checks for library functions. |
| 30 | LT_INIT # Required for systemd linking |
| 31 | |
Matthew Barth | 681c98d | 2017-02-17 16:05:57 -0600 | [diff] [blame^] | 32 | # Add optional yaml file argument |
| 33 | AC_ARG_VAR(FAN_DETECT_YAML_FILE, |
| 34 | [The fan presence detection definition file to use]) |
| 35 | AS_IF([test "x$FAN_DETECT_YAML_FILE" == "x"], |
| 36 | [FAN_DETECT_YAML_FILE="${srcdir}/example/fan-detect.yaml"]) |
| 37 | AC_DEFINE_UNQUOTED([FAN_DETECT_YAML_FILE], ["$FAN_DETECT_YAML_FILE"], |
| 38 | [The fan presence detection definition file to use]) |
| 39 | |
Matthew Barth | ae0e96c | 2017-01-20 13:54:59 -0600 | [diff] [blame] | 40 | # Create configured output |
Matthew Barth | 681c98d | 2017-02-17 16:05:57 -0600 | [diff] [blame^] | 41 | AC_SUBST([GEN_FAN_DETECT_DEFS], |
| 42 | [$PYTHON ${srcdir}/gen-fan-detect-defs.py -y $FAN_DETECT_YAML_FILE]) |
Matthew Barth | ae0e96c | 2017-01-20 13:54:59 -0600 | [diff] [blame] | 43 | AC_CONFIG_FILES([Makefile]) |
| 44 | AC_OUTPUT |