Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-dbus-interfaces], [1.0], [https://github.com/openbmc/phosphor-dbus-interfaces]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 6 | AM_SILENT_RULES([yes]) |
Patrick Williams | e1a8f36 | 2016-12-10 07:42:08 -0600 | [diff] [blame] | 7 | AC_LANG([C++]) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AC_PROG_CC |
| 12 | AM_PROG_AR |
| 13 | AC_PROG_INSTALL |
| 14 | AC_PROG_MAKE_SET |
| 15 | AC_PROG_SED |
| 16 | AC_CHECK_PROG([FIND], find, find) |
| 17 | AC_CHECK_PROG([BASENAME], basename, basename) |
| 18 | AC_CHECK_PROG([DIRNAME], dirname, dirname) |
| 19 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 20 | AC_ARG_ENABLE([libphosphor_dbus], |
| 21 | AS_HELP_STRING([--disable-libphosphor_dbus], [Disable libphosphor_dbus])) |
Patrick Williams | e1a8f36 | 2016-12-10 07:42:08 -0600 | [diff] [blame] | 22 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 23 | AM_CONDITIONAL([WANT_LIBPHOSPHOR_DBUS], [test "x$enable_libphosphor_dbus" != "xno"]) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 24 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 25 | AS_IF([test "x$enable_libphosphor_dbus" != "xno"], [ |
| 26 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 27 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 28 | AC_MSG_ERROR([Cannot find sdbus++])) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 29 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 30 | # Checks for libraries. |
Brad Bishop | 89c2c18 | 2017-02-10 12:01:55 -0500 | [diff] [blame^] | 31 | AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found."])]) |
| 32 | AX_PKG_CHECK_MODULES([SDBUSPLUS], [], [sdbusplus], [], [AC_MSG_ERROR(["sdbusplus required and not found."])]) |
Patrick Williams | e1a8f36 | 2016-12-10 07:42:08 -0600 | [diff] [blame] | 33 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 34 | # Checks for typedefs, structures, and compiler characteristics. |
| 35 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 36 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 37 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 38 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 39 | # Checks for header files. |
| 40 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...sdbusplus package required])]) |
| 41 | |
| 42 | # Checks for library functions. |
| 43 | LT_INIT([dlopen disable-static shared]) |
| 44 | LT_LIB_DLLOAD |
| 45 | |
| 46 | # Create configured output |
| 47 | AC_CONFIG_FILES([Makefile.interfaces], |
| 48 | [${srcdir}/generate_makefile.sh ${srcdir} > Makefile.interfaces]) |
| 49 | AC_CONFIG_FILES([phosphor-dbus-interfaces.pc]) |
| 50 | ]) |
Brad Bishop | d6f8a36 | 2017-02-02 11:57:39 -0500 | [diff] [blame] | 51 | AC_CONFIG_FILES([Makefile.yaml], |
| 52 | [${srcdir}/generate_yaml_makefile.sh ${srcdir} > Makefile.yaml]) |
| 53 | |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 54 | AC_CONFIG_FILES([Makefile]) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 55 | AC_OUTPUT |