blob: 6b0fb98bfdbaf0e659fd9a8d18e55bb2f3e69d07 [file] [log] [blame]
Matthew Barthc91be8e2016-09-15 14:51:57 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([obmc-console], 1.0, [https://github.com/openbmc/obmc-console/issues])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
Jeremy Kerra58cf442016-03-16 12:09:00 +08006AM_SILENT_RULES([yes])
7
Matthew Barthc91be8e2016-09-15 14:51:57 -05008# Checks for programs.
Jeremy Kerra58cf442016-03-16 12:09:00 +08009AC_PROG_CC
Matthew Barthc91be8e2016-09-15 14:51:57 -050010AM_PROG_AR
11AC_PROG_INSTALL
12AC_PROG_MAKE_SET
Jeremy Kerra58cf442016-03-16 12:09:00 +080013
Matthew Barthc91be8e2016-09-15 14:51:57 -050014# Checks for libraries.
Andrew Jeffery9836e2b2020-02-11 12:12:07 +103015PKG_PROG_PKG_CONFIG
16
Cheng C Yangf9c8f6c2019-03-04 18:39:52 +080017PKG_CHECK_MODULES([SYSTEMD], [libsystemd > 221])
Matthew Barthc91be8e2016-09-15 14:51:57 -050018
19# Checks for header files.
20
21# Checks for typedefs, structures, and compiler characteristics.
22AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS])
23
24# Checks for library functions.
25LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
26
Andrew Jefferyfdf1a712020-02-28 11:52:48 +103027AC_ARG_WITH([udevdir],
28 AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev rules]),
29 [], [with_udevdir=${prefix}$($PKG_CONFIG --variable=udevdir udev)])
30if test "x$with_udevdir" != xno; then
31 AC_SUBST([udevdir], [$with_udevdir])
32fi
33AM_CONDITIONAL(WITH_UDEV, [test -n "$with_udevdir" -a "x$with_udevdir" != xno ])
34
Andrew Jeffery9836e2b2020-02-11 12:12:07 +103035AC_ARG_WITH([systemdsystemunitdir],
36 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
37 [], [with_systemdsystemunitdir=${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
38if test "x$with_systemdsystemunitdir" != xno; then
39 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
40fi
41AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
42
43AC_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"])
48AM_CONDITIONAL([ENABLE_CONCURRENT_SERVERS], [test "x$enable_concurrent_servers" = "xyes"])
49
Matthew Barthc91be8e2016-09-15 14:51:57 -050050# Check/set gtest specific functions.
51AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPP_FLAGS="-DGTEST_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])
Kun Yi9747d632018-06-22 15:32:05 -070059AS_IF([test "x$enable_oe_sdk" == "xyes"],
Matthew Barthc91be8e2016-09-15 14:51:57 -050060 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 Jeffery9836e2b2020-02-11 12:12:07 +103073AC_CONFIG_FILES([
Andrew Jefferyfdf1a712020-02-28 11:52:48 +103074 conf/80-obmc-console-uart.rules
Andrew Jeffery9836e2b2020-02-11 12:12:07 +103075 conf/client.2200.conf
76 conf/obmc-console@.service
Jonathan Domancc075302023-03-31 10:20:48 -070077 conf/obmc-console@.socket
Andrew Jeffery9836e2b2020-02-11 12:12:07 +103078 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 Kerra58cf442016-03-16 12:09:00 +080085AC_OUTPUT