From 73b776bd8cc603bdebab4b76b25a19fa9e2a5f39 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Wed, 19 Oct 2016 07:50:28 -0400 Subject: Application stub and build rules Create a basic autoconf setup. Change-Id: I3135aded1be79ca552b564b2575be7a20fad0285 Signed-off-by: Brad Bishop --- Makefile.am | 4 ++++ README.md | 10 ++++++++++ app.cpp | 25 +++++++++++++++++++++++++ bootstrap.sh | 18 ++++++++++++++++++ configure.ac | 23 +++++++++++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 Makefile.am create mode 100644 README.md create mode 100644 app.cpp create mode 100755 bootstrap.sh create mode 100644 configure.ac diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..3c1e3c8 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,4 @@ +sbin_PROGRAMS = phosphor-inventory + +phosphor_inventory_SOURCES = \ + app.cpp diff --git a/README.md b/README.md new file mode 100644 index 0000000..5318177 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +## To Build +``` +To build this package, do the following steps: + + 1. ./bootstrap.sh + 2. ./configure ${CONFIGURE_FLAGS} + 3. make + +To full clean the repository again run `./bootstrap.sh clean`. +``` diff --git a/app.cpp b/app.cpp new file mode 100644 index 0000000..bcef3eb --- /dev/null +++ b/app.cpp @@ -0,0 +1,25 @@ +/** + * Copyright © 2016 IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +int main(int argc, char *argv[]) +{ + // TOOD + + exit(EXIT_SUCCESS); +} + +// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..50b75b7 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +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"' diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..4496633 --- /dev/null +++ b/configure.ac @@ -0,0 +1,23 @@ +# Initialization +AC_PREREQ([2.69]) +AC_INIT([phosphor-inventory-manager], [1.0], [https://github.com/openbmc/phosphor-inventory-manager/issues]) +AC_CONFIG_HEADERS([config.h]) +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 + +# Checks for typedefs, structures, and compiler characteristics. +AX_CXX_COMPILE_STDCXX_14([noext]) +AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) + +# Checks for library functions. +LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' + +# Create configured output +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT -- cgit v1.2.1