blob: 693c864695b6235efd62587c63369f9d73841e39 [file] [log] [blame]
Deepak Kodihalli92a63412017-03-17 05:01:00 -05001AC_PREREQ([2.69])
2AC_INIT([openpower-occ-control], [1.0], [https://github.com/openbmc/openpower-occ-control/issues])
3
4AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
5AM_SILENT_RULES([yes])
6
7# Checks for programs
8AC_PROG_CXX
9AM_PROG_AR
10AC_PROG_INSTALL
11AC_PROG_MAKE_SET
12
13# Surpress the --with-libtool-sysroot error
14LT_INIT
15
16PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
17 AC_MSG_ERROR(["Requires sdbusplus package."]))
18PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
19 AC_MSG_ERROR(["Requires phosphor-logging package."]))
20PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,\
21 AC_MSG_ERROR(["Requires openpower-dbus-interfaces package."]))
22
Vishwanatha Subbanna9bb065b2017-04-18 14:25:26 +053023# Check for sdbusplus
24PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])])
25
26# Check for sdbus++ tool
27AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
28AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
29
Deepak Kodihalli92a63412017-03-17 05:01:00 -050030# Checks for typedefs, structures, and compiler characteristics.
31AX_CXX_COMPILE_STDCXX_14([noext])
32AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
33
Vishwanatha Subbanna2180b2d2017-06-28 14:05:57 +053034AC_ARG_VAR(OCC_CONTROL_BUSNAME, [The Dbus busname to own])
35AS_IF([test "x$OCC_CONTROL_BUSNAME" == "x"], [OCC_CONTROL_BUSNAME="org.open_power.OCC.Control"])
36AC_DEFINE_UNQUOTED([OCC_CONTROL_BUSNAME], ["$OCC_CONTROL_BUSNAME"], [The DBus busname to own])
Deepak Kodihalli92a63412017-03-17 05:01:00 -050037
Vishwanatha Subbanna2180b2d2017-06-28 14:05:57 +053038AC_ARG_VAR(OCC_CONTROL_ROOT, [The Dbus root])
39AS_IF([test "x$OCC_CONTROL_ROOT" == "x"], [OCC_CONTROL_ROOT="/org/open_power/control"])
40AC_DEFINE_UNQUOTED([OCC_CONTROL_ROOT], ["$OCC_CONTROL_ROOT"], [The Dbus root])
Deepak Kodihalli92a63412017-03-17 05:01:00 -050041
42AC_ARG_VAR(INVENTORY_ITEM_INTERFACE, [The Inventory.Item interface])
43AS_IF([test "x$INVENTORY_ITEM_INTERFACE" == "x"], [INVENTORY_ITEM_INTERFACE="xyz.openbmc_project.Inventory.Item"])
44AC_DEFINE_UNQUOTED([INVENTORY_ITEM_INTERFACE], ["$INVENTORY_ITEM_INTERFACE"], [The Inventory.Item root])
45
Deepak Kodihallifd358d12017-05-08 07:11:22 -050046AC_ARG_VAR(CPU_PATH, [CPU inventory path])
47AS_IF([test "x$CPU_PATH" == "x"], [CPU_PATH="/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu"])
48AC_DEFINE_UNQUOTED([CPU_PATH], ["$CPU_PATH"], [CPU inventory path])
Deepak Kodihalli92a63412017-03-17 05:01:00 -050049
Deepak Kodihallifd358d12017-05-08 07:11:22 -050050AC_ARG_VAR(MAX_CPUS, [The max number of CPUs])
51AS_IF([test "x$MAX_CPUS" == "x"], [MAX_CPUS=2])
52AC_DEFINE_UNQUOTED([MAX_CPUS], [$MAX_CPUS], [The max number of CPUs])
53
54AC_ARG_VAR(CPU_NAME, [The CPU object name])
Deepak Kodihalli92a63412017-03-17 05:01:00 -050055AS_IF([test "x$CPU_NAME" == "x"], [CPU_NAME="cpu"])
Deepak Kodihallifd358d12017-05-08 07:11:22 -050056AC_DEFINE_UNQUOTED([CPU_NAME], ["$CPU_NAME"], [The CPU object name])
Deepak Kodihalli92a63412017-03-17 05:01:00 -050057
Deepak Kodihallifd358d12017-05-08 07:11:22 -050058AC_ARG_VAR(OCC_NAME, [The OCC object name])
Deepak Kodihalli92a63412017-03-17 05:01:00 -050059AS_IF([test "x$OCC_NAME" == "x"], [OCC_NAME="occ"])
Deepak Kodihallifd358d12017-05-08 07:11:22 -050060AC_DEFINE_UNQUOTED([OCC_NAME], ["$OCC_NAME"], [The OCC object name])
Deepak Kodihalli92a63412017-03-17 05:01:00 -050061
Vishwanatha Subbanna32e84e92017-06-28 19:17:28 +053062AC_ARG_VAR(OCC_HWMON_PATH, [The OCC hwmon path])
63AS_IF([test "x$OCC_HWMON_PATH" == "x"], [OCC_HWMON_PATH="/sys/bus/platform/drivers/occ-hwmon/"])
64AC_DEFINE_UNQUOTED([OCC_HWMON_PATH], ["$OCC_HWMON_PATH"], [The OCC hwmon path])
65
Deepak Kodihalli92a63412017-03-17 05:01:00 -050066AC_CONFIG_HEADERS([config.h])
67AC_CONFIG_FILES([Makefile])
68AC_OUTPUT