Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 1 | # Initializaion |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-networkd], [1.0], [https://github.com/openbmc/phosphor-networkd/issues]) |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 4 | AC_LANG([C++]) |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 5 | AC_CONFIG_HEADERS([config.h]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 9 | |
| 10 | # Checks for typedefs, structures, and compiler characteristics. |
| 11 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 12 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) |
| 13 | |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 14 | # Checks for programs. |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 15 | AC_PROG_CXX |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 16 | AC_PROG_CC |
| 17 | AM_PROG_AR |
| 18 | AC_PROG_INSTALL |
| 19 | AC_PROG_MAKE_SET |
| 20 | |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 21 | # Surpress the --with-libtool-sysroot error |
| 22 | LT_INIT |
| 23 | |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 24 | # Checks for libraries. |
| 25 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 26 | |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 27 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\ |
| 28 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 29 | |
Ratan Gupta | bf9ba40 | 2017-04-14 17:16:04 +0530 | [diff] [blame] | 30 | |
| 31 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 32 | |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 33 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 34 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
| 35 | |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 36 | # Checks for header files. |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 37 | AC_CHECK_HEADER(systemd/sd-bus.h, ,\ |
| 38 | [AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
| 39 | |
| 40 | AX_PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [], [phosphor-dbus-interfaces],\ |
| 41 | [], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])]) |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 42 | |
| 43 | # Checks for typedefs, structures, and compiler characteristics. |
| 44 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror -Wno-unused-result], [CFLAGS]) |
| 45 | |
| 46 | # Checks for library functions. |
| 47 | LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' |
| 48 | |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 49 | |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 50 | # Check/set gtest specific functions. |
| 51 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"]) |
| 52 | AC_SUBST(GTEST_CPPFLAGS) |
| 53 | |
| 54 | AC_ARG_ENABLE([oe-sdk], |
| 55 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 56 | ) |
| 57 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 58 | [Path to the OE SDK SYSROOT]) |
| 59 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 60 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 61 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 62 | ) |
| 63 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 64 | [ |
| 65 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 66 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 67 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 68 | ] |
| 69 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 70 | ) |
| 71 | |
Vishwanatha Subbanna | 18891c6 | 2017-10-17 15:22:46 +0530 | [diff] [blame] | 72 | AC_ARG_VAR(DNS_ENTRY_FILE, [File having DNS entries supplied by DHCP]) |
| 73 | AS_IF([test "x$DNS_ENTRY_FILE" == "x"], [DNS_ENTRY_FILE="/run/systemd/netif/state"]) |
| 74 | AC_DEFINE_UNQUOTED([DNS_ENTRY_FILE], ["$DNS_ENTRY_FILE"], [File having DNS entries supplied by DHCP]) |
| 75 | |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 76 | AC_ARG_VAR(BUSNAME_NETWORK, [The Dbus busname to own]) |
| 77 | AS_IF([test "x$BUSNAME_NETWORK" == "x"], [BUSNAME_NETWORK="xyz.openbmc_project.Network"]) |
| 78 | AC_DEFINE_UNQUOTED([BUSNAME_NETWORK], ["$BUSNAME_NETWORK"], [The DBus busname to own]) |
| 79 | |
| 80 | AC_ARG_VAR(OBJ_NETWORK, [The network manager DBus object path]) |
| 81 | AS_IF([test "x$OBJ_NETWORK" == "x"], [OBJ_NETWORK="/xyz/openbmc_project/network"]) |
| 82 | AC_DEFINE_UNQUOTED([OBJ_NETWORK], ["$OBJ_NETWORK"], [The network manager DBus object path]) |
| 83 | |
Ratan Gupta | d8edf11 | 2017-05-14 11:53:18 +0530 | [diff] [blame] | 84 | AC_ARG_VAR(NETWORK_CONF_DIR, [Network configuration directory]) |
| 85 | AS_IF([test "x$NETWORK_CONF_DIR" == "x"], [NETWORK_CONF_DIR="/etc/systemd/network"]) |
| 86 | AC_DEFINE_UNQUOTED([NETWORK_CONF_DIR], ["$NETWORK_CONF_DIR"], [Network configuration directory]) |
| 87 | |
Ratan Gupta | 4f1c18b | 2017-05-25 12:59:35 +0530 | [diff] [blame] | 88 | AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.]) |
| 89 | AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.]) |
| 90 | AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.]) |
| 91 | |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 92 | # Create configured output. |
Ratan Gupta | 594123d | 2017-05-16 22:48:35 +0530 | [diff] [blame] | 93 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Matthew Barth | 5e60ba5 | 2016-09-26 13:40:01 -0500 | [diff] [blame] | 94 | AC_OUTPUT |