blob: fa3230557e8bbfca87ca2487657a34afb0acaa80 [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.
15PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR([Could not find sdbusplus...openbmc/sdbusplus package required])])
16PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])])
Vishwanatha Subbanna070a3e42017-09-06 11:40:45 +053017PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])])
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
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
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +053056# Checks for typedefs, structures, and compiler characteristics.
Vernon Mauery3618f442018-10-04 10:23:01 -070057AX_CXX_COMPILE_STDCXX_17([noext])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +053058AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
59
60# For libtools
61LT_INIT
62
63# Create configured output
Tom Joseph536ea322018-09-14 10:02:20 +053064AC_CONFIG_FILES([Makefile test/Makefile phosphor-ldap-mapper/Makefile])
Vishwanatha Subbanna8a89b532017-09-06 11:29:37 +053065AC_OUTPUT