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 | 0b14c47 | 2018-09-30 01:42:59 +0530 | [diff] [blame] | 23 | AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal]) |
| 24 | AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1]) |
| 25 | AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal]) |
| 26 | |
Vishwanatha Subbanna | 070a3e4 | 2017-09-06 11:40:45 +0530 | [diff] [blame] | 27 | # Default crypt algorithm to choose if one not found in shadow file |
| 28 | # Per crypt(3), 1 is for MD5 |
| 29 | AC_ARG_VAR(DEFAULT_CRYPT_ALGO, [The default crypt algorithm if one not found in shadow]) |
| 30 | AS_IF([test "x$DEFAULT_CRYPT_ALGO" == "x"], [DEFAULT_CRYPT_ALGO="1"]) |
| 31 | AC_DEFINE_UNQUOTED([DEFAULT_CRYPT_ALGO], ["$DEFAULT_CRYPT_ALGO"], [The default crypt algorithm if one not found in shadow]) |
| 32 | |
Vishwanatha Subbanna | 035a969 | 2017-09-15 18:50:43 +0530 | [diff] [blame] | 33 | # Check/set gtest specific functions. |
| 34 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 35 | AC_SUBST(GTEST_CPPFLAGS) |
| 36 | |
| 37 | # Test cases require SDK so only build if we're told to (and SDK is available) |
| 38 | AC_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 | ) |
| 41 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 42 | [Path to the OE SDK SYSROOT]) |
| 43 | AS_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. Kachalov | b36b11c | 2021-03-19 10:38:57 +0100 | [diff] [blame] | 56 | AC_ARG_WITH([systemdsystemunitdir], |
| 57 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])], |
| 58 | [], |
| 59 | [with_systemdsystemunitdir=auto] |
| 60 | ) |
| 61 | AS_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 | ) |
| 71 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 72 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])] |
| 73 | ) |
| 74 | |
| 75 | AC_ARG_WITH([dbuspolicydir], |
| 76 | AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]), |
| 77 | [], |
Patrick Williams | c0760c9 | 2021-10-04 12:06:42 -0500 | [diff] [blame] | 78 | [with_dbuspolicydir=${datadir}/dbus-1/system.d]) |
Anton D. Kachalov | b36b11c | 2021-03-19 10:38:57 +0100 | [diff] [blame] | 79 | AS_IF([test "x$with_dbuspolicydir" != "xno"], |
| 80 | [AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])] |
| 81 | ) |
| 82 | |
Nagaraju Goruganti | 997f5e0 | 2018-08-30 03:05:11 -0500 | [diff] [blame] | 83 | AC_ARG_VAR(LDAP_CONFIG_FILE, [Path of LDAP configuration file]) |
| 84 | AS_IF([test "x$LDAP_CONFIG_FILE" == "x"], [LDAP_CONFIG_FILE="/etc/nslcd.conf"]) |
| 85 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_FILE], ["$LDAP_CONFIG_FILE"], [Path of LDAP configuration file]) |
| 86 | |
Zbigniew Kurzynski | 5d00cf2 | 2019-10-03 12:10:20 +0200 | [diff] [blame] | 87 | AC_ARG_VAR(TLS_CACERT_PATH, [Path of LDAP server's CA certificate]) |
| 88 | AS_IF([test "x$TLS_CACERT_PATH" == "x"], [TLS_CACERT_PATH="/etc/ssl/certs/authority"]) |
| 89 | AC_DEFINE_UNQUOTED([TLS_CACERT_PATH], ["$TLS_CACERT_PATH"], [Path of LDAP server's CA certificate]) |
Nagaraju Goruganti | d514e5d | 2018-11-08 03:07:25 -0600 | [diff] [blame] | 90 | |
Ratan Gupta | 22f13f1 | 2019-04-29 15:36:40 +0530 | [diff] [blame] | 91 | AC_ARG_VAR(TLS_CERT_FILE, [Path of LDAP's client certificate]) |
| 92 | AS_IF([test "x$TLS_CERT_FILE" == "x"], [TLS_CERT_FILE="/etc/nslcd/certs/cert.pem"]) |
| 93 | AC_DEFINE_UNQUOTED([TLS_CERT_FILE], ["$TLS_CERT_FILE"], [Path of LDAP's client certificate]) |
| 94 | |
Nagaraju Goruganti | 997f5e0 | 2018-08-30 03:05:11 -0500 | [diff] [blame] | 95 | AC_ARG_VAR(LDAP_CONFIG_ROOT, [LDAP configuration root]) |
| 96 | AS_IF([test "x$LDAP_CONFIG_ROOT" == "x"], [LDAP_CONFIG_ROOT="/xyz/openbmc_project/user/ldap"]) |
| 97 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_ROOT], ["$LDAP_CONFIG_ROOT"], [LDAP configuration root]) |
| 98 | |
| 99 | AC_ARG_VAR(LDAP_CONFIG_DBUS_OBJ_PATH, [D-Bus path of LDAP config object]) |
| 100 | AS_IF([test "x$LDAP_CONFIG_DBUS_OBJ_PATH" == "x"], [LDAP_CONFIG_DBUS_OBJ_PATH="/xyz/openbmc_project/user/ldap/config"]) |
| 101 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_DBUS_OBJ_PATH], ["$LDAP_CONFIG_DBUS_OBJ_PATH"], [D-Bus path of LDAP config object]) |
| 102 | |
| 103 | AC_ARG_VAR(LDAP_CONFIG_BUSNAME, [D-Bus busname of LDAP config service]) |
| 104 | AS_IF([test "x$LDAP_CONFIG_BUSNAME" == "x"], [LDAP_CONFIG_BUSNAME="xyz.openbmc_project.Ldap.Config"]) |
| 105 | AC_DEFINE_UNQUOTED([LDAP_CONFIG_BUSNAME], ["$LDAP_CONFIG_BUSNAME"], [D-Bus busname of LDAP config service]) |
| 106 | |
Ratan Gupta | 95a2931 | 2019-02-18 20:34:10 +0530 | [diff] [blame] | 107 | AC_ARG_VAR(LDAP_CONF_PERSIST_PATH, [directory path to persist LDAP enabled property.]) |
| 108 | AS_IF([test "x$LDAP_CONF_PERSIST_PATH" == "x"], \ |
Ratan Gupta | 21e88cb | 2019-04-12 17:15:52 +0530 | [diff] [blame] | 109 | [LDAP_CONF_PERSIST_PATH="/var/lib/phosphor-ldap-conf"]) |
Ratan Gupta | 95a2931 | 2019-02-18 20:34:10 +0530 | [diff] [blame] | 110 | AC_DEFINE_UNQUOTED([LDAP_CONF_PERSIST_PATH], ["$LDAP_CONF_PERSIST_PATH"], \ |
| 111 | [path of directory having persisted LDAP configuration enabled property.]) |
| 112 | |
Richard Marian Thomaiyar | 73ce773 | 2020-05-28 08:58:55 +0530 | [diff] [blame] | 113 | AC_ARG_ENABLE([root_user_mgmt], |
| 114 | AS_HELP_STRING([--disable-root_user_mgmt], [Disables managing root user. [default=enable]]) |
| 115 | ) |
Richard Marian Thomaiyar | d4d6550 | 2019-11-02 21:02:03 +0530 | [diff] [blame] | 116 | AS_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 Goruganti | 997f5e0 | 2018-08-30 03:05:11 -0500 | [diff] [blame] | 123 | AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.]) |
| 124 | AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.]) |
| 125 | AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.]) |
| 126 | |
Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 127 | # Checks for typedefs, structures, and compiler characteristics. |
Patrick Williams | 0e17169 | 2022-04-15 10:12:01 -0500 | [diff] [blame] | 128 | AX_CXX_COMPILE_STDCXX([20],[noext]) |
Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 129 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 130 | |
| 131 | # For libtools |
| 132 | LT_INIT |
| 133 | |
| 134 | # Create configured output |
Alexander Filippov | 7ba91cb | 2022-01-12 21:58:02 +0300 | [diff] [blame] | 135 | AC_CONFIG_FILES([Makefile test/Makefile phosphor-ldap-config/Makefile]) |
Vishwanatha Subbanna | 8a89b53 | 2017-09-06 11:29:37 +0530 | [diff] [blame] | 136 | AC_OUTPUT |