Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([obmc-console], 1.0, [https://github.com/openbmc/obmc-console/issues]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 6 | AM_SILENT_RULES([yes]) |
| 7 | |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 8 | # Checks for programs. |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 9 | AC_PROG_CC |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 10 | AM_PROG_AR |
| 11 | AC_PROG_INSTALL |
| 12 | AC_PROG_MAKE_SET |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 13 | |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 14 | # Checks for libraries. |
Andrew Jeffery | 9836e2b | 2020-02-11 12:12:07 +1030 | [diff] [blame] | 15 | PKG_PROG_PKG_CONFIG |
| 16 | |
Cheng C Yang | f9c8f6c | 2019-03-04 18:39:52 +0800 | [diff] [blame] | 17 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd > 221]) |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 18 | |
| 19 | # Checks for header files. |
| 20 | |
| 21 | # Checks for typedefs, structures, and compiler characteristics. |
| 22 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 23 | |
| 24 | # Checks for library functions. |
| 25 | LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' |
| 26 | |
Andrew Jeffery | fdf1a71 | 2020-02-28 11:52:48 +1030 | [diff] [blame] | 27 | AC_ARG_WITH([udevdir], |
| 28 | AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev rules]), |
| 29 | [], [with_udevdir=${prefix}$($PKG_CONFIG --variable=udevdir udev)]) |
| 30 | if test "x$with_udevdir" != xno; then |
| 31 | AC_SUBST([udevdir], [$with_udevdir]) |
| 32 | fi |
| 33 | AM_CONDITIONAL(WITH_UDEV, [test -n "$with_udevdir" -a "x$with_udevdir" != xno ]) |
| 34 | |
Andrew Jeffery | 9836e2b | 2020-02-11 12:12:07 +1030 | [diff] [blame] | 35 | AC_ARG_WITH([systemdsystemunitdir], |
| 36 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), |
| 37 | [], [with_systemdsystemunitdir=${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) |
| 38 | if test "x$with_systemdsystemunitdir" != xno; then |
| 39 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) |
| 40 | fi |
| 41 | AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) |
| 42 | |
| 43 | AC_ARG_ENABLE([concurrent-servers], |
| 44 | [AS_HELP_STRING([--enable-concurrent-servers], |
| 45 | [Configure applications and systemd units for concurrent server instances])], |
| 46 | [], |
| 47 | [enable_concurrent_servers="no"]) |
| 48 | AM_CONDITIONAL([ENABLE_CONCURRENT_SERVERS], [test "x$enable_concurrent_servers" = "xyes"]) |
| 49 | |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 50 | # Check/set gtest specific functions. |
| 51 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPP_FLAGS="-DGTEST_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]) |
Kun Yi | 9747d63 | 2018-06-22 15:32:05 -0700 | [diff] [blame] | 59 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
Matthew Barth | c91be8e | 2016-09-15 14:51:57 -0500 | [diff] [blame] | 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 | |
| 72 | # Create configured output |
Andrew Jeffery | 9836e2b | 2020-02-11 12:12:07 +1030 | [diff] [blame] | 73 | AC_CONFIG_FILES([ |
Andrew Jeffery | fdf1a71 | 2020-02-28 11:52:48 +1030 | [diff] [blame] | 74 | conf/80-obmc-console-uart.rules |
Andrew Jeffery | 9836e2b | 2020-02-11 12:12:07 +1030 | [diff] [blame] | 75 | conf/client.2200.conf |
| 76 | conf/obmc-console@.service |
Jonathan Doman | cc07530 | 2023-03-31 10:20:48 -0700 | [diff] [blame] | 77 | conf/obmc-console@.socket |
Andrew Jeffery | 9836e2b | 2020-02-11 12:12:07 +1030 | [diff] [blame] | 78 | conf/obmc-console-ssh@.service |
| 79 | conf/obmc-console-ssh@.service.d/use-socket.conf |
| 80 | conf/obmc-console-ssh.socket |
| 81 | conf/server.ttyVUART0.conf |
| 82 | Makefile |
| 83 | test/Makefile |
| 84 | ]) |
Jeremy Kerr | a58cf44 | 2016-03-16 12:09:00 +0800 | [diff] [blame] | 85 | AC_OUTPUT |