Vishwanatha Subbanna | affea8b | 2017-04-04 14:02:16 +0530 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-gpio-monitor], [1.0], [https://github.com/openbmc/phosphor-gpio-monitor/issues]) |
| 4 | AC_LANG([C++]) |
| 5 | AC_CONFIG_HEADERS([config.h]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AC_PROG_INSTALL |
Vishwanatha Subbanna | affea8b | 2017-04-04 14:02:16 +0530 | [diff] [blame] | 12 | |
| 13 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | bd0904b | 2018-10-04 09:26:29 -0700 | [diff] [blame] | 14 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Vishwanatha Subbanna | affea8b | 2017-04-04 14:02:16 +0530 | [diff] [blame] | 15 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 16 | |
| 17 | # For linking |
| 18 | LT_INIT |
| 19 | |
Vishwanatha Subbanna | 4902a10 | 2017-04-04 14:05:09 +0530 | [diff] [blame] | 20 | # Checks for modules |
Patrick Venture | 47044e6 | 2019-02-13 15:34:39 -0800 | [diff] [blame] | 21 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 22 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 23 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
| 24 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
| 25 | PKG_CHECK_MODULES([LIBEVDEV], [libevdev]) |
Vishwanatha Subbanna | 4902a10 | 2017-04-04 14:05:09 +0530 | [diff] [blame] | 26 | |
Matt Spinler | 36df197 | 2017-05-25 10:23:05 -0500 | [diff] [blame] | 27 | # Download gpio.h from github if necessary. |
| 28 | AC_CHECK_HEADER(linux/gpio.h,[HAVE_LINUX_GPIO_H=""],[HAVE_LINUX_GPIO_H="-I linux/gpio.h"]) |
| 29 | AS_IF([test "$HAVE_LINUX_GPIO_H" != ""], |
| 30 | AC_MSG_WARN([Could not find linux/gpio.h: Attempting to download locally for building from https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/gpio.h]) |
| 31 | AC_SUBST([BT_BMC_DL],[`mkdir -p linux;wget https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/gpio.h -O linux/gpio.h`]) |
| 32 | ) |
| 33 | |
Vishwanatha Subbanna | 32c9727 | 2017-04-04 14:10:08 +0530 | [diff] [blame] | 34 | # Check/set gtest specific functions. |
| 35 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 36 | AC_SUBST(GTEST_CPPFLAGS) |
| 37 | AC_ARG_ENABLE([oe-sdk], |
| 38 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 39 | ) |
| 40 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 41 | [Path to the OE SDK SYSROOT]) |
| 42 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 43 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 44 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 45 | ) |
| 46 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 47 | [ |
| 48 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 49 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 50 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 51 | ] |
| 52 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 53 | ) |
| 54 | |
Vishwanatha Subbanna | affea8b | 2017-04-04 14:02:16 +0530 | [diff] [blame] | 55 | # Create configured output |
Gunnar Mills | 7263915 | 2017-06-22 15:06:21 -0500 | [diff] [blame] | 56 | AC_CONFIG_FILES([Makefile gpio-util/Makefile presence/Makefile test/Makefile]) |
Vishwanatha Subbanna | affea8b | 2017-04-04 14:02:16 +0530 | [diff] [blame] | 57 | AC_OUTPUT |