Yong Li | 7e8ef4f | 2018-11-07 13:28:53 +0800 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([intel-dbus-interfaces], [1.0], [https://github.com/openbmc/intel-dbus-interfaces]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 6 | AM_SILENT_RULES([yes]) |
| 7 | AC_LANG([C++]) |
| 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 | |
| 20 | AC_ARG_ENABLE([libintel_dbus], |
| 21 | AS_HELP_STRING([--disable-libintel_dbus], [Disable libintel_dbus])) |
| 22 | |
| 23 | AM_CONDITIONAL([WANT_LIBINTEL_DBUS], [test "x$enable_libintel_dbus" != "xno"]) |
| 24 | |
| 25 | AS_IF([test "x$enable_libintel_dbus" != "xno"], [ |
| 26 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 27 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 28 | AC_MSG_ERROR([Cannot find sdbus++])) |
| 29 | |
| 30 | # Checks for libraries. |
Patrick Venture | 2b8f89f | 2019-02-13 15:24:47 -0800 | [diff] [blame] | 31 | AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221]) |
| 32 | AX_PKG_CHECK_MODULES([SDBUSPLUS], [], [sdbusplus]) |
Yong Li | 7e8ef4f | 2018-11-07 13:28:53 +0800 | [diff] [blame] | 33 | |
| 34 | # Checks for typedefs, structures, and compiler characteristics. |
| 35 | AX_CXX_COMPILE_STDCXX_17([noext]) |
| 36 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 37 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 38 | |
| 39 | # Checks for header files. |
| 40 | old_CPPFLAGS="$CPPFLAGS" |
| 41 | CPPFLAGS="$SDBUSPLUS_CFLAGS $CPPFLAGS" |
| 42 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...sdbusplus package required])]) |
| 43 | CPPFLAGS="$old_CPPFLAGS" |
| 44 | |
| 45 | # Checks for library functions. |
| 46 | LT_INIT([dlopen disable-static shared]) |
| 47 | LT_LIB_DLLOAD |
| 48 | |
| 49 | # Create configured output |
| 50 | AC_CONFIG_FILES([Makefile.interfaces], |
| 51 | [${srcdir}/generate_makefile.sh ${srcdir} > Makefile.interfaces]) |
| 52 | AC_CONFIG_FILES([intel-dbus-interfaces.pc]) |
| 53 | ]) |
| 54 | AC_CONFIG_FILES([Makefile.yaml], |
| 55 | [${srcdir}/generate_yaml_makefile.sh ${srcdir} > Makefile.yaml]) |
| 56 | |
| 57 | AC_CONFIG_FILES([Makefile]) |
| 58 | AC_OUTPUT |