summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore11
-rw-r--r--Makefile.am49
-rw-r--r--configure.ac32
-rw-r--r--src/builtin/xor_codes/Makefile.am9
-rw-r--r--test/Makefile.am16
5 files changed, 55 insertions, 62 deletions
diff --git a/.gitignore b/.gitignore
index 7d9d6e6..21927c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,3 +29,14 @@
# cscope files
cscope.*out
+
+# autoconf/automake files
+.dirstamp
+.libs
+autom4te.cache
+config.guess
+config.log
+config.status
+config.sub
+Makefile
+
diff --git a/Makefile.am b/Makefile.am
index 320533e..08df99e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,14 +1,21 @@
# Top-level liberasurecode automake configuration
ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src/builtin/xor_codes test
+EXTRA_DIST = autogen.sh
+
if DEBUG
-AM_CFLAGS = -g3 -O0
+AM_CFLAGS = -g3 -O0 -D_GNU_SOURCE=1
else
-AM_CFLAGS = -O2
+AM_CFLAGS = -O2 -D_GNU_SOURCE=1
endif
-AM_CPPFLAGS = $(CPPFLAGS) -I$(abs_top_builddir)/include/xor_codes
-AM_CPPFLAGS += -I$(abs_top_builddir)/include/erasurecode -Werror
+INCLUDE = -I$(abs_top_builddir)/include \
+ -I$(abs_top_builddir)/include/erasurecode \
+ -I$(abs_top_builddir)/include/xor_codes
+
+AM_CPPFLAGS = $(CPPFLAGS) $(INCLUDE)
+AM_CPPFLAGS += -Werror
AM_CFLAGS += -fPIC $(AM_CPPFLAGS) -L/usr/local/lib
@@ -21,15 +28,7 @@ include_HEADERS = \
include/xor_codes/xor_hd_code_defs.h \
include/xor_codes/xor_code.h
-lib_LTLIBRARIES = libXorcode.la liberasurecode.la
-
-# libXorcode params
-libXorcode_la_SOURCES = \
- src/builtin/xor_codes/xor_code.c \
- src/builtin/xor_codes/xor_hd_code.c
-
-# Version format (C - A).(A).(R) for C:R:A input
-libXorcode_la_LDFLAGS = -rpath '$(libdir)' -version-info 1:1:0
+lib_LTLIBRARIES = liberasurecode.la
# liberasurecode params
liberasurecode_la_SOURCES = \
@@ -39,36 +38,22 @@ liberasurecode_la_SOURCES = \
src/utils/chksum/crc32.c \
src/utils/chksum/alg_sig.c
-liberasurecode_la_LIBADD = -lXorcode -lgf_complete
+liberasurecode_la_LIBADD = src/builtin/xor_codes/libXorcode.la -lgf_complete
# Version format (C - A).(A).(R) for C:R:A input
liberasurecode_la_LDFLAGS = -rpath '$(libdir)' -version-info 9:4:9
-noinst_HEADERS = test/builtin/xor_codes/test_xor_hd_code.h
-noinst_PROGRAMS = test_xor_hd_code alg_sig_test
-
-test_xor_hd_code_SOURCES = \
- test/builtin/xor_codes/test_xor_hd_code.c \
- test/builtin/xor_codes/test_xor_hd_code.h
-
-test_xor_hd_code_LDFLAGS = -lerasurecode -lXorcode -lgf_complete
-check_PROGRAMS = test_xor_hd_code
-
-alg_sig_test_SOURCES = test/utils/chksum/test_alg_sig.c
-alg_sig_test_LDFLAGS = -lerasurecode -lXorcode -lgf_complete
-check_PROGRAMS += alg_sig_test
-
test: check
- @./alg_sig_test
- @./test_xor_hd_code
+ @./test/alg_sig_test
+ @./test/test_xor_hd_code
VALGRIND_EXEC_COMMAND = $(LIBTOOL_COMMAND) valgrind --tool=memcheck \
--error-exitcode=1 --leak-check=yes --track-fds=yes \
--malloc-fill=A5 --free-fill=DE --fullpath-after=.
valgrind-test: check
- @$(VALGRIND_EXEC_COMMAND) ./alg_sig_test
- @$(VALGRIND_EXEC_COMMAND) ./test_xor_hd_code
+ @$(VALGRIND_EXEC_COMMAND) ./test/alg_sig_test
+ @$(VALGRIND_EXEC_COMMAND) ./test/test_xor_hd_code
CLEANFILES = cscope.in.out cscope.out cscope.po.out
diff --git a/configure.ac b/configure.ac
index c87059b..ae1ee00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,3 @@
-# c_eclib autoconf template
-
-# FIXME - add project url as the last argument
AC_INIT(erasurecode,0.9.4)
AC_GNU_SOURCE
@@ -24,15 +21,6 @@ AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
-dnl Set up compile and link options
-INCLUDE="-I$srcdir/include -I$srcdir/include/erasurecode -I$srcdir/xor_codes"
-BASE_CFLAGS="-D_GNU_SOURCE=1"
-BASE_LDFLAGS=""
-BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
-EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
-BUILD_LDFLAGS="$LDFLAGS"
-EXTRA_LDFLAGS="$BASE_LDFLAGS"
-
dnl Check for C library headers
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h \
@@ -48,18 +36,6 @@ AC_CHECK_LIB([gf_complete], [gf_init_easy], [],
exit -1
])
-
-# C sources
-SOURCES="$SOURCES $srcdir/src/*.c"
-SOURCES="$SOURCES $srcdir/src/backends/null/*.c"
-SOURCES="$SOURCES $srcdir/src/backends/jerasure/*.c"
-SOURCES="$SOURCES $srcdir/src/backends/gf_complete/*.c"
-SOURCES="$SOURCES $srcdir/src/backends/isa_l/*.c"
-SOURCES="$SOURCES $srcdir/src/backends/xor/*.c"
-SOURCES="$SOURCES $srcdir/src/builtins/xor/*.c"
-SOURCES="$SOURCES $srcdir/src/utils/chksum/*.c"
-SOURCES="$SOURCES $srcdir/test/*.c"
-
# Check for jerasure/gf_complete headers
AC_CHECK_HEADERS(jerasure.h cauchy.h galois.h liberation.h reed_sol.h gf_complete.h)
@@ -78,15 +54,11 @@ AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
-AC_SUBST(INCLUDE)
-AC_SUBST(SOURCES)
AC_SUBST(OBJECTS)
-AC_SUBST(BUILD_CFLAGS)
-AC_SUBST(EXTRA_CFLAGS)
-AC_SUBST(BUILD_LDFLAGS)
-AC_SUBST(EXTRA_LDFLAGS)
AC_CONFIG_FILES([Makefile \
+ src/builtin/xor_codes/Makefile \
+ test/Makefile \
erasurecode.pc \
Xorcode.pc])
AC_OUTPUT
diff --git a/src/builtin/xor_codes/Makefile.am b/src/builtin/xor_codes/Makefile.am
new file mode 100644
index 0000000..b69b20f
--- /dev/null
+++ b/src/builtin/xor_codes/Makefile.am
@@ -0,0 +1,9 @@
+lib_LTLIBRARIES = libXorcode.la
+
+# libXorcode params
+libXorcode_la_SOURCES = xor_code.c xor_hd_code.c
+libXorcode_la_CPPFLAGS = -I$(top_srcdir)/include/xor_codes
+
+# Version format (C - A).(A).(R) for C:R:A input
+libXorcode_la_LDFLAGS = -rpath '$(libdir)' -version-info 1:1:0
+
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..bfa8a8f
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,16 @@
+test_xor_hd_code_SOURCES = \
+ builtin/xor_codes/test_xor_hd_code.c \
+ builtin/xor_codes/test_xor_hd_code.h
+test_xor_hd_code_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/erasurecode -I$(top_srcdir)/include/xor_codes
+test_xor_hd_code_LDFLAGS = -lerasurecode -lgf_complete $(top_srcdir)/src/builtin/xor_codes/libXorcode.la
+check_PROGRAMS = test_xor_hd_code
+
+alg_sig_test_SOURCES = utils/chksum/test_alg_sig.c
+alg_sig_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/erasurecode -I$(top_srcdir)/include/xor_codes
+alg_sig_test_LDFLAGS = -lerasurecode -lgf_complete $(top_srcdir)/src/builtin/xor_codes/libXorcode.la
+check_PROGRAMS += alg_sig_test
+
+noinst_HEADERS = builtin/xor_codes/test_xor_hd_code.h
+noinst_PROGRAMS = test_xor_hd_code alg_sig_test
+
+