Matt Spinler | 66e7aa3 | 2018-03-26 15:07:13 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([ibm-dbus-interfaces], [1.0], [https://github.com/openbmc/ibm-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 | AM_PROG_AR |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
| 14 | AC_PROG_SED |
| 15 | AC_CHECK_PROG([FIND], find, find) |
| 16 | AC_CHECK_PROG([BASENAME], basename, basename) |
| 17 | AC_CHECK_PROG([DIRNAME], dirname, dirname) |
| 18 | |
| 19 | AC_ARG_ENABLE([libibm_dbus], |
| 20 | AS_HELP_STRING([--disable-libibm_dbus], [Disable libibm_dbus])) |
| 21 | |
| 22 | AM_CONDITIONAL([WANT_LIBIBM_DBUS], [test "x$enable_libibm_dbus" != "xno"]) |
| 23 | |
| 24 | AS_IF([test "x$enable_libibm_dbus" != "xno"], [ |
| 25 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 26 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 27 | AC_MSG_ERROR([Cannot find sdbus++])) |
| 28 | |
| 29 | # Checks for libraries. |
Patrick Venture | 109271b | 2019-02-13 15:47:56 -0800 | [diff] [blame] | 30 | AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221]) |
| 31 | AX_PKG_CHECK_MODULES([SDBUSPLUS], [], [sdbusplus]) |
Matt Spinler | 66e7aa3 | 2018-03-26 15:07:13 -0500 | [diff] [blame] | 32 | |
| 33 | # Check for baseline language coverage in the compiler for the C++14 standard |
Vernon Mauery | c9ae6bf | 2018-10-04 10:30:00 -0700 | [diff] [blame] | 34 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Matt Spinler | 66e7aa3 | 2018-03-26 15:07:13 -0500 | [diff] [blame] | 35 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 36 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 37 | |
| 38 | # Checks for header files. |
| 39 | old_CPPFLAGS="$CPPFLAGS" |
| 40 | CPPFLAGS="$SDBUSPLUS_CFLAGS $CPPFLAGS" |
| 41 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...sdbusplus package required])]) |
| 42 | CPPFLAGS="$old_CPPFLAGS" |
| 43 | |
| 44 | # Checks for library functions. |
| 45 | LT_INIT([dlopen disable-static shared]) |
| 46 | LT_LIB_DLLOAD |
| 47 | |
| 48 | # Create configured output |
| 49 | AC_CONFIG_FILES([Makefile.interfaces], |
| 50 | [${srcdir}/generate_makefile.sh ${srcdir} > Makefile.interfaces]) |
| 51 | AC_CONFIG_FILES([ibm-dbus-interfaces.pc]) |
| 52 | ]) |
| 53 | AC_CONFIG_FILES([Makefile.yaml], |
| 54 | [${srcdir}/generate_yaml_makefile.sh ${srcdir} > Makefile.yaml]) |
| 55 | |
| 56 | AC_CONFIG_FILES([Makefile]) |
| 57 | AC_OUTPUT |