blob: 17a8efb679aebecbb89f5eb9c8930fd0c4859b9d [file] [log] [blame]
Matthew Barth5e60ba52016-09-26 13:40:01 -05001# Initializaion
2AC_PREREQ([2.69])
3AC_INIT([phosphor-networkd], [1.0], [https://github.com/openbmc/phosphor-networkd/issues])
Ratan Gupta8c834932017-04-14 16:30:24 +05304AC_LANG([C++])
Matthew Barth5e60ba52016-09-26 13:40:01 -05005AC_CONFIG_HEADERS([config.h])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
Ratan Gupta8c834932017-04-14 16:30:24 +05309
10# Checks for typedefs, structures, and compiler characteristics.
11AX_CXX_COMPILE_STDCXX_14([noext])
12AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS])
13
Matthew Barth5e60ba52016-09-26 13:40:01 -050014# Checks for programs.
Ratan Gupta8c834932017-04-14 16:30:24 +053015AC_PROG_CXX
Matthew Barth5e60ba52016-09-26 13:40:01 -050016AC_PROG_CC
17AM_PROG_AR
18AC_PROG_INSTALL
19AC_PROG_MAKE_SET
20
Ratan Gupta8c834932017-04-14 16:30:24 +053021# Surpress the --with-libtool-sysroot error
22LT_INIT
23
Matthew Barth5e60ba52016-09-26 13:40:01 -050024# Checks for libraries.
25PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
26
Ratan Gupta8c834932017-04-14 16:30:24 +053027PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
28AC_MSG_ERROR(["Requires sdbusplus package."]))
29
Ratan Guptabf9ba402017-04-14 17:16:04 +053030
31AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
32
Ratan Gupta8c834932017-04-14 16:30:24 +053033PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
34AC_MSG_ERROR(["Requires phosphor-logging package."]))
35
Matthew Barth5e60ba52016-09-26 13:40:01 -050036# Checks for header files.
Ratan Gupta8c834932017-04-14 16:30:24 +053037AC_CHECK_HEADER(systemd/sd-bus.h, ,\
38[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
39
40AX_PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [], [phosphor-dbus-interfaces],\
41[], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])])
Matthew Barth5e60ba52016-09-26 13:40:01 -050042
43# Checks for typedefs, structures, and compiler characteristics.
44AX_APPEND_COMPILE_FLAGS([-Wall -Werror -Wno-unused-result], [CFLAGS])
45
46# Checks for library functions.
47LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
48
Ratan Gupta8c834932017-04-14 16:30:24 +053049
Matthew Barth5e60ba52016-09-26 13:40:01 -050050# Check/set gtest specific functions.
51AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
52AC_SUBST(GTEST_CPPFLAGS)
53
54AC_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)
57AC_ARG_VAR(OECORE_TARGET_SYSROOT,
58 [Path to the OE SDK SYSROOT])
59AS_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
Ratan Gupta8c834932017-04-14 16:30:24 +053072AC_ARG_VAR(BUSNAME_NETWORK, [The Dbus busname to own])
73AS_IF([test "x$BUSNAME_NETWORK" == "x"], [BUSNAME_NETWORK="xyz.openbmc_project.Network"])
74AC_DEFINE_UNQUOTED([BUSNAME_NETWORK], ["$BUSNAME_NETWORK"], [The DBus busname to own])
75
76AC_ARG_VAR(OBJ_NETWORK, [The network manager DBus object path])
77AS_IF([test "x$OBJ_NETWORK" == "x"], [OBJ_NETWORK="/xyz/openbmc_project/network"])
78AC_DEFINE_UNQUOTED([OBJ_NETWORK], ["$OBJ_NETWORK"], [The network manager DBus object path])
79
Matthew Barth5e60ba52016-09-26 13:40:01 -050080# Create configured output.
81AC_CONFIG_FILES([Makefile])
82AC_OUTPUT