+++ /dev/null
-VERSION = 0.27
-#
-# to build this package, you need to have the following components installed:
-# dbus-glib-devel libnotify-devel curl-devel
-#
-PREFIX ?= /usr
-BINDIR = $(PREFIX)/bin
-SBINDIR = $(PREFIX)/sbin
-MANDIR = $(PREFIX)/share/man/man8
-CC ?= gcc
-
-CFLAGS := -g -fstack-protector -D_FORTIFY_SOURCE=2 -Wall -pedantic -W -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wformat -Wformat-security -Werror=format-security
-
-MY_CFLAGS := `pkg-config --cflags libnotify libproxy-1.0 glib-2.0 dbus-1`
-#
-# pkg-config tends to make programs pull in a ton of libraries, not all
-# are needed. -Wl,--as-needed tells the linker to just drop unused ones.
-#
-LDF_C := -Wl,--as-needed `pkg-config --libs glib-2.0`
-LDF_D := -Wl,--as-needed `pkg-config --libs glib-2.0 dbus-glib-1 libproxy-1.0 dbus-1` `curl-config --libs` -Wl,"-z relro" -Wl,"-z now"
-
-all: corewatcher corewatcher-config corewatcher.8.gz
-
-.c.o:
- $(CC) $(CFLAGS) $(MY_CFLAGS) -c -o $@ $<
-
-
-corewatcher: corewatcher.o submit.o coredump.o configfile.o find_file.o corewatcher.h
- gcc corewatcher.o submit.o coredump.o configfile.o find_file.o $(LDF_D) -o corewatcher
-
-corewatcher-config: corewatcher-config.o
- gcc corewatcher-config.o $(LDF_C)-o corewatcher-config
-
-corewatcher.8.gz: corewatcher.8
- gzip -9 -c $< > $@
-
-clean:
- rm -f *~ *.o *.ko DEADJOE corewatcher corewatcher-config *.out */*~ corewatcher.8.gz
-
-install-system: corewatcher.8.gz
- -mkdir -p $(DESTDIR)$(MANDIR)
- -mkdir -p $(DESTDIR)/var/lib/corewatcher
- -mkdir -p $(DESTDIR)/etc/security/limits.d/
- -mkdir -p $(DESTDIR)/etc/dbus-1/system.d/
- -mkdir -p $(DESTDIR)/etc/sysctl.d/
- install -m 0644 95-core.conf $(DESTDIR)/etc/security/limits.d/95-core.conf
- if [ ! -f $(DESTDIR)/etc/corewatcher.conf ] ; then install -m 0644 corewatcher.conf $(DESTDIR)/etc/corewatcher.conf ; fi
- install -m 0644 corewatcher.dbus $(DESTDIR)/etc/dbus-1/system.d/
- install -m 0644 corewatcher.8.gz $(DESTDIR)$(MANDIR)/
- install -m 0644 gdb.command $(DESTDIR)/var/lib/corewatcher/
- install -m 0644 corewatcher.sysctl $(DESTDIR)/etc/sysctl.d/corewatcher.conf
-
-install-corewatcher: corewatcher
- -mkdir -p $(DESTDIR)$(SBINDIR)
- install -m 0755 corewatcher $(DESTDIR)$(SBINDIR)/
- install -m 0755 corewatcher-config $(DESTDIR)$(SBINDIR)/
-
-install: install-system install-corewatcher
-
-tests: corewatcher
- desktop-file-validate *.desktop
- for i in test/*txt ; do echo -n . ; ./corewatcher --debug $$i > $$i.dbg ; diff -u $$i.out $$i.dbg ; done ; echo
- [ -e /usr/bin/valgrind ] && for i in test/*txt ; do echo -n . ; valgrind -q --leak-check=full ./corewatcher --debug $$i > $$i.dbg ; diff -u $$i.out $$i.dbg ; done ; echo
-
-valgrind: corewatcher tests
- valgrind -q --leak-check=full ./corewatcher --debug test/*.txt
-
-dist:
- git tag v$(VERSION)
- git archive --format=tar --prefix="corewatcher-$(VERSION)/" v$(VERSION) | \
- gzip > corewatcher-$(VERSION).tar.gz
--- /dev/null
+AC_PREREQ([2.68])
+AC_INIT([corewatcher],[0.27],[william.douglas@intel.com])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+AC_CONFIG_FILES([Makefile src/Makefile])
+AC_CONFIG_SRCDIR([src/corewatcher.c])
+AC_CONFIG_HEADERS([config.h])
+
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+
+# Checks for libraries.
+AC_CHECK_LIB([pthread], [pthread_mutex_unlock], , AC_MSG_ERROR([libpthread is required but was not found]))
+
+# PkgConfig tests
+PKG_CHECK_MODULES([DBUS], [dbus-1])
+PKG_CHECK_MODULES([DBUSGLIB], [dbus-glib-1])
+PKG_CHECK_MODULES([GLIB2], [glib-2.0])
+PKG_CHECK_MODULES([LIBPROXY], [libproxy-1.0])
+PKG_CHECK_MODULES([LIBNOTIFY], [libnotify])
+PKG_CHECK_MODULES([LIBCURL], [libcurl])
+
+# Checks for header files.
+AC_CHECK_HEADERS([stdio.h assert.h sys/types.h sys/stat.h dirent.h signal.h errno.h sched.h fcntl.h stdlib.h string.h sys/time.h syslog.h unistd.h asm/unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+
+AC_OUTPUT
+AC_MSG_RESULT([
+ corewatcher $VERSION
+ ========
+
+ prefix: ${prefix}
+ sysconfdir: ${sysconfdir}
+ exec_prefix: ${exec_prefix}
+ bindir: ${bindir}
+ sbindir: ${sbindir}
+ datarootdir: ${datarootdir}
+ mandir: ${mandir}
+
+ compiler: ${CC}
+ cflags: ${CFLAGS}
+ ldflags: ${LDFLAGS}
+])