From 24e98ce46d17ebdff72467e73794c7851b2ed28f Mon Sep 17 00:00:00 2001 From: Claudio Fleiner Date: Mon, 28 Oct 2013 22:44:07 -0700 Subject: [PATCH] Adding autotools support to bcache-tools thie enables building it in a different directory, more flexible install and configure options, and should make it easier to eventualy create deb and rpm packages. Additionally this makes it much easier to build and test this package as it now behaves the same way as others we are using. --- .gitignore | 13 +++++++++++++ Makefile.am | 37 +++++++++++++++++++++++++++++++++++++ autogen.sh | 18 ++++++++++++++++++ configure.ac | 24 ++++++++++++++++++++++++ initramfs/{hook => bcache} | 0 5 files changed, 92 insertions(+) create mode 100644 Makefile.am create mode 100755 autogen.sh create mode 100644 configure.ac rename initramfs/{hook => bcache} (100%) diff --git a/.gitignore b/.gitignore index e86f256..529b240 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,16 @@ make-bcache probe-bcache .* *.o +Makefile.in +aclocal.m4 +autom4te.cache +compile +config.guess +config.h.in +config.sub +configure +depcomp +install-sh +ltmain.sh +m4 +missing diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..1f01b2e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,37 @@ + +AUTOMAKE_OPTIONS=subdir-objects + +PREFIX=/usr +AM_CFLAGS=-O2 -Wall -g + + +bin_PROGRAMS=make-bcache \ + probe-bcache \ + bcache-super-show + +noinst_PROGRAMS=bcache-test + +make_bcache_SOURCES=make-bcache.c bcache.c +make_bcache_LDADD= -lm -lssl -lcrypto -luuid + +probe_bcache_SOURCES=probe-bcache.c bcache.c +probe_bcache_LDADD=-luuid + +bcache_super_show_SOURCES=bcache-super-show.c bcache.c +bcache_super_show_LDADD=-luuid + +bcache_test_SOURCE=bcache-test.c +bcache_test_LDADD= -lm -lssl -lcrypto + +udevrule_DATA=61-bcache.rules +udevruledir=$(prefix)/lib/udev/rules.d + +udevr_DATA=bcache-register +udevrdir=$(prefix)/lib/udev/ + +initramfs_SCRIPTS=initramfs/bcache +initramfsdir=$(prefix)/etc/initramfs-tools/hooks/ + +man8_MANS= bcache-super-show.8 \ + make-bcache.8 \ + probe-bcache.8 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..8a566d4 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +export ACLOCAL_FLAGS="" +export ACLOCAL_AMFLAGS="-I m4" + +aclocal $ACLOCAL_FLAGS + +if glibtoolize -h > /dev/null 2>&1 ; then + glibtoolize --copy --force +else + libtoolize --copy --force +fi + +autoheader +automake --copy --add-missing --foreign -Wall -Wno-portability +autoconf diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..30a7e66 --- /dev/null +++ b/configure.ac @@ -0,0 +1,24 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.61) +AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) +AM_INIT_AUTOMAKE +LT_INIT +AC_CONFIG_HEADER([config.h]) +AC_CONFIG_MACRO_DIR([m4]) + +# Checks for programs. +AC_PROG_CC + + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/initramfs/hook b/initramfs/bcache similarity index 100% rename from initramfs/hook rename to initramfs/bcache -- 2.39.2