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 | |
Matt Spinler | f7616bc | 2019-11-19 09:23:37 -0600 | [diff] [blame] | 23 | YAML_DIRS="xyz" |
| 24 | |
| 25 | AC_ARG_ENABLE([openpower_dbus_interfaces], |
| 26 | AS_HELP_STRING([--enable-openpower-dbus-interfaces], [Enable the OpenPower D-Bus interfaces])) |
| 27 | |
| 28 | AS_IF([test "x$enable_openpower_dbus_interfaces" == "xyes"], [ |
| 29 | YAML_DIRS="$YAML_DIRS org/open_power" |
| 30 | ]) |
| 31 | |
Santosh Puranik | 83185d5 | 2019-10-18 02:01:09 -0500 | [diff] [blame^] | 32 | AC_ARG_ENABLE([ibm_dbus_interfaces], |
| 33 | AS_HELP_STRING([--enable-ibm-dbus-interfaces], [Enable the IBM D-Bus interfaces])) |
| 34 | |
| 35 | AS_IF([test "x$enable_ibm_dbus_interfaces" == "xyes"], [ |
| 36 | YAML_DIRS="$YAML_DIRS com/ibm" |
| 37 | ]) |
| 38 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 39 | AM_CONDITIONAL([WANT_LIBPHOSPHOR_DBUS], [test "x$enable_libphosphor_dbus" != "xno"]) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 40 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 41 | AS_IF([test "x$enable_libphosphor_dbus" != "xno"], [ |
| 42 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 43 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 44 | AC_MSG_ERROR([Cannot find sdbus++])) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 45 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 46 | # Checks for libraries. |
Patrick Venture | a0b543d | 2019-02-13 15:52:27 -0800 | [diff] [blame] | 47 | AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221]) |
| 48 | AX_PKG_CHECK_MODULES([SDBUSPLUS], [], [sdbusplus]) |
Patrick Williams | e1a8f36 | 2016-12-10 07:42:08 -0600 | [diff] [blame] | 49 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 50 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | b6af8b6 | 2018-10-04 10:26:17 -0700 | [diff] [blame] | 51 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 52 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 53 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 54 | |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 55 | # Checks for header files. |
William A. Kennington III | 6be5935 | 2018-01-24 15:06:33 -0800 | [diff] [blame] | 56 | old_CPPFLAGS="$CPPFLAGS" |
| 57 | CPPFLAGS="$SDBUSPLUS_CFLAGS $CPPFLAGS" |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 58 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...sdbusplus package required])]) |
William A. Kennington III | 6be5935 | 2018-01-24 15:06:33 -0800 | [diff] [blame] | 59 | CPPFLAGS="$old_CPPFLAGS" |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 60 | |
| 61 | # Checks for library functions. |
| 62 | LT_INIT([dlopen disable-static shared]) |
| 63 | LT_LIB_DLLOAD |
| 64 | |
| 65 | # Create configured output |
| 66 | AC_CONFIG_FILES([Makefile.interfaces], |
Matt Spinler | f7616bc | 2019-11-19 09:23:37 -0600 | [diff] [blame] | 67 | [${srcdir}/generate_makefile.sh ${srcdir} "$yamlDirs" > Makefile.interfaces], |
| 68 | [yamlDirs="$YAML_DIRS"]) |
Brad Bishop | 243cd14 | 2017-02-02 19:07:15 -0500 | [diff] [blame] | 69 | AC_CONFIG_FILES([phosphor-dbus-interfaces.pc]) |
| 70 | ]) |
Brad Bishop | d6f8a36 | 2017-02-02 11:57:39 -0500 | [diff] [blame] | 71 | AC_CONFIG_FILES([Makefile.yaml], |
Matt Spinler | f7616bc | 2019-11-19 09:23:37 -0600 | [diff] [blame] | 72 | [${srcdir}/generate_yaml_makefile.sh ${srcdir} "$yamlDirs" > Makefile.yaml], |
| 73 | [yamlDirs="$YAML_DIRS"]) |
Brad Bishop | d6f8a36 | 2017-02-02 11:57:39 -0500 | [diff] [blame] | 74 | |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 75 | AC_CONFIG_FILES([Makefile]) |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 76 | AC_OUTPUT |