diff --git a/Makefile.am b/Makefile.am index 1f01b2ec..c3626739 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS=subdir-objects PREFIX=/usr -AM_CFLAGS=-O2 -Wall -g +AM_CFLAGS=-O2 -Wall -g -std=gnu99 bin_PROGRAMS=make-bcache \ @@ -12,18 +12,22 @@ bin_PROGRAMS=make-bcache \ noinst_PROGRAMS=bcache-test make_bcache_SOURCES=make-bcache.c bcache.c -make_bcache_LDADD= -lm -lssl -lcrypto -luuid +make_bcache_LDFLAGS=`pkg-config --libs uuid blkid` +make_bcache_CFLAGS=$(AM_CFLAGS) `pkg-config --cflags uuid blkid` probe_bcache_SOURCES=probe-bcache.c bcache.c -probe_bcache_LDADD=-luuid +probe_bcache_LDFLAGS=`pkg-config --libs uuid blkid` +probe_bcache_CFLAGS=$(AM_CFLAGS) `pkg-config --cflags uuid blkid` bcache_super_show_SOURCES=bcache-super-show.c bcache.c -bcache_super_show_LDADD=-luuid +bcache_super_show_LDFLAGS=`pkg-config --libs uuid` +bcache_super_show_CFLAGS=$(AM_CFLAGS) `pkg-config --cflags uuid` bcache_test_SOURCE=bcache-test.c -bcache_test_LDADD= -lm -lssl -lcrypto +bcache_test_LDFLAGS=-lm `pkg-config --libs openssl` +bcache_test_CFLAGS=$(AM_CFLAGS) `pkg-config --cflags openssl` -udevrule_DATA=61-bcache.rules +udevrule_DATA=69-bcache.rules udevruledir=$(prefix)/lib/udev/rules.d udevr_DATA=bcache-register diff --git a/bcache-tools.spec b/bcache-tools.spec new file mode 100644 index 00000000..1b19b1a5 --- /dev/null +++ b/bcache-tools.spec @@ -0,0 +1,16 @@ +Summary: bcache-tools +Name: bcache-tools +Version: 0.1 +Release: %{?release:%{release}}%{!?release:eng} +Source0: %{name}-%{version}.tar.gz +License: GPL +Group: tools +BuildRoot: %{_tmppath}/%{name}-root +Requires: libblkid1 +BuildRequires: pkg-config libblkid-dev + +%package dev + +%description + +%files diff --git a/bcache.c b/bcache.c index 8f37445d..8b4b9866 100644 --- a/bcache.c +++ b/bcache.c @@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = { 0x9AFCE626CE85B507ULL }; -inline uint64_t crc64(const void *_data, size_t len) +uint64_t crc64(const void *_data, size_t len) { uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; const unsigned char *data = _data;