blob: bd57c4366f07b43d84ca83790867f34772560f83 [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 Joseph0b14c472018-09-30 01:42:59 +053023AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal])
24AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1])
25AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal])
26
Vishwanatha Subbanna070a3e42017-09-06 11:40:45 +053027# Default crypt algorithm to choose if one not found in shadow file
28# Per crypt(3), 1 is for MD5
29AC_ARG_VAR(DEFAULT_CRYPT_ALGO, [The default crypt algorithm if one not found in shadow])
30AS_IF([test "x$DEFAULT_CRYPT_ALGO" == "x"], [DEFAULT_CRYPT_ALGO="1"])
31AC_DEFINE_UNQUOTED([DEFAULT_CRYPT_ALGO], ["$DEFAULT_CRYPT_ALGO"], [The default crypt algorithm if one not found in shadow])
32
Vishwanatha Subbanna035a9692017-09-15 18:50:43 +053033# Check/set gtest specific functions.
34AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
35AC_SUBST(GTEST_CPPFLAGS)
36
37# Test cases require SDK so only build if we're told to (and SDK is available)
38AC_ARG_ENABLE([oe-sdk],
39 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
40)
41AC_ARG_VAR(OECORE_TARGET_SYSROOT,
42 [Path to the OE SDK SYSROOT])
43AS_IF([test "x$enable_oe_sdk" == "xyes"],
44 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
45 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
46 )
47 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
48 [
49 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
50 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
51 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
52 ]
53 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
54)
55
Anton D. Kachalovb36b11c2021-03-19 10:38:57 +010056AC_ARG_WITH([systemdsystemunitdir],
57 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],
58 [],
59 [with_systemdsystemunitdir=auto]
60)
61AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
62 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
63 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
64 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
65 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]
66 )
67 with_systemdsystemunitdir=no],
68 [with_systemdsystemunitdir="$def_systemdsystemunitdir"]
69 )]
70)
71AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
72 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]
73)
74
75AC_ARG_WITH([dbuspolicydir],
76 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
77 [],
Patrick Williamsc0760c92021-10-04 12:06:42 -050078 [with_dbuspolicydir=${datadir}/dbus-1/system.d])
Anton D. Kachalovb36b11c2021-03-19 10:38:57 +010079AS_IF([test "x$with_dbuspolicydir" != "xno"],
80 [AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])]
81)
82
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -050083AC_ARG_VAR(LDAP_CONFIG_FILE, [Path of LDAP configuration file])
84AS_IF([test "x$LDAP_CONFIG_FILE" == "x"], [LDAP_CONFIG_FILE="/etc/nslcd.conf"])
85AC_DEFINE_UNQUOTED([LDAP_CONFIG_FILE], ["$LDAP_CONFIG_FILE"], [Path of LDAP configuration file])
86
Zbigniew Kurzynski5d00cf22019-10-03 12:10:20 +020087AC_ARG_VAR(TLS_CACERT_PATH, [Path of LDAP server's CA certificate])
88AS_IF([test "x$TLS_CACERT_PATH" == "x"], [TLS_CACERT_PATH="/etc/ssl/certs/authority"])
89AC_DEFINE_UNQUOTED([TLS_CACERT_PATH], ["$TLS_CACERT_PATH"], [Path of LDAP server's CA certificate])
Nagaraju Gorugantid514e5d2018-11-08 03:07:25 -060090
Ratan Gupta22f13f12019-04-29 15:36:40 +053091AC_ARG_VAR(TLS_CERT_FILE, [Path of LDAP's client certificate])
92AS_IF([test "x$TLS_CERT_FILE" == "x"], [TLS_CERT_FILE="/etc/nslcd/certs/cert.pem"])
93AC_DEFINE_UNQUOTED([TLS_CERT_FILE], ["$TLS_CERT_FILE"], [Path of LDAP's client certificate])
94
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -050095AC_ARG_VAR(LDAP_CONFIG_ROOT, [LDAP configuration root])
96AS_IF([test "x$LDAP_CONFIG_ROOT" == "x"], [LDAP_CONFIG_ROOT="/xyz/openbmc_project/user/ldap"])
97AC_DEFINE_UNQUOTED([LDAP_CONFIG_ROOT], ["$LDAP_CONFIG_ROOT"], [LDAP configuration root])
98
99AC_ARG_VAR(LDAP_CONFIG_DBUS_OBJ_PATH, [D-Bus path of LDAP config object])
100AS_IF([test "x$LDAP_CONFIG_DBUS_OBJ_PATH" == "x"], [LDAP_CONFIG_DBUS_OBJ_PATH="/xyz/openbmc_project/user/ldap/config"])
101AC_DEFINE_UNQUOTED([LDAP_CONFIG_DBUS_OBJ_PATH], ["$LDAP_CONFIG_DBUS_OBJ_PATH"], [D-Bus path of LDAP config object])
102
103AC_ARG_VAR(LDAP_CONFIG_BUSNAME, [D-Bus busname of LDAP config service])
104AS_IF([test "x$LDAP_CONFIG_BUSNAME" == "x"], [LDAP_CONFIG_BUSNAME="xyz.openbmc_project.Ldap.Config"])
105AC_DEFINE_UNQUOTED([LDAP_CONFIG_BUSNAME], ["$LDAP_CONFIG_BUSNAME"], [D-Bus busname of LDAP config service])
106
Ratan Gupta95a29312019-02-18 20:34:10 +0530107AC_ARG_VAR(LDAP_CONF_PERSIST_PATH, [directory path to persist LDAP enabled property.])
108AS_IF([test "x$LDAP_CONF_PERSIST_PATH" == "x"], \
Ratan Gupta21e88cb2019-04-12 17:15:52 +0530109 [LDAP_CONF_PERSIST_PATH="/var/lib/phosphor-ldap-conf"])
Ratan Gupta95a29312019-02-18 20:34:10 +0530110AC_DEFINE_UNQUOTED([LDAP_CONF_PERSIST_PATH], ["$LDAP_CONF_PERSIST_PATH"], \
111 [path of directory having persisted LDAP configuration enabled property.])
112
Richard Marian Thomaiyar73ce7732020-05-28 08:58:55 +0530113AC_ARG_ENABLE([root_user_mgmt],
114 AS_HELP_STRING([--disable-root_user_mgmt], [Disables managing root user. [default=enable]])
115)
Richard Marian Thomaiyard4d65502019-11-02 21:02:03 +0530116AS_IF([test "x$enable_root_user_mgmt" != "xno"],
117 AC_MSG_NOTICE([Enable managing root user])
118 [cpp_flags="-DENABLE_ROOT_USER_MGMT"]
119 AC_SUBST([CPPFLAGS], [$cpp_flags]),
120 AC_MSG_WARN([Disable managing root user])
121)
122
Nagaraju Goruganti997f5e02018-08-30 03:05:11 -0500123AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.])
124AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.])
125AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.])
126
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530127# Checks for typedefs, structures, and compiler characteristics.
Patrick Williams0e171692022-04-15 10:12:01 -0500128AX_CXX_COMPILE_STDCXX([20],[noext])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530129AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
130
131# For libtools
132LT_INIT
133
134# Create configured output
Alexander Filippov7ba91cb2022-01-12 21:58:02 +0300135AC_CONFIG_FILES([Makefile test/Makefile phosphor-ldap-config/Makefile])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +0530136AC_OUTPUT