-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Simon Howard <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
AUX_DIST_GEN = $(ac_aux_dir) | ||
|
||
EXTRA_DIST = $(AUX_DIST_GEN) | ||
MAINTAINERCLEANFILES = $(AUX_DIST_GEN) | ||
|
||
$(pkgconfig_DATA) : config.status | ||
|
||
SUBDIRS=lib test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p autotools | ||
|
||
aclocal | ||
libtoolize | ||
autoheader | ||
automake -a | ||
autoconf | ||
automake -a | ||
|
||
./configure $@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
AC_INIT(Lhasa, 0.0.1, [email protected], lhasa) | ||
AC_CONFIG_AUX_DIR(autotools) | ||
|
||
AM_INIT_AUTOMAKE($PACKAGE_TARNAME, $PACKAGE_VERSION, no-define) | ||
AM_PROG_CC_C_O | ||
|
||
AC_PROG_CXX | ||
AC_PROG_LIBTOOL | ||
AC_PROG_INSTALL | ||
AC_PROG_MAKE_SET | ||
|
||
if [[ "$GCC" = "yes" ]]; then | ||
is_gcc=true | ||
else | ||
is_gcc=false | ||
fi | ||
|
||
TEST_CFLAGS="" | ||
|
||
# Turn on all warnings for gcc. Turn off optimisation for the test build. | ||
|
||
if $is_gcc; then | ||
WARNINGS="-Wall -Wsign-compare -Wconversion" | ||
CFLAGS="$CFLAGS $WARNINGS" | ||
TEST_CFLAGS="$TEST_CFLAGS $WARNINGS -O0" | ||
fi | ||
|
||
# Support for coverage analysis via gcov: | ||
|
||
coverage=no | ||
AC_ARG_ENABLE(coverage, | ||
[ --enable-coverage Enable coverage testing. ], | ||
[ coverage=yes ]) | ||
|
||
if [[ "$coverage" = "yes" ]]; then | ||
if $is_gcc; then | ||
TEST_CFLAGS="$TEST_CFLAGS -fprofile-arcs -ftest-coverage" | ||
else | ||
AC_MSG_ERROR([Can only enable coverage when using gcc.]) | ||
fi | ||
fi | ||
|
||
# Support for running test cases using valgrind: | ||
|
||
use_valgrind=false | ||
AC_ARG_ENABLE(valgrind, | ||
[ --enable-valgrind Use valgrind when running unit tests. ], | ||
[ use_valgrind=true ]) | ||
|
||
if [[ "$use_valgrind" = "true" ]]; then | ||
AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no) | ||
|
||
if [[ "$HAVE_VALGRIND" = "no" ]]; then | ||
AC_MSG_ERROR([Valgrind not found in PATH. ]) | ||
fi | ||
fi | ||
|
||
AM_CONDITIONAL(USE_VALGRIND, $use_valgrind) | ||
|
||
# Save the default CFLAGS and clear them, so that the test build | ||
# of the library doesn't get the optimisation flags. | ||
|
||
MAIN_CFLAGS="$CFLAGS" | ||
CFLAGS="" | ||
|
||
AC_SUBST(MAIN_CFLAGS) | ||
AC_SUBST(TEST_CFLAGS) | ||
AC_SUBST(ac_aux_dir) | ||
|
||
AC_OUTPUT([ | ||
Makefile | ||
lib/Makefile | ||
test/Makefile | ||
]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
lib_LTLIBRARIES=liblhasa.la | ||
check_LIBRARIES=liblhasatest.a | ||
|
||
SRC= \ | ||
lha_decoder.h \ | ||
lha_file_header.h \ | ||
lha_input_stream.h \ | ||
lha_lzss_decoder.h \ | ||
lha_reader.h | ||
|
||
HEADER_FILES= \ | ||
lha_decoder.c \ | ||
lha_file_header.c \ | ||
lha_input_stream.c \ | ||
lha_lzss_decoder.c \ | ||
lha_reader.c | ||
|
||
liblhasatest_a_CFLAGS=$(TEST_CFLAGS) -DALLOC_TESTING -I../test -g | ||
liblhasatest_a_SOURCES=$(SRC) $(HEADER_FILES) | ||
|
||
liblhasa_la_CFLAGS=$(MAIN_CFLAGS) | ||
liblhasa_la_SOURCES=$(SRC) $(HEADER_FILES) | ||
|
||
headerfilesdir=$(includedir)/liblhasa-1.0 | ||
headerfiles_HEADERS=$(HEADER_FILES) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
AM_CFLAGS=$(TEST_CFLAGS) -I../lib -g | ||
LDADD=$(top_builddir)/lib/liblhasatest.a | ||
|
||
TESTS= \ | ||
test-larc | ||
|
||
EXTRA_DIST=larc_lz4.lzs larc_lz5.lzs | ||
|
||
check_PROGRAMS=$(TESTS) | ||
|