Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([sys-ipmi], [1.0], [https://www.github.com/google-ipmi-sys/issues]) |
| 4 | AC_LANG([C++]) |
| 5 | AC_CONFIG_HEADERS([config.h]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AM_PROG_AR |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
| 14 | |
| 15 | # Checks for typedefs, structures, and compiler characteristics. |
Patrick Venture | c25a3df | 2018-09-17 12:11:19 -0700 | [diff] [blame] | 16 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 17 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 18 | |
| 19 | # Checks for libraries. |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 20 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,[AC_MSG_ERROR([The openbmc/sdbusplus package is required])]) |
| 21 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging], ,[AC_MSG_ERROR([The openbmc/phosphor-logging package is required])]) |
Patrick Venture | ef45005 | 2018-09-21 14:50:47 -0700 | [diff] [blame^] | 22 | AC_CHECK_HEADER(experimental/filesystem, ,[AC_MSG_ERROR([Could not find experimental/filesystem...libstdc++fs developement package required])]) |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 23 | AC_CHECK_HEADER([host-ipmid], [AC_MSG_ERROR(["phosphor-host-ipmid required and not found."])]) |
| 24 | |
| 25 | # Checks for library functions. |
| 26 | LT_INIT # Required for systemd linking |
| 27 | |
Patrick Venture | f9a19b8 | 2018-09-18 10:03:24 -0700 | [diff] [blame] | 28 | PKG_PROG_PKG_CONFIG |
| 29 | AC_ARG_WITH([systemdsystemunitdir], |
| 30 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, |
| 31 | [with_systemdsystemunitdir=auto]) |
| 32 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ |
| 33 | def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 34 | |
| 35 | AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 36 | [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 37 | [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) |
| 38 | with_systemdsystemunitdir=no], |
| 39 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 40 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 41 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) |
| 42 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) |
| 43 | |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 44 | # Create configured output |
| 45 | AC_CONFIG_FILES([Makefile]) |
| 46 | AC_OUTPUT |