summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-03-17 05:01:00 -0500
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-03-30 05:55:07 -0500
commit92a6341e34156e1a0baf7389b4ac0e58e7ea1d9e (patch)
tree1f90f9aec14a51fb07824e5121d996255e8970dd
parent546bcd3af669d7daec30512bd06aecbd19647af3 (diff)
downloadopenpower-occ-control-92a6341e34156e1a0baf7389b4ac0e58e7ea1d9e.tar.gz
openpower-occ-control-92a6341e34156e1a0baf7389b4ac0e58e7ea1d9e.zip
Add main application
Change-Id: I294529f08dcf65594e735ee5aeefdb37a2920b01 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
-rw-r--r--Makefile.am12
-rw-r--r--app.cpp18
-rwxr-xr-xbootstrap.sh18
-rw-r--r--configure.ac53
4 files changed, 101 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..3b01dfa
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,12 @@
+sbin_PROGRAMS = openpower-occ-control
+openpower_occ_control_SOURCES = \
+ app.cpp
+
+openpower_occ_control_LDFLAGS = \
+ $(SDBUSPLUS_LIBS) \
+ $(PHOSPHOR_LOGGING_LIBS) \
+ $(OPENPOWER_DBUS_INTERFACES_LIBS)
+openpower_occ_control_CXXFLAGS =
+ $(SDBUSPLUS_CFLAGS) \
+ $(PHOSPHOR_LOGGING_CFLAGS) \
+ $(OPENPOWER_DBUS_INTERFACES_CFLAGS)
diff --git a/app.cpp b/app.cpp
new file mode 100644
index 0000000..ffedd45
--- /dev/null
+++ b/app.cpp
@@ -0,0 +1,18 @@
+#include <sdbusplus/server.hpp>
+#include "config.h"
+
+int main(int argc, char* argv[])
+{
+ auto bus = sdbusplus::bus::new_default();
+ sdbusplus::server::manager::manager objManager(bus,
+ OCC_PASS_THROUGH_ROOT);
+ bus.request_name(OCC_PASS_THROUGH_BUSNAME);
+
+ while (true)
+ {
+ bus.process_discard();
+ bus.wait();
+ }
+
+ return 0;
+}
diff --git a/bootstrap.sh b/bootstrap.sh
new file mode 100755
index 0000000..9941c73
--- /dev/null
+++ b/bootstrap.sh
@@ -0,0 +1,18 @@
+#!/bin/sh -xe
+
+AUTOCONF_FILES="Makefile.in aclocal.m4 ar-lib autom4te.cache compile \
+ config.guess config.h.in config.sub configure depcomp install-sh \
+ ltmain.sh missing *libtool test-driver"
+
+case $1 in
+ clean)
+ test -f Makefile && make maintainer-clean
+ for file in ${AUTOCONF_FILES}; do
+ find -name "$file" | xargs -r rm -rf
+ done
+ exit 0
+ ;;
+esac
+
+autoreconf -i
+echo 'Run "./configure ${CONFIGURE_FLAGS} && make"' \ No newline at end of file
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..a565b4c
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,53 @@
+AC_PREREQ([2.69])
+AC_INIT([openpower-occ-control], [1.0], [https://github.com/openbmc/openpower-occ-control/issues])
+
+AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
+AM_SILENT_RULES([yes])
+
+# Checks for programs
+AC_PROG_CXX
+AM_PROG_AR
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+# Surpress the --with-libtool-sysroot error
+LT_INIT
+
+PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
+ AC_MSG_ERROR(["Requires sdbusplus package."]))
+PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
+ AC_MSG_ERROR(["Requires phosphor-logging package."]))
+PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,\
+ AC_MSG_ERROR(["Requires openpower-dbus-interfaces package."]))
+
+# Checks for typedefs, structures, and compiler characteristics.
+AX_CXX_COMPILE_STDCXX_14([noext])
+AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
+
+AC_ARG_VAR(OCC_PASS_THROUGH_BUSNAME, [The Dbus busname to own])
+AS_IF([test "x$OCC_PASS_THROUGH_BUSNAME" == "x"], [OCC_PASS_THROUGH_BUSNAME="org.open_power.OCC.PassThrough"])
+AC_DEFINE_UNQUOTED([OCC_PASS_THROUGH_BUSNAME], ["$OCC_PASS_THROUGH_BUSNAME"], [The DBus busname to own])
+
+AC_ARG_VAR(OCC_PASS_THROUGH_ROOT, [The Dbus root])
+AS_IF([test "x$OCC_PASS_THROUGH_ROOT" == "x"], [OCC_PASS_THROUGH_ROOT="/xyz/openbmc_project/occ/pass_through"])
+AC_DEFINE_UNQUOTED([OCC_PASS_THROUGH_ROOT], ["$OCC_PASS_THROUGH_ROOT"], [The Dbus root])
+
+AC_ARG_VAR(INVENTORY_ITEM_INTERFACE, [The Inventory.Item interface])
+AS_IF([test "x$INVENTORY_ITEM_INTERFACE" == "x"], [INVENTORY_ITEM_INTERFACE="xyz.openbmc_project.Inventory.Item"])
+AC_DEFINE_UNQUOTED([INVENTORY_ITEM_INTERFACE], ["$INVENTORY_ITEM_INTERFACE"], [The Inventory.Item root])
+
+AC_ARG_VAR(INVENTORY_ROOT, [The Inventory root])
+AS_IF([test "x$INVENTORY_ROOT" == "x"], [INVENTORY_ROOT="/xyz/openbmc_project/inventory/system"])
+AC_DEFINE_UNQUOTED([INVENTORY_ROOT], ["$INVENTORY_ROOT"], [The Inventory root])
+
+AC_ARG_VAR(CPU_NAME, [The name of the cpu object])
+AS_IF([test "x$CPU_NAME" == "x"], [CPU_NAME="cpu"])
+AC_DEFINE_UNQUOTED([CPU_NAME], ["$CPU_NAME"], [The name of the cpu object])
+
+AC_ARG_VAR(OCC_NAME, [The name of the occ object])
+AS_IF([test "x$OCC_NAME" == "x"], [OCC_NAME="occ"])
+AC_DEFINE_UNQUOTED([OCC_NAME], ["$OCC_NAME"], [The name of the occ object])
+
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
OpenPOWER on IntegriCloud