Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-user-manager], [1.0], [https://github.com/openbmc/phosphor-user-manager/issues]) |
| 4 | AC_LANG([C++]) |
| 5 | AC_CONFIG_HEADERS([config.h]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AC_PROG_INSTALL |
| 12 | AC_PROG_MAKE_SET |
| 13 | |
Vishwanatha Subbanna | d20225f | 2017-09-06 11:36:04 +0530 | [diff] [blame] | 14 | # Checks for libraries. |
Patrick Venture | 5e8ccb9 | 2019-02-13 14:54:49 -0800 | [diff] [blame] | 15 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
| 16 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
| 17 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
Vishwanatha Subbanna | d20225f | 2017-09-06 11:36:04 +0530 | [diff] [blame] | 18 | |
| 19 | AC_ARG_VAR(USER_MANAGER_BUSNAME, [The Dbus busname to own]) |
| 20 | AS_IF([test "x$USER_MANAGER_BUSNAME" == "x"], [USER_MANAGER_BUSNAME="xyz.openbmc_project.User.Manager"]) |
| 21 | AC_DEFINE_UNQUOTED([USER_MANAGER_BUSNAME], ["$USER_MANAGER_BUSNAME"], [The DBus busname to own]) |
Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 22 | |
Tom Joseph | 536ea32 | 2018-09-14 10:02:20 +0530 | [diff] [blame] | 23 | AC_ARG_VAR(LDAP_MAPPER_MANAGER_BUSNAME, [The Dbus busname LDAP privilege mapper application]) |
| 24 | AS_IF([test "x$LDAP_MAPPER_MANAGER_BUSNAME" == "x"], [LDAP_MAPPER_MANAGER_BUSNAME="xyz.openbmc_project.LDAP.PrivilegeMapper"]) |
| 25 | AC_DEFINE_UNQUOTED([LDAP_MAPPER_MANAGER_BUSNAME], ["$LDAP_MAPPER_MANAGER_BUSNAME"], [The Dbus busname LDAP privilege mapper application]) |
| 26 | |
Tom Joseph | 0b14c47 | 2018-09-30 01:42:59 +0530 | [diff] [blame] | 27 | AC_ARG_VAR(LDAP_MAPPER_PERSIST_PATH, [Path of directory containing LDAP groups privilege mapping]) |
| 28 | AS_IF([test "x$LDAP_MAPPER_PERSIST_PATH" == "x"], \ |
| 29 | [LDAP_MAPPER_PERSIST_PATH="/var/lib/phosphor-ldap-mapper/groups"]) |
| 30 | AC_DEFINE_UNQUOTED([LDAP_MAPPER_PERSIST_PATH], ["$LDAP_MAPPER_PERSIST_PATH"], \ |
| 31 | [Path of directory containing LDAP groups privilege mapping]) |
| 32 | |
| 33 | AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal]) |
| 34 | AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1]) |
| 35 | AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal]) |
| 36 | |
Vishwanatha Subbanna | 070a3e4 | 2017-09-06 11:40:45 +0530 | [diff] [blame] | 37 | # Default crypt algorithm to choose if one not found in shadow file |
| 38 | # Per crypt(3), 1 is for MD5 |
| 39 | AC_ARG_VAR(DEFAULT_CRYPT_ALGO, [The default crypt algorithm if one not found in shadow]) |
| 40 | AS_IF([test "x$DEFAULT_CRYPT_ALGO" == "x"], [DEFAULT_CRYPT_ALGO="1"]) |
| 41 | AC_DEFINE_UNQUOTED([DEFAULT_CRYPT_ALGO], ["$DEFAULT_CRYPT_ALGO"], [The default crypt algorithm if one not found in shadow]) |
| 42 | |
Vishwanatha Subbanna | 035a969 | 2017-09-15 18:50:43 +0530 | [diff] [blame] | 43 | # Check/set gtest specific functions. |
| 44 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 45 | AC_SUBST(GTEST_CPPFLAGS) |
| 46 | |
| 47 | # Test cases require SDK so only build if we're told to (and SDK is available) |
| 48 | AC_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 | ) |
| 51 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 52 | [Path to the OE SDK SYSROOT]) |
| 53 | AS_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 Goruganti | 997f5e0 | 2018-08-30 03:05:11 -0500 | [diff] [blame] | 66 | AC_ARG_VAR(LDAP_CONFIG_FILE, [Path of LDAP configuration file]) |
| 67 | AS_IF([test "x$LDAP_CONFIG_FILE" == "x"], [LDAP_CONFIG_FILE="/etc/nslcd.conf"]) |
| 68 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_FILE], ["$LDAP_CONFIG_FILE"], [Path of LDAP configuration file]) |
| 69 | |
Nagaraju Goruganti | d514e5d | 2018-11-08 03:07:25 -0600 | [diff] [blame] | 70 | AC_ARG_VAR(TLS_CACERT_FILE, [Path of LDAP server's CA certificate]) |
| 71 | AS_IF([test "x$TLS_CACERT_FILE" == "x"], [TLS_CACERT_FILE="/etc/ssl/certs/Root-CA.pem"]) |
| 72 | AC_DEFINE_UNQUOTED([TLS_CACERT_FILE], ["$TLS_CACERT_FILE"], [Path of LDAP server's CA certificate]) |
| 73 | |
Nagaraju Goruganti | 997f5e0 | 2018-08-30 03:05:11 -0500 | [diff] [blame] | 74 | AC_ARG_VAR(LDAP_CONFIG_ROOT, [LDAP configuration root]) |
| 75 | AS_IF([test "x$LDAP_CONFIG_ROOT" == "x"], [LDAP_CONFIG_ROOT="/xyz/openbmc_project/user/ldap"]) |
| 76 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_ROOT], ["$LDAP_CONFIG_ROOT"], [LDAP configuration root]) |
| 77 | |
| 78 | AC_ARG_VAR(LDAP_CONFIG_DBUS_OBJ_PATH, [D-Bus path of LDAP config object]) |
| 79 | AS_IF([test "x$LDAP_CONFIG_DBUS_OBJ_PATH" == "x"], [LDAP_CONFIG_DBUS_OBJ_PATH="/xyz/openbmc_project/user/ldap/config"]) |
| 80 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_DBUS_OBJ_PATH], ["$LDAP_CONFIG_DBUS_OBJ_PATH"], [D-Bus path of LDAP config object]) |
| 81 | |
| 82 | AC_ARG_VAR(LDAP_CONFIG_BUSNAME, [D-Bus busname of LDAP config service]) |
| 83 | AS_IF([test "x$LDAP_CONFIG_BUSNAME" == "x"], [LDAP_CONFIG_BUSNAME="xyz.openbmc_project.Ldap.Config"]) |
| 84 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_BUSNAME], ["$LDAP_CONFIG_BUSNAME"], [D-Bus busname of LDAP config service]) |
| 85 | |
Ratan Gupta | 95a2931 | 2019-02-18 20:34:10 +0530 | [diff] [blame^] | 86 | AC_ARG_VAR(LDAP_CONF_PERSIST_PATH, [directory path to persist LDAP enabled property.]) |
| 87 | AS_IF([test "x$LDAP_CONF_PERSIST_PATH" == "x"], \ |
| 88 | [LDAP_CONF_PERSIST_PATH="/var/lib/phosphor-user-manager/ldap/conf"]) |
| 89 | AC_DEFINE_UNQUOTED([LDAP_CONF_PERSIST_PATH], ["$LDAP_CONF_PERSIST_PATH"], \ |
| 90 | [path of directory having persisted LDAP configuration enabled property.]) |
| 91 | |
Nagaraju Goruganti | 997f5e0 | 2018-08-30 03:05:11 -0500 | [diff] [blame] | 92 | AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.]) |
| 93 | AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.]) |
| 94 | AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.]) |
| 95 | |
Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 96 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | 3618f44 | 2018-10-04 10:23:01 -0700 | [diff] [blame] | 97 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 98 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 99 | |
| 100 | # For libtools |
| 101 | LT_INIT |
| 102 | |
| 103 | # Create configured output |
Nagaraju Goruganti | 997f5e0 | 2018-08-30 03:05:11 -0500 | [diff] [blame] | 104 | AC_CONFIG_FILES([Makefile test/Makefile phosphor-ldap-mapper/Makefile phosphor-ldap-config/Makefile]) |
Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 105 | AC_OUTPUT |