blob: a2bfc73738e748c239ccb4fd823480b00958fd65 [file] [log] [blame]
Patrick Williams0be05ee2016-12-09 14:30:45 -06001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-dbus-interfaces], [1.0], [https://github.com/openbmc/phosphor-dbus-interfaces])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
Patrick Williamse1a8f362016-12-10 07:42:08 -06007AC_LANG([C++])
Patrick Williams0be05ee2016-12-09 14:30:45 -06008
9# Checks for programs.
10AC_PROG_CXX
11AC_PROG_CC
12AM_PROG_AR
13AC_PROG_INSTALL
14AC_PROG_MAKE_SET
15AC_PROG_SED
16AC_CHECK_PROG([FIND], find, find)
17AC_CHECK_PROG([BASENAME], basename, basename)
18AC_CHECK_PROG([DIRNAME], dirname, dirname)
19
Brad Bishop243cd142017-02-02 19:07:15 -050020AC_ARG_ENABLE([libphosphor_dbus],
21 AS_HELP_STRING([--disable-libphosphor_dbus], [Disable libphosphor_dbus]))
Patrick Williamse1a8f362016-12-10 07:42:08 -060022
Matt Spinlerf7616bc2019-11-19 09:23:37 -060023YAML_DIRS="xyz"
24
25AC_ARG_ENABLE([openpower_dbus_interfaces],
26 AS_HELP_STRING([--enable-openpower-dbus-interfaces], [Enable the OpenPower D-Bus interfaces]))
27
28AS_IF([test "x$enable_openpower_dbus_interfaces" == "xyes"], [
29 YAML_DIRS="$YAML_DIRS org/open_power"
30])
31
Brad Bishop243cd142017-02-02 19:07:15 -050032AM_CONDITIONAL([WANT_LIBPHOSPHOR_DBUS], [test "x$enable_libphosphor_dbus" != "xno"])
Patrick Williams0be05ee2016-12-09 14:30:45 -060033
Brad Bishop243cd142017-02-02 19:07:15 -050034AS_IF([test "x$enable_libphosphor_dbus" != "xno"], [
35 AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
36 AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
37 AC_MSG_ERROR([Cannot find sdbus++]))
Patrick Williams0be05ee2016-12-09 14:30:45 -060038
Brad Bishop243cd142017-02-02 19:07:15 -050039 # Checks for libraries.
Patrick Venturea0b543d2019-02-13 15:52:27 -080040 AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221])
41 AX_PKG_CHECK_MODULES([SDBUSPLUS], [], [sdbusplus])
Patrick Williamse1a8f362016-12-10 07:42:08 -060042
Brad Bishop243cd142017-02-02 19:07:15 -050043 # Checks for typedefs, structures, and compiler characteristics.
Vernon Maueryb6af8b62018-10-04 10:26:17 -070044 AX_CXX_COMPILE_STDCXX_17([noext])
Brad Bishop243cd142017-02-02 19:07:15 -050045 AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS])
46 AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
Patrick Williams0be05ee2016-12-09 14:30:45 -060047
Brad Bishop243cd142017-02-02 19:07:15 -050048 # Checks for header files.
William A. Kennington III6be59352018-01-24 15:06:33 -080049 old_CPPFLAGS="$CPPFLAGS"
50 CPPFLAGS="$SDBUSPLUS_CFLAGS $CPPFLAGS"
Brad Bishop243cd142017-02-02 19:07:15 -050051 AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...sdbusplus package required])])
William A. Kennington III6be59352018-01-24 15:06:33 -080052 CPPFLAGS="$old_CPPFLAGS"
Brad Bishop243cd142017-02-02 19:07:15 -050053
54 # Checks for library functions.
55 LT_INIT([dlopen disable-static shared])
56 LT_LIB_DLLOAD
57
58 # Create configured output
59 AC_CONFIG_FILES([Makefile.interfaces],
Matt Spinlerf7616bc2019-11-19 09:23:37 -060060 [${srcdir}/generate_makefile.sh ${srcdir} "$yamlDirs" > Makefile.interfaces],
61 [yamlDirs="$YAML_DIRS"])
Brad Bishop243cd142017-02-02 19:07:15 -050062 AC_CONFIG_FILES([phosphor-dbus-interfaces.pc])
63])
Brad Bishopd6f8a362017-02-02 11:57:39 -050064AC_CONFIG_FILES([Makefile.yaml],
Matt Spinlerf7616bc2019-11-19 09:23:37 -060065 [${srcdir}/generate_yaml_makefile.sh ${srcdir} "$yamlDirs" > Makefile.yaml],
66 [yamlDirs="$YAML_DIRS"])
Brad Bishopd6f8a362017-02-02 11:57:39 -050067
Patrick Williams0be05ee2016-12-09 14:30:45 -060068AC_CONFIG_FILES([Makefile])
Patrick Williams0be05ee2016-12-09 14:30:45 -060069AC_OUTPUT