blob: 97e5321141a20c5b2550ecdd9e24cee446f17084 [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
Anton D. Kachalovb36b11c2021-03-19 10:38:57 +010066AC_ARG_WITH([systemdsystemunitdir],
67 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],
68 [],
69 [with_systemdsystemunitdir=auto]
70)
71AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
72 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
73 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
74 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
75 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]
76 )
77 with_systemdsystemunitdir=no],
78 [with_systemdsystemunitdir="$def_systemdsystemunitdir"]
79 )]
80)
81AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
82 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]
83)
84
85AC_ARG_WITH([dbuspolicydir],
86 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
87 [],
Patrick Williamsc0760c92021-10-04 12:06:42 -050088 [with_dbuspolicydir=${datadir}/dbus-1/system.d])
Anton D. Kachalovb36b11c2021-03-19 10:38:57 +010089AS_IF([test "x$with_dbuspolicydir" != "xno"],
90 [AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])]
91)
92
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -050093AC_ARG_VAR(LDAP_CONFIG_FILE, [Path of LDAP configuration file])
94AS_IF([test "x$LDAP_CONFIG_FILE" == "x"], [LDAP_CONFIG_FILE="/etc/nslcd.conf"])
95AC_DEFINE_UNQUOTED([LDAP_CONFIG_FILE], ["$LDAP_CONFIG_FILE"], [Path of LDAP configuration file])
96
Zbigniew Kurzynski5d00cf22019-10-03 12:10:20 +020097AC_ARG_VAR(TLS_CACERT_PATH, [Path of LDAP server's CA certificate])
98AS_IF([test "x$TLS_CACERT_PATH" == "x"], [TLS_CACERT_PATH="/etc/ssl/certs/authority"])
99AC_DEFINE_UNQUOTED([TLS_CACERT_PATH], ["$TLS_CACERT_PATH"], [Path of LDAP server's CA certificate])
Nagaraju Gorugantid514e5d2018-11-08 03:07:25 -0600100
Ratan Gupta22f13f12019-04-29 15:36:40 +0530101AC_ARG_VAR(TLS_CERT_FILE, [Path of LDAP's client certificate])
102AS_IF([test "x$TLS_CERT_FILE" == "x"], [TLS_CERT_FILE="/etc/nslcd/certs/cert.pem"])
103AC_DEFINE_UNQUOTED([TLS_CERT_FILE], ["$TLS_CERT_FILE"], [Path of LDAP's client certificate])
104
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -0500105AC_ARG_VAR(LDAP_CONFIG_ROOT, [LDAP configuration root])
106AS_IF([test "x$LDAP_CONFIG_ROOT" == "x"], [LDAP_CONFIG_ROOT="/xyz/openbmc_project/user/ldap"])
107AC_DEFINE_UNQUOTED([LDAP_CONFIG_ROOT], ["$LDAP_CONFIG_ROOT"], [LDAP configuration root])
108
109AC_ARG_VAR(LDAP_CONFIG_DBUS_OBJ_PATH, [D-Bus path of LDAP config object])
110AS_IF([test "x$LDAP_CONFIG_DBUS_OBJ_PATH" == "x"], [LDAP_CONFIG_DBUS_OBJ_PATH="/xyz/openbmc_project/user/ldap/config"])
111AC_DEFINE_UNQUOTED([LDAP_CONFIG_DBUS_OBJ_PATH], ["$LDAP_CONFIG_DBUS_OBJ_PATH"], [D-Bus path of LDAP config object])
112
113AC_ARG_VAR(LDAP_CONFIG_BUSNAME, [D-Bus busname of LDAP config service])
114AS_IF([test "x$LDAP_CONFIG_BUSNAME" == "x"], [LDAP_CONFIG_BUSNAME="xyz.openbmc_project.Ldap.Config"])
115AC_DEFINE_UNQUOTED([LDAP_CONFIG_BUSNAME], ["$LDAP_CONFIG_BUSNAME"], [D-Bus busname of LDAP config service])
116
Ratan Gupta95a29312019-02-18 20:34:10 +0530117AC_ARG_VAR(LDAP_CONF_PERSIST_PATH, [directory path to persist LDAP enabled property.])
118AS_IF([test "x$LDAP_CONF_PERSIST_PATH" == "x"], \
Ratan Gupta21e88cb2019-04-12 17:15:52 +0530119 [LDAP_CONF_PERSIST_PATH="/var/lib/phosphor-ldap-conf"])
Ratan Gupta95a29312019-02-18 20:34:10 +0530120AC_DEFINE_UNQUOTED([LDAP_CONF_PERSIST_PATH], ["$LDAP_CONF_PERSIST_PATH"], \
121 [path of directory having persisted LDAP configuration enabled property.])
122
Richard Marian Thomaiyar73ce7732020-05-28 08:58:55 +0530123AC_ARG_ENABLE([root_user_mgmt],
124 AS_HELP_STRING([--disable-root_user_mgmt], [Disables managing root user. [default=enable]])
125)
Richard Marian Thomaiyard4d65502019-11-02 21:02:03 +0530126AS_IF([test "x$enable_root_user_mgmt" != "xno"],
127 AC_MSG_NOTICE([Enable managing root user])
128 [cpp_flags="-DENABLE_ROOT_USER_MGMT"]
129 AC_SUBST([CPPFLAGS], [$cpp_flags]),
130 AC_MSG_WARN([Disable managing root user])
131)
132
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -0500133AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.])
134AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.])
135AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.])
136
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530137# Checks for typedefs, structures, and compiler characteristics.
Vernon Mauery3618f442018-10-04 10:23:01 -0700138AX_CXX_COMPILE_STDCXX_17([noext])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530139AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
140
141# For libtools
142LT_INIT
143
144# Create configured output
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -0500145AC_CONFIG_FILES([Makefile test/Makefile phosphor-ldap-mapper/Makefile phosphor-ldap-config/Makefile])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530146AC_OUTPUT