blob: 43a486984daf6ffda5b0a94d056c5be6ab4875dd [file] [log] [blame]
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +05301# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-user-manager], [1.0], [https://github.com/openbmc/phosphor-user-manager/issues])
4AC_LANG([C++])
5AC_CONFIG_HEADERS([config.h])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
9# Checks for programs.
10AC_PROG_CXX
11AC_PROG_INSTALL
12AC_PROG_MAKE_SET
13
Vishwanatha Subbannad20225f2017-09-06 11:36:04 +053014# Checks for libraries.
Patrick Venture5e8ccb92019-02-13 14:54:49 -080015PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
16PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
17PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
Vishwanatha Subbannad20225f2017-09-06 11:36:04 +053018
19AC_ARG_VAR(USER_MANAGER_BUSNAME, [The Dbus busname to own])
20AS_IF([test "x$USER_MANAGER_BUSNAME" == "x"], [USER_MANAGER_BUSNAME="xyz.openbmc_project.User.Manager"])
21AC_DEFINE_UNQUOTED([USER_MANAGER_BUSNAME], ["$USER_MANAGER_BUSNAME"], [The DBus busname to own])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +053022
Tom Joseph536ea322018-09-14 10:02:20 +053023AC_ARG_VAR(LDAP_MAPPER_MANAGER_BUSNAME, [The Dbus busname LDAP privilege mapper application])
24AS_IF([test "x$LDAP_MAPPER_MANAGER_BUSNAME" == "x"], [LDAP_MAPPER_MANAGER_BUSNAME="xyz.openbmc_project.LDAP.PrivilegeMapper"])
25AC_DEFINE_UNQUOTED([LDAP_MAPPER_MANAGER_BUSNAME], ["$LDAP_MAPPER_MANAGER_BUSNAME"], [The Dbus busname LDAP privilege mapper application])
26
Tom Joseph0b14c472018-09-30 01:42:59 +053027AC_ARG_VAR(LDAP_MAPPER_PERSIST_PATH, [Path of directory containing LDAP groups privilege mapping])
28AS_IF([test "x$LDAP_MAPPER_PERSIST_PATH" == "x"], \
29 [LDAP_MAPPER_PERSIST_PATH="/var/lib/phosphor-ldap-mapper/groups"])
30AC_DEFINE_UNQUOTED([LDAP_MAPPER_PERSIST_PATH], ["$LDAP_MAPPER_PERSIST_PATH"], \
31 [Path of directory containing LDAP groups privilege mapping])
32
33AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal])
34AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1])
35AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal])
36
Vishwanatha Subbanna070a3e42017-09-06 11:40:45 +053037# Default crypt algorithm to choose if one not found in shadow file
38# Per crypt(3), 1 is for MD5
39AC_ARG_VAR(DEFAULT_CRYPT_ALGO, [The default crypt algorithm if one not found in shadow])
40AS_IF([test "x$DEFAULT_CRYPT_ALGO" == "x"], [DEFAULT_CRYPT_ALGO="1"])
41AC_DEFINE_UNQUOTED([DEFAULT_CRYPT_ALGO], ["$DEFAULT_CRYPT_ALGO"], [The default crypt algorithm if one not found in shadow])
42
Vishwanatha Subbanna035a9692017-09-15 18:50:43 +053043# Check/set gtest specific functions.
44AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
45AC_SUBST(GTEST_CPPFLAGS)
46
47# Test cases require SDK so only build if we're told to (and SDK is available)
48AC_ARG_ENABLE([oe-sdk],
49 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
50)
51AC_ARG_VAR(OECORE_TARGET_SYSROOT,
52 [Path to the OE SDK SYSROOT])
53AS_IF([test "x$enable_oe_sdk" == "xyes"],
54 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
55 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
56 )
57 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
58 [
59 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
60 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
61 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
62 ]
63 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
64)
65
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -050066AC_ARG_VAR(LDAP_CONFIG_FILE, [Path of LDAP configuration file])
67AS_IF([test "x$LDAP_CONFIG_FILE" == "x"], [LDAP_CONFIG_FILE="/etc/nslcd.conf"])
68AC_DEFINE_UNQUOTED([LDAP_CONFIG_FILE], ["$LDAP_CONFIG_FILE"], [Path of LDAP configuration file])
69
Zbigniew Kurzynski5d00cf22019-10-03 12:10:20 +020070AC_ARG_VAR(TLS_CACERT_PATH, [Path of LDAP server's CA certificate])
71AS_IF([test "x$TLS_CACERT_PATH" == "x"], [TLS_CACERT_PATH="/etc/ssl/certs/authority"])
72AC_DEFINE_UNQUOTED([TLS_CACERT_PATH], ["$TLS_CACERT_PATH"], [Path of LDAP server's CA certificate])
Nagaraju Gorugantid514e5d2018-11-08 03:07:25 -060073
Ratan Gupta22f13f12019-04-29 15:36:40 +053074AC_ARG_VAR(TLS_CERT_FILE, [Path of LDAP's client certificate])
75AS_IF([test "x$TLS_CERT_FILE" == "x"], [TLS_CERT_FILE="/etc/nslcd/certs/cert.pem"])
76AC_DEFINE_UNQUOTED([TLS_CERT_FILE], ["$TLS_CERT_FILE"], [Path of LDAP's client certificate])
77
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -050078AC_ARG_VAR(LDAP_CONFIG_ROOT, [LDAP configuration root])
79AS_IF([test "x$LDAP_CONFIG_ROOT" == "x"], [LDAP_CONFIG_ROOT="/xyz/openbmc_project/user/ldap"])
80AC_DEFINE_UNQUOTED([LDAP_CONFIG_ROOT], ["$LDAP_CONFIG_ROOT"], [LDAP configuration root])
81
82AC_ARG_VAR(LDAP_CONFIG_DBUS_OBJ_PATH, [D-Bus path of LDAP config object])
83AS_IF([test "x$LDAP_CONFIG_DBUS_OBJ_PATH" == "x"], [LDAP_CONFIG_DBUS_OBJ_PATH="/xyz/openbmc_project/user/ldap/config"])
84AC_DEFINE_UNQUOTED([LDAP_CONFIG_DBUS_OBJ_PATH], ["$LDAP_CONFIG_DBUS_OBJ_PATH"], [D-Bus path of LDAP config object])
85
86AC_ARG_VAR(LDAP_CONFIG_BUSNAME, [D-Bus busname of LDAP config service])
87AS_IF([test "x$LDAP_CONFIG_BUSNAME" == "x"], [LDAP_CONFIG_BUSNAME="xyz.openbmc_project.Ldap.Config"])
88AC_DEFINE_UNQUOTED([LDAP_CONFIG_BUSNAME], ["$LDAP_CONFIG_BUSNAME"], [D-Bus busname of LDAP config service])
89
Ratan Gupta95a29312019-02-18 20:34:10 +053090AC_ARG_VAR(LDAP_CONF_PERSIST_PATH, [directory path to persist LDAP enabled property.])
91AS_IF([test "x$LDAP_CONF_PERSIST_PATH" == "x"], \
Ratan Gupta21e88cb2019-04-12 17:15:52 +053092 [LDAP_CONF_PERSIST_PATH="/var/lib/phosphor-ldap-conf"])
Ratan Gupta95a29312019-02-18 20:34:10 +053093AC_DEFINE_UNQUOTED([LDAP_CONF_PERSIST_PATH], ["$LDAP_CONF_PERSIST_PATH"], \
94 [path of directory having persisted LDAP configuration enabled property.])
95
Richard Marian Thomaiyar73ce7732020-05-28 08:58:55 +053096AC_ARG_ENABLE([root_user_mgmt],
97 AS_HELP_STRING([--disable-root_user_mgmt], [Disables managing root user. [default=enable]])
98)
Richard Marian Thomaiyard4d65502019-11-02 21:02:03 +053099AS_IF([test "x$enable_root_user_mgmt" != "xno"],
100 AC_MSG_NOTICE([Enable managing root user])
101 [cpp_flags="-DENABLE_ROOT_USER_MGMT"]
102 AC_SUBST([CPPFLAGS], [$cpp_flags]),
103 AC_MSG_WARN([Disable managing root user])
104)
105
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -0500106AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.])
107AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.])
108AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.])
109
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530110# Checks for typedefs, structures, and compiler characteristics.
Vernon Mauery3618f442018-10-04 10:23:01 -0700111AX_CXX_COMPILE_STDCXX_17([noext])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530112AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
113
114# For libtools
115LT_INIT
116
117# Create configured output
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -0500118AC_CONFIG_FILES([Makefile test/Makefile phosphor-ldap-mapper/Makefile phosphor-ldap-config/Makefile])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530119AC_OUTPUT