Make faultd build
authorŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 8 May 2017 21:02:59 +0000 (23:02 +0200)
committerKrzysztof Opasiak <k.opasiak@samsung.com>
Wed, 10 May 2017 18:42:59 +0000 (20:42 +0200)
Makefile.am [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
m4/.gitignore [new file with mode: 0644]
src/.gitignore [new file with mode: 0644]

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..786ae41
--- /dev/null
@@ -0,0 +1,39 @@
+EXTRA_DIST =
+CLEANFILES =
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+AM_MAKEFLAGS = --no-print-directory
+
+AM_CPPFLAGS = \
+       -include $(top_builddir)/config.h \
+       -DSYSCONFDIR=\""$(sysconfdir)"\" \
+       -I${top_srcdir}/src \
+        -I${top_srcdir}/src/core \
+        -I${top_srcdir}/src/util
+
+
+AM_CFLAGS = ${my_CFLAGS}
+
+AM_LDFLAGS = \
+       -Wl,--gc-sections \
+       -Wl,--as-needed
+
+SED_PROCESS = \
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
+       -e 's,@VERSION\@,$(VERSION),g' \
+       -e 's,@prefix\@,$(prefix),g' \
+       -e 's,@exec_prefix\@,$(exec_prefix),g' \
+       -e 's,@libdir\@,$(libdir),g' \
+       -e 's,@includedir\@,$(includedir),g' \
+       < $< > $@ || rm $@
+
+%.pc: %.pc.in Makefile
+       $(SED_PROCESS)
+
+sbin_PROGRAMS = faultd
+faultd_SOURCES = \
+    src/core/module.c \
+    src/faultd.c \
+    src/util/log.c \
+    src/util/notify_queue.c
+faultd_LDADD = $(LIBSYSTEMD_LIBS) ${AUDIT_LIBS}
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..c47df37
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
+        cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
+        chmod +x .git/hooks/pre-commit && \
+        echo "Activated pre-commit hook." || :
+fi
+
+autoreconf --install --symlink
+
+libdir() {
+        echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
+}
+
+
+args="--prefix=/usr \
+--sysconfdir=/etc \
+--libdir=$(libdir /usr/lib)"
+
+echo
+echo "----------------------------------------------------------------"
+echo "Initialized build system. For a common configuration please run:"
+echo "----------------------------------------------------------------"
+echo
+echo "./configure CFLAGS='-g -O0' $args"
+echo
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..4f296b5
--- /dev/null
@@ -0,0 +1,78 @@
+AC_PREREQ(2.69)
+AC_INIT([faultd],
+        [0.0.1],
+        [abc-devel@example.com],
+        [faultd],
+        [http://review.tizen.org/git/])
+AC_CONFIG_SRCDIR([src/faultd.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([
+       check-news
+       foreign
+       1.11
+       -Wall
+       -Wno-portability
+       silent-rules
+       tar-pax
+       no-dist-gzip
+       dist-xz
+       subdir-objects
+])
+AC_PROG_CC_STDC
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
+AC_CONFIG_MACRO_DIR([m4])
+AM_SILENT_RULES([yes])
+AC_PREFIX_DEFAULT([/usr])
+
+AC_PROG_SED
+AC_PROG_MKDIR_P
+
+PKG_CHECK_MODULES(LIBSYSTEMD,
+        [libsystemd >= 231],
+        have_libsystemd=yes,
+        have_libsystemd=no)
+AS_IF([test "x$have_libsystemd" = "xno"],
+      AC_MSG_ERROR([libsystemd version 221 or newer not found]))
+
+AC_CHECK_FUNCS([ \
+       printf\
+])
+
+my_CFLAGS="\
+-Wall \
+-Wchar-subscripts \
+-Wformat-security \
+-Wmissing-declarations \
+-Wmissing-prototypes \
+-Wnested-externs \
+-Wpointer-arith \
+-Wshadow \
+-Wsign-compare \
+-Wstrict-prototypes \
+-Wtype-limits \
+"
+AC_SUBST([my_CFLAGS])
+
+AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_FILES([
+        Makefile
+])
+
+AC_OUTPUT
+AC_MSG_RESULT([
+        $PACKAGE $VERSION
+        =====
+
+        prefix:                 ${prefix}
+        sysconfdir:             ${sysconfdir}
+        libdir:                 ${libdir}
+        includedir:             ${includedir}
+
+        compiler:               ${CC}
+        cflags:                 ${CFLAGS}
+        ldflags:                ${LDFLAGS}
+
+        libsystemd:             ${have_libsystemd}
+])
+
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644 (file)
index 0000000..38066dd
--- /dev/null
@@ -0,0 +1,5 @@
+libtool.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+lt~obsolete.m4
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644 (file)
index 0000000..088ef79
--- /dev/null
@@ -0,0 +1,5 @@
+.dirstamp
+.deps/
+.libs/
+*.la
+*.lo