blob: 8f37250eec03d40e02f6b1526c25bf4087ffd1c4 [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 Jeffery9836e2b2020-02-11 12:12:07 +103027AC_ARG_WITH([systemdsystemunitdir],
28 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
29 [], [with_systemdsystemunitdir=${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
30if test "x$with_systemdsystemunitdir" != xno; then
31 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
32fi
33AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
34
35AC_ARG_ENABLE([concurrent-servers],
36 [AS_HELP_STRING([--enable-concurrent-servers],
37 [Configure applications and systemd units for concurrent server instances])],
38 [],
39 [enable_concurrent_servers="no"])
40AM_CONDITIONAL([ENABLE_CONCURRENT_SERVERS], [test "x$enable_concurrent_servers" = "xyes"])
41
Matthew Barthc91be8e2016-09-15 14:51:57 -050042# Check/set gtest specific functions.
43AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPP_FLAGS="-DGTEST_HAS_PTHREAD=0"])
44AC_SUBST(GTEST_CPPFLAGS)
45
46AC_ARG_ENABLE([oe-sdk],
47 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
48)
49AC_ARG_VAR(OECORE_TARGET_SYSROOT,
50 [Path to the OE SDK SYSROOT])
Kun Yi9747d632018-06-22 15:32:05 -070051AS_IF([test "x$enable_oe_sdk" == "xyes"],
Matthew Barthc91be8e2016-09-15 14:51:57 -050052 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
53 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
54 )
55 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
56 [
57 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
58 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
59 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
60 ]
61 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
62)
63
64# Create configured output
Andrew Jeffery9836e2b2020-02-11 12:12:07 +103065AC_CONFIG_FILES([
66 conf/client.2200.conf
67 conf/obmc-console@.service
68 conf/obmc-console-ssh@.service
69 conf/obmc-console-ssh@.service.d/use-socket.conf
70 conf/obmc-console-ssh.socket
71 conf/server.ttyVUART0.conf
72 Makefile
73 test/Makefile
74 ])
Jeremy Kerra58cf442016-03-16 12:09:00 +080075AC_OUTPUT