diff --git a/.gitignore b/.gitignore index 25aa57493503c32f4dfe5eefca96ef444eb1a8c1..d2f2392d25e2b57c4718313e0b1c47fea27e519f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,5 @@ libtool autom4te.cache .DS_Store build* -m4/libtool.m4 -m4/lt* +m4/* +lib/* diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f3861853aaf5c0f4a372b8cf260f28ec502fee2..6ece68f4710917e4486daaad81649df9d7d96ac2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,87 +1,84 @@ -cmake_minimum_required(VERSION 3.1) -set(CMAKE_C_STANDARD 99) -include(CheckIncludeFiles) -include(TestBigEndian) -include(CheckCSourceCompiles) -include(CheckSymbolExists) -include(cmake/macros.cmake) +cmake_minimum_required(VERSION 3.13...3.19) +project(libaec LANGUAGES C VERSION 1.0.4) +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) -option(AEC_FUZZING "Enable build of fuzzing targets" OFF) -if(AEC_FUZZING) - project(libaec C CXX) -else(AEC_FUZZING) - project(libaec C) -endif(AEC_FUZZING) - -set(libaec_VERSION_MAJOR 1) -set(libaec_VERSION_MINOR 0) -set(libaec_VERSION_PATCH 4) -set(CMAKE_BUILD_TYPE Release) +# Automatically export symbls for Windows DLLs +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_VISIBILITY_PRESET hidden) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) enable_testing() -check_include_files(malloc.h HAVE_MALLOC_H) +include(TestBigEndian) test_big_endian(WORDS_BIGENDIAN) -check_clzll(HAVE_DECL___BUILTIN_CLZLL) + +# Check for __builtin_clzll for faster decoding +include(CheckCSourceCompiles) +check_c_source_compiles( + "int main(void)\n{return __builtin_clzll(1LL);}" + HAVE_DECL___BUILTIN_CLZLL) + if(NOT HAVE_DECL___BUILTIN_CLZLL) - check_bsr64(HAVE_BSR64) -endif(NOT HAVE_DECL___BUILTIN_CLZLL) -find_inline_keyword() -find_restrict_keyword() + # With MSVC we can use _BitScanReverse64 + check_c_source_compiles( + "int main(void){unsigned long foo; unsigned __int64 bar=1LL; +return _BitScanReverse64(&foo, bar);}" + HAVE_BSR64) +endif() +include(CheckSymbolExists) check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) if(NOT HAVE_SNPRINTF) check_symbol_exists(_snprintf "stdio.h" HAVE__SNPRINTF) check_symbol_exists(_snprintf_s "stdio.h" HAVE__SNPRINTF_S) -endif(NOT HAVE_SNPRINTF) +endif() +# Communicate findings to code. Has to be compatible with autoconf's config.h. configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in - ${CMAKE_CURRENT_BINARY_DIR}/config.h) + "cmake/config.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/config.h") add_definitions("-DHAVE_CONFIG_H") -option(BUILD_SHARED_LIBS "Build Shared Libraries" ON) -if(BUILD_SHARED_LIBS) - set (LIB_TYPE SHARED) -else(BUILD_SHARED_LIBS) - set(LIB_TYPE STATIC) -endif(BUILD_SHARED_LIBS) - -set(libaec_SRCS - ${PROJECT_SOURCE_DIR}/src/encode.c - ${PROJECT_SOURCE_DIR}/src/encode_accessors.c - ${PROJECT_SOURCE_DIR}/src/decode.c) - -include_directories("${PROJECT_BINARY_DIR}") -include_directories("${PROJECT_SOURCE_DIR}/src") - add_subdirectory(src) add_subdirectory(tests) + +option(AEC_FUZZING "Enable build of fuzzing target" OFF) if(AEC_FUZZING) + enable_language(CXX) + + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + message(FATAL_ERROR "You need to build with Clang for fuzzing to work") + endif() + + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + message(FATAL_ERROR "You need Clang ≥ 6.0.0") + endif() + add_subdirectory(fuzzing) + set(FUZZ_TARGET_SAN_FLAGS -fsanitize=fuzzer-no-link,address,undefined) + target_compile_options(aec PUBLIC -g -O1 ${FUZZ_TARGET_SAN_FLAGS}) + target_link_options(aec PUBLIC ${FUZZ_TARGET_SAN_FLAGS}) endif() +# Cpack configuration mainly for Windows installer set(CPACK_PACKAGE_NAME "libaec") set(CPACK_PACKAGE_VENDOR "Deutsches Klimarechenzentrum GmbH") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libaec - Adaptive Entropy Coding library") -set(CPACK_PACKAGE_VERSION_MAJOR "${libaec_VERSION_MAJOR}") -set(CPACK_PACKAGE_VERSION_MINOR "${libaec_VERSION_MINOR}") -set(CPACK_PACKAGE_VERSION_PATCH "${libaec_VERSION_PATCH}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "libaec") -set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/Copyright.txt") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") if(WIN32) set(CPACK_GENERATOR "WIX") set(CPACK_WIX_UPGRADE_GUID "E58A21F6-BB99-46B5-8AD8-6114E4CCA0A6") - if(CMAKE_CL_64) - set(CPACK_INSTALL_DIRECTORY "$PROGRAMFILES64") - set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY - "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") - else(CMAKE_CL_64) - set(CPACK_INSTALL_DIRECTORY "$PROGRAMFILES") - set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY - "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") - endif(CMAKE_CL_64) -endif(WIN32) +endif() + +set(CPACK_SOURCE_IGNORE_FILES + /.git + /.*build.* + .*~ + .*\#.*\# + \..*\#.*) include(CPack) diff --git a/Config.cmake.in b/Config.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..a2ce34f9c5beb89c9f7c29054096640a9f1cac5b --- /dev/null +++ b/Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/LibaecTargets.cmake") + +check_required_components(libaec) diff --git a/INSTALL b/INSTALL.md similarity index 92% rename from INSTALL rename to INSTALL.md index 4928d77a0531908214685800ed5333e344aacaae..ea2a2603c10005463d09056bdd2bba705416bb0c 100644 --- a/INSTALL +++ b/INSTALL.md @@ -1,5 +1,4 @@ -Getting libaec -============== +# Getting libaec The source code of libaec is hosted at DKRZ GitLab. @@ -15,8 +14,7 @@ location: git clone https://gitlab.dkrz.de/k202009/libaec.git -Installation -============ +# Installation ## General considerations @@ -64,18 +62,18 @@ used in Windows. ## Installation from cloned repository The configure script is not included in the repository. You can -generate it with autotools: +generate it with autotools and gnulib: cd libaec - autoreconv -iv + gnulib-tool --import lib-symbol-visibility + autoreconf -iv mkdir build cd build ../configure make check install -Intel compiler settings -======================= +# Intel compiler settings The Intel compiler can improve performance by vectorizing certain parts of the code on x86 architectures. Assuming your CPU supports diff --git a/Copyright.txt b/LICENSE.txt similarity index 100% rename from Copyright.txt rename to LICENSE.txt diff --git a/Makefile.am b/Makefile.am index c262e41616dde7852cffdc33d639f5f52c3511a1..d26dd53949cdf91e15734ff34717749ba8668ede 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src tests EXTRA_DIST = doc/patent.txt CMakeLists.txt cmake/config.h.in \ -cmake/macros.cmake README.md README.SZIP CHANGELOG.md Copyright.txt data +INSTALL.md README.md README.SZIP CHANGELOG.md LICENSE.txt data sampledata = 121B2TestData sampledata_url = https://cwe.ccsds.org/sls/docs/SLS-DC/BB121B2TestData/$(sampledata).zip diff --git a/cmake/config.h.in b/cmake/config.h.in index e87bb50c39d5cb6e98e4e356965e006eaaedad0b..968714466384204447189b4a37cd4286907d37fc 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -1,7 +1,6 @@ -#cmakedefine HAVE_MALLOC_H 1 -#cmakedefine WORDS_BIGENDIAN 1 -#cmakedefine HAVE_DECL___BUILTIN_CLZLL 1 -#cmakedefine HAVE_BSR64 1 -#cmakedefine HAVE_SNPRINTF 1 -#cmakedefine HAVE__SNPRINTF 1 -#cmakedefine HAVE__SNPRINTF_S 1 +#cmakedefine WORDS_BIGENDIAN +#cmakedefine01 HAVE_DECL___BUILTIN_CLZLL +#cmakedefine01 HAVE_BSR64 +#cmakedefine HAVE_SNPRINTF +#cmakedefine HAVE__SNPRINTF +#cmakedefine HAVE__SNPRINTF_S diff --git a/cmake/macros.cmake b/cmake/macros.cmake deleted file mode 100644 index a568b15e575978df09ae9bbf3104fde0440a5fe0..0000000000000000000000000000000000000000 --- a/cmake/macros.cmake +++ /dev/null @@ -1,77 +0,0 @@ -macro(check_clzll VARIABLE) - check_c_source_compiles( - "int main(int argc, char *argv[]) -{return __builtin_clzll(1LL);}" - ${VARIABLE} - ) -endmacro() - -macro(check_bsr64 VARIABLE) - check_c_source_compiles( - "int main(int argc, char *argv[]) -{unsigned long foo; unsigned __int64 bar=1LL; -return _BitScanReverse64(&foo, bar);}" - ${VARIABLE} - ) -endmacro() - -macro(find_inline_keyword) - #Inspired from http://www.cmake.org/Wiki/CMakeTestInline - set(INLINE_TEST_SRC "/* Inspired by autoconf's c.m4 */ -static inline int static_foo(){return 0\;} -int main(int argc, char *argv[]){return 0\;} -") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCInline.c - ${INLINE_TEST_SRC}) - - foreach(KEYWORD "inline" "__inline__" "__inline") - if(NOT DEFINED C_INLINE) - try_compile(C_HAS_${KEYWORD} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCInline.c - COMPILE_DEFINITIONS "-Dinline=${KEYWORD}" - ) - if(C_HAS_${KEYWORD}) - set(C_INLINE TRUE) - add_definitions("-Dinline=${KEYWORD}") - message(STATUS "Inline keyword found - ${KEYWORD}") - endif(C_HAS_${KEYWORD}) - endif(NOT DEFINED C_INLINE) - endforeach(KEYWORD) - - if(NOT DEFINED C_INLINE) - add_definitions("-Dinline=") - message(STATUS "Inline keyword - not found") - endif(NOT DEFINED C_INLINE) -endmacro(find_inline_keyword) - -macro(find_restrict_keyword) - set(RESTRICT_TEST_SRC "/* Inspired by autoconf's c.m4 */ -int foo (int * restrict ip){return ip[0]\;} -int main(int argc, char *argv[]){int s[1]\; -int * restrict t = s\; t[0] = 0\; return foo(t)\;} -") - - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCRestrict.c - ${RESTRICT_TEST_SRC}) - - foreach(KEYWORD "restrict" "__restrict" "__restrict__" "_Restrict") - if(NOT DEFINED C_RESTRICT) - try_compile(C_HAS_${KEYWORD} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCRestrict.c - COMPILE_DEFINITIONS "-Drestrict=${KEYWORD}" - ) - if(C_HAS_${KEYWORD}) - set(C_RESTRICT TRUE) - add_definitions("-Drestrict=${KEYWORD}") - message(STATUS "Restrict keyword found - ${KEYWORD}") - endif(C_HAS_${KEYWORD}) - endif(NOT DEFINED C_RESTRICT) - endforeach(KEYWORD) - - if(NOT DEFINED C_RESTRICT) - add_definitions("-Drestrict=") - message(STATUS "Restrict keyword - not found") - endif(NOT DEFINED C_RESTRICT) -endmacro(find_restrict_keyword) diff --git a/configure.ac b/configure.ac index 272eeaace28fddf78adaab62d86790b23d9cf171..f4bd757e6fcfe42affe28837479fd5c837689342 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_INIT([libaec], [1.0.4], [rosenhauer@dkrz.de]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_SRCDIR([src/libaec.h]) +AC_CONFIG_SRCDIR([src/decode.c]) AC_CONFIG_HEADERS(config/config.h) LT_INIT diff --git a/fuzzing/CMakeLists.txt b/fuzzing/CMakeLists.txt index c1b71bb2f0f021c40b6f3fdbadd30d776b501d5b..dd4577e438be5d047544eed4b02ff668fe02130e 100644 --- a/fuzzing/CMakeLists.txt +++ b/fuzzing/CMakeLists.txt @@ -1,18 +1,5 @@ -if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") - message(FATAL_ERROR "You need to build with Clang for fuzzing to work") -endif() - -add_library(aec_fuzz STATIC ${libaec_SRCS}) add_executable(fuzz_target fuzz_target.cc) +target_link_libraries(fuzz_target aec) -set(FUZZ_TARGET_LINK_FLAGS "-fsanitize=address,undefined") -set(FUZZ_TARGET_COMPILE_FLAGS - "-g" - "-fsanitize=address,undefined" - "-fno-sanitize-recover=undefined" - "-fsanitize-coverage=trace-pc-guard,indirect-calls,edge") -set_target_properties(fuzz_target aec_fuzz PROPERTIES - LINK_FLAGS ${FUZZ_TARGET_LINK_FLAGS} - COMPILE_OPTIONS "${FUZZ_TARGET_COMPILE_FLAGS}") - -target_link_libraries(fuzz_target aec_fuzz Fuzzer) +# Actually link libFuzzer +target_link_options(fuzz_target PRIVATE -fsanitize=fuzzer) diff --git a/include/libaec.h b/include/libaec.h deleted file mode 120000 index ccf535952a6a199cae78eecd4c6299d888b66dc3..0000000000000000000000000000000000000000 --- a/include/libaec.h +++ /dev/null @@ -1 +0,0 @@ -../src/libaec.h \ No newline at end of file diff --git a/include/libaec.h b/include/libaec.h new file mode 100644 index 0000000000000000000000000000000000000000..b159f34ff382f875227d6773a7eda475ca3fa787 --- /dev/null +++ b/include/libaec.h @@ -0,0 +1,163 @@ +/** + * @file libaec.h + * + * @section LICENSE + * Copyright 2021 Mathis Rosenhauer, Moritz Hanke, Joerg Behrens, Luis Kornblueh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @section DESCRIPTION + * + * Adaptive Entropy Coding library + * + */ + +#ifndef LIBAEC_H +#define LIBAEC_H 1 + +#include <stddef.h> + +#ifdef __cplusplus +extern "C"{ +#endif + +#if BUILDING_LIBAEC && HAVE_VISIBILITY +# define LIBAEC_DLL_EXPORTED __attribute__((__visibility__("default"))) +#else +# define LIBAEC_DLL_EXPORTED +#endif + +struct internal_state; + +struct aec_stream { + const unsigned char *next_in; + + /* number of bytes available at next_in */ + size_t avail_in; + + /* total number of input bytes read so far */ + size_t total_in; + + unsigned char *next_out; + + /* remaining free space at next_out */ + size_t avail_out; + + /* total number of bytes output so far */ + size_t total_out; + + /* resolution in bits per sample (n = 1, ..., 32) */ + unsigned int bits_per_sample; + + /* block size in samples */ + unsigned int block_size; + + /* Reference sample interval, the number of blocks + * between consecutive reference samples (up to 4096). */ + unsigned int rsi; + + unsigned int flags; + + struct internal_state *state; +}; + +/*********************************/ +/* Sample data description flags */ +/*********************************/ + +/* Samples are signed. Telling libaec this results in a slightly + * better compression ratio. Default is unsigned. */ +#define AEC_DATA_SIGNED 1 + +/* 24 bit samples are coded in 3 bytes */ +#define AEC_DATA_3BYTE 2 + +/* Samples are stored with their most significant bit first. This has + * nothing to do with the endianness of the host. Default is LSB. */ +#define AEC_DATA_MSB 4 + +/* Set if preprocessor should be used */ +#define AEC_DATA_PREPROCESS 8 + +/* Use restricted set of code options */ +#define AEC_RESTRICTED 16 + +/* Pad RSI to byte boundary. Only used for decoding some CCSDS sample + * data. Do not use this to produce new data as it violates the + * standard. */ +#define AEC_PAD_RSI 32 + +/* Do not enforce standard regarding legal block sizes. */ +#define AEC_NOT_ENFORCE 64 + +/*************************************/ +/* Return codes of library functions */ +/*************************************/ +#define AEC_OK 0 +#define AEC_CONF_ERROR (-1) +#define AEC_STREAM_ERROR (-2) +#define AEC_DATA_ERROR (-3) +#define AEC_MEM_ERROR (-4) + +/************************/ +/* Options for flushing */ +/************************/ + +/* Do not enforce output flushing. More input may be provided with + * later calls. So far only relevant for encoding. */ +#define AEC_NO_FLUSH 0 + +/* Flush output and end encoding. The last call to aec_encode() must + * set AEC_FLUSH to drain all output. + * + * It is not possible to continue encoding of the same stream after it + * has been flushed. For one, the last block may be padded zeros after + * preprocessing. Secondly, the last encoded byte may be padded with + * fill bits. */ +#define AEC_FLUSH 1 + +/*********************************************/ +/* Streaming encoding and decoding functions */ +/*********************************************/ +LIBAEC_DLL_EXPORTED int aec_encode_init(struct aec_stream *strm); +LIBAEC_DLL_EXPORTED int aec_encode(struct aec_stream *strm, int flush); +LIBAEC_DLL_EXPORTED int aec_encode_end(struct aec_stream *strm); + +LIBAEC_DLL_EXPORTED int aec_decode_init(struct aec_stream *strm); +LIBAEC_DLL_EXPORTED int aec_decode(struct aec_stream *strm, int flush); +LIBAEC_DLL_EXPORTED int aec_decode_end(struct aec_stream *strm); + +/***************************************************************/ +/* Utility functions for encoding or decoding a memory buffer. */ +/***************************************************************/ +LIBAEC_DLL_EXPORTED int aec_buffer_encode(struct aec_stream *strm); +LIBAEC_DLL_EXPORTED int aec_buffer_decode(struct aec_stream *strm); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBAEC_H */ diff --git a/include/szlib.h b/include/szlib.h deleted file mode 120000 index f74bf00f9ab866cb2a8ef5d7fa9a5c121b756c2f..0000000000000000000000000000000000000000 --- a/include/szlib.h +++ /dev/null @@ -1 +0,0 @@ -../src/szlib.h \ No newline at end of file diff --git a/include/szlib.h b/include/szlib.h new file mode 100644 index 0000000000000000000000000000000000000000..256b3a4084f582ac0148cef50dfa4bbf8bb315e6 --- /dev/null +++ b/include/szlib.h @@ -0,0 +1,82 @@ +/** + * @file szlib.h + * + * @section LICENSE + * Copyright 2021 Mathis Rosenhauer, Moritz Hanke, Joerg Behrens, Luis Kornblueh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @section DESCRIPTION + * + * Adaptive Entropy Coding library + * + */ + +#ifndef SZLIB_H +#define SZLIB_H 1 + +#include <libaec.h> + +#define SZ_ALLOW_K13_OPTION_MASK 1 +#define SZ_CHIP_OPTION_MASK 2 +#define SZ_EC_OPTION_MASK 4 +#define SZ_LSB_OPTION_MASK 8 +#define SZ_MSB_OPTION_MASK 16 +#define SZ_NN_OPTION_MASK 32 +#define SZ_RAW_OPTION_MASK 128 + +#define SZ_OK AEC_OK +#define SZ_OUTBUFF_FULL 2 + +#define SZ_NO_ENCODER_ERROR -1 +#define SZ_PARAM_ERROR AEC_CONF_ERROR +#define SZ_MEM_ERROR AEC_MEM_ERROR + +#define SZ_MAX_PIXELS_PER_BLOCK 32 +#define SZ_MAX_BLOCKS_PER_SCANLINE 128 +#define SZ_MAX_PIXELS_PER_SCANLINE \ + (SZ_MAX_BLOCKS_PER_SCANLINE) * (SZ_MAX_PIXELS_PER_BLOCK) + +typedef struct SZ_com_t_s +{ + int options_mask; + int bits_per_pixel; + int pixels_per_block; + int pixels_per_scanline; +} SZ_com_t; + +LIBAEC_DLL_EXPORTED int SZ_BufftoBuffCompress( + void *dest, size_t *destLen, + const void *source, size_t sourceLen, + SZ_com_t *param); +LIBAEC_DLL_EXPORTED int SZ_BufftoBuffDecompress( + void *dest, size_t *destLen, + const void *source, size_t sourceLen, + SZ_com_t *param); + +LIBAEC_DLL_EXPORTED int SZ_encoder_enabled(void); + +#endif /* SZLIB_H */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93a78f21e76f19e46f310259f2fbab2ccba3342c..9f43ba868d52f2c703061fd577ba95cca15cb82f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,60 +1,85 @@ -include (GenerateExportHeader) -add_library(aec ${LIB_TYPE} ${libaec_SRCS}) -set_target_properties(aec PROPERTIES VERSION 0.0.10 SOVERSION 0) -generate_export_header(aec - BASE_NAME libaec - EXPORT_MACRO_NAME libaec_EXPORT - EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/libaec_Export.h - STATIC_DEFINE libaec_BUILT_AS_STATIC -) - -add_library(sz ${LIB_TYPE} sz_compat.c) -set_target_properties(sz PROPERTIES VERSION 2.0.1 SOVERSION 2) - -target_link_libraries(sz aec) -if(WIN32 AND BUILD_SHARED_LIBS) - set_target_properties (aec PROPERTIES DEFINE_SYMBOL "BUILDING_LIBAEC") - set_target_properties (sz PROPERTIES DEFINE_SYMBOL "BUILDING_LIBAEC") - set_target_properties(sz PROPERTIES OUTPUT_NAME "szip") -endif(WIN32 AND BUILD_SHARED_LIBS) +# Main library aec +add_library(aec + encode.c + encode_accessors.c + decode.c) +add_library(libaec::aec ALIAS aec) +target_include_directories(aec + PUBLIC + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>" + "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>" + "$<INSTALL_INTERFACE:include>") + +set_target_properties(aec + PROPERTIES + VERSION 0.0.10 + SOVERSION 0 + PUBLIC_HEADER ../include/libaec.h) + +# Wrapper for compatibility with szip +add_library(sz sz_compat.c) +add_library(libaec::sz ALIAS sz) + +set_target_properties(sz + PROPERTIES + VERSION 2.0.1 + SOVERSION 2 + OUTPUT_NAME $<IF:$<BOOL:${WIN32}>,szip,sz> + PUBLIC_HEADER ../include/szlib.h) +target_link_libraries(sz PUBLIC aec) + +# Simple client for testing and benchmarking. +# Can also be used stand-alone add_executable(aec_client aec.c) -set_target_properties(aec_client PROPERTIES OUTPUT_NAME "aec") -target_link_libraries(aec_client aec) +set_target_properties(aec_client PROPERTIES OUTPUT_NAME aec) +target_link_libraries(aec_client PUBLIC aec) +include(GNUInstallDirs) if(UNIX) + # Handle visibility of symbols. Compatible with gnulib's gl_VISIBILITY + include(CheckCCompilerFlag) + check_c_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY) + set_target_properties(aec sz + PROPERTIES + COMPILE_DEFINITIONS + "HAVE_VISIBILITY=$<BOOL:${COMPILER_HAS_HIDDEN_VISIBILITY}>;BUILDING_LIBAEC") + + # The shell scripts for benchmarking are supported on unix only add_executable(utime EXCLUDE_FROM_ALL utime.c) + target_include_directories(utime PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/..") add_custom_target(bench - COMMAND ${CMAKE_SOURCE_DIR}/src/benc.sh ${CMAKE_SOURCE_DIR}/data/typical.rz - COMMAND ${CMAKE_SOURCE_DIR}/src/bdec.sh + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/benc.sh + ${CMAKE_CURRENT_SOURCE_DIR}/../data/typical.rz + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bdec.sh DEPENDS aec_client utime) -endif(UNIX) -include(GNUInstallDirs) -if(WIN32) - install(TARGETS aec sz - RUNTIME - DESTINATION bin - ARCHIVE - DESTINATION lib - COMPONENT libraries) -else(WIN32) - install(TARGETS aec sz - LIBRARY - DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE - DESTINATION ${CMAKE_INSTALL_LIBDIR} - COMPONENT libraries) - install(FILES aec.1 - DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 COMPONENT doc) -endif(WIN32) - -install(FILES libaec.h szlib.h ${PROJECT_BINARY_DIR}/libaec_Export.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT headers) -install(TARGETS aec_client - RUNTIME - DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT applications) - -set(CPACK_COMPONENTS_ALL applications libraries headers doc) + # Install manpage + install( + FILES aec.1 + DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 + COMPONENT doc) +endif() + +install(TARGETS aec sz aec_client + EXPORT LibaecTargets) + +install(EXPORT LibaecTargets + FILE LibaecTargets.cmake + NAMESPACE libaec:: + DESTINATION lib/cmake) + +include(CMakePackageConfigHelpers) +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/../Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/LibaecConfig.cmake" + INSTALL_DESTINATION lib/cmake) + +# generate the version file for the config file +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/LibaecConfigVersion.cmake" + COMPATIBILITY AnyNewerVersion) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/LibaecConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/LibaecConfigVersion.cmake" + DESTINATION lib/cmake) diff --git a/src/Makefile.am b/src/Makefile.am index 2f0cb9bd6da3e10178b64a2793c38f195012807d..ea195ded9f09a734d0948dee3892aa4897acc34f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ AM_CFLAGS = $(CFLAG_VISIBILITY) -AM_CPPFLAGS = -DBUILDING_LIBAEC +AM_CPPFLAGS = -I$(top_srcdir)/include -DBUILDING_LIBAEC lib_LTLIBRARIES = libaec.la libsz.la libaec_la_SOURCES = encode.c encode_accessors.c decode.c \ encode.h encode_accessors.h decode.h @@ -9,7 +9,7 @@ libsz_la_SOURCES = sz_compat.c libsz_la_LIBADD = libaec.la libsz_la_LDFLAGS = -version-info 2:1:0 -no-undefined -include_HEADERS = libaec.h szlib.h +include_HEADERS = $(top_srcdir)/include/libaec.h $(top_srcdir)/include/szlib.h bin_PROGRAMS = aec noinst_PROGRAMS = utime diff --git a/src/aec.1 b/src/aec.1 index fa7dc1f376f1a6530feb0995cda35bb2f568921b..e4c489dff596c7133219df12b2c2c8984ddbaf98 100644 --- a/src/aec.1 +++ b/src/aec.1 @@ -18,8 +18,8 @@ aec \- compress or expand files .IR outfile .SH DESCRIPTION .IR Aec -performs lossless compression and decompression with Golomb-Rice coding -as defined in the Space Data System Standard documents 121.0-B-2. +performs lossless compression and decompression with Golomb-Rice coding +as defined in the Space Data System recommended standard 121.0-B-3. .SH OPTIONS .TP \fB \-3\fR diff --git a/src/decode.c b/src/decode.c index 39d568a533c5e4f365b7329480b1e063a21fd058..ef89e36f9a51e2f8da31ab308a8d351cb1cfd27a 100644 --- a/src/decode.c +++ b/src/decode.c @@ -32,7 +32,7 @@ * @section DESCRIPTION * * Adaptive Entropy Decoder - * Based on CCSDS documents 121.0-B-2 and 120.0-G-3 + * Based on the CCSDS recommended standard 121.0-B-3 * */ diff --git a/src/decode.h b/src/decode.h index 49179ffe92916966c9dd2a9bb10653e6bba932b3..0aa40d7007512c80db6f34b1bcae409abf6ea045 100644 --- a/src/decode.h +++ b/src/decode.h @@ -32,7 +32,7 @@ * @section DESCRIPTION * * Adaptive Entropy Decoder - * Based on CCSDS documents 121.0-B-2 and 120.0-G-3 + * Based on the CCSDS recommended standard 121.0-B-3 * */ diff --git a/src/encode.c b/src/encode.c index 1fec8c07aa9cb3f52101cefe3176bb6eaca60721..bd83a146d97219a25645dc02a0bb2bc1aea40ce6 100644 --- a/src/encode.c +++ b/src/encode.c @@ -32,7 +32,7 @@ * @section DESCRIPTION * * Adaptive Entropy Encoder - * Based on CCSDS documents 121.0-B-2 and 120.0-G-3 + * Based on the CCSDS recommended standard 121.0-B-3 * */ @@ -315,7 +315,7 @@ static uint32_t assess_splitting_option(struct aec_stream *strm) In Rice coding each sample in a block of samples is split at the same position into k LSB and bits_per_sample - k MSB. The LSB part is left binary and the MSB part is coded as a - fundamental sequence a.k.a. unary (see CCSDS 121.0-B-2). The + fundamental sequence a.k.a. unary (see CCSDS 121.0-B-3). The function of the length of the Coded Data Set (CDS) depending on k has exactly one minimum (see A. Kiely, IPN Progress Report 42-159). diff --git a/src/encode.h b/src/encode.h index 141376c790f564669c43f54aaf35f38b67e2ee14..d8dd18cd508f484e95e368781478f701ba07a1dc 100644 --- a/src/encode.h +++ b/src/encode.h @@ -32,7 +32,7 @@ * @section DESCRIPTION * * Adaptive Entropy Encoder - * Based on CCSDS documents 121.0-B-2 and 120.0-G-3 + * Based on the CCSDS recommended standard 121.0-B-3 * */ diff --git a/src/libaec.h b/src/libaec.h deleted file mode 100644 index 43a5d6f1f6f32b42ebfe693730f3f96eada3a1dd..0000000000000000000000000000000000000000 --- a/src/libaec.h +++ /dev/null @@ -1,159 +0,0 @@ -/** - * @file libaec.h - * - * @section LICENSE - * Copyright 2021 Mathis Rosenhauer, Moritz Hanke, Joerg Behrens, Luis Kornblueh - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @section DESCRIPTION - * - * Adaptive Entropy Coding library - * - */ - -#ifndef LIBAEC_H -#define LIBAEC_H 1 - -#include <stddef.h> - -#include "libaec_Export.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -struct internal_state; - -struct aec_stream { - const unsigned char *next_in; - - /* number of bytes available at next_in */ - size_t avail_in; - - /* total number of input bytes read so far */ - size_t total_in; - - unsigned char *next_out; - - /* remaining free space at next_out */ - size_t avail_out; - - /* total number of bytes output so far */ - size_t total_out; - - /* resolution in bits per sample (n = 1, ..., 32) */ - unsigned int bits_per_sample; - - /* block size in samples */ - unsigned int block_size; - - /* Reference sample interval, the number of blocks - * between consecutive reference samples (up to 4096). */ - unsigned int rsi; - - unsigned int flags; - - struct internal_state *state; -}; - -/*********************************/ -/* Sample data description flags */ -/*********************************/ - -/* Samples are signed. Telling libaec this results in a slightly - * better compression ratio. Default is unsigned. */ -#define AEC_DATA_SIGNED 1 - -/* 24 bit samples are coded in 3 bytes */ -#define AEC_DATA_3BYTE 2 - -/* Samples are stored with their most significant bit first. This has - * nothing to do with the endianness of the host. Default is LSB. */ -#define AEC_DATA_MSB 4 - -/* Set if preprocessor should be used */ -#define AEC_DATA_PREPROCESS 8 - -/* Use restricted set of code options */ -#define AEC_RESTRICTED 16 - -/* Pad RSI to byte boundary. Only used for decoding some CCSDS sample - * data. Do not use this to produce new data as it violates the - * standard. */ -#define AEC_PAD_RSI 32 - -/* Do not enforce standard regarding legal block sizes. */ -#define AEC_NOT_ENFORCE 64 - -/*************************************/ -/* Return codes of library functions */ -/*************************************/ -#define AEC_OK 0 -#define AEC_CONF_ERROR (-1) -#define AEC_STREAM_ERROR (-2) -#define AEC_DATA_ERROR (-3) -#define AEC_MEM_ERROR (-4) - -/************************/ -/* Options for flushing */ -/************************/ - -/* Do not enforce output flushing. More input may be provided with - * later calls. So far only relevant for encoding. */ -#define AEC_NO_FLUSH 0 - -/* Flush output and end encoding. The last call to aec_encode() must - * set AEC_FLUSH to drain all output. - * - * It is not possible to continue encoding of the same stream after it - * has been flushed. For one, the last block may be padded zeros after - * preprocessing. Secondly, the last encoded byte may be padded with - * fill bits. */ -#define AEC_FLUSH 1 - -/*********************************************/ -/* Streaming encoding and decoding functions */ -/*********************************************/ -libaec_EXPORT int aec_encode_init(struct aec_stream *strm); -libaec_EXPORT int aec_encode(struct aec_stream *strm, int flush); -libaec_EXPORT int aec_encode_end(struct aec_stream *strm); - -libaec_EXPORT int aec_decode_init(struct aec_stream *strm); -libaec_EXPORT int aec_decode(struct aec_stream *strm, int flush); -libaec_EXPORT int aec_decode_end(struct aec_stream *strm); - -/***************************************************************/ -/* Utility functions for encoding or decoding a memory buffer. */ -/***************************************************************/ -libaec_EXPORT int aec_buffer_encode(struct aec_stream *strm); -libaec_EXPORT int aec_buffer_decode(struct aec_stream *strm); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBAEC_H */ diff --git a/src/szlib.h b/src/szlib.h deleted file mode 100644 index 577847cba9c472dc474dc9f07b125dbaecfaa0f9..0000000000000000000000000000000000000000 --- a/src/szlib.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file szlib.h - * - * @section LICENSE - * Copyright 2021 Mathis Rosenhauer, Moritz Hanke, Joerg Behrens, Luis Kornblueh - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @section DESCRIPTION - * - * Adaptive Entropy Coding library - * - */ - -#ifndef SZLIB_H -#define SZLIB_H 1 - -#include <libaec.h> - -#define SZ_ALLOW_K13_OPTION_MASK 1 -#define SZ_CHIP_OPTION_MASK 2 -#define SZ_EC_OPTION_MASK 4 -#define SZ_LSB_OPTION_MASK 8 -#define SZ_MSB_OPTION_MASK 16 -#define SZ_NN_OPTION_MASK 32 -#define SZ_RAW_OPTION_MASK 128 - -#define SZ_OK AEC_OK -#define SZ_OUTBUFF_FULL 2 - -#define SZ_NO_ENCODER_ERROR -1 -#define SZ_PARAM_ERROR AEC_CONF_ERROR -#define SZ_MEM_ERROR AEC_MEM_ERROR - -#define SZ_MAX_PIXELS_PER_BLOCK 32 -#define SZ_MAX_BLOCKS_PER_SCANLINE 128 -#define SZ_MAX_PIXELS_PER_SCANLINE \ - (SZ_MAX_BLOCKS_PER_SCANLINE) * (SZ_MAX_PIXELS_PER_BLOCK) - -typedef struct SZ_com_t_s -{ - int options_mask; - int bits_per_pixel; - int pixels_per_block; - int pixels_per_scanline; -} SZ_com_t; - -libaec_EXPORT int SZ_BufftoBuffCompress( - void *dest, size_t *destLen, - const void *source, size_t sourceLen, - SZ_com_t *param); -libaec_EXPORT int SZ_BufftoBuffDecompress( - void *dest, size_t *destLen, - const void *source, size_t sourceLen, - SZ_com_t *param); - -libaec_EXPORT int SZ_encoder_enabled(void); - -#endif /* SZLIB_H */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f65c453d56a091821a0d3c77de2cb460b5e4709b..52d36ff0782e92d7076608dd3329ea0c7e19eec9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,26 +1,27 @@ add_library(check_aec STATIC check_aec.c) - +target_link_libraries(check_aec PUBLIC aec) add_executable(check_code_options check_code_options.c) -target_link_libraries(check_code_options check_aec aec) +target_link_libraries(check_code_options PUBLIC check_aec aec) add_test(NAME check_code_options COMMAND check_code_options) add_executable(check_buffer_sizes check_buffer_sizes.c) -target_link_libraries(check_buffer_sizes check_aec aec) +target_link_libraries(check_buffer_sizes PUBLIC check_aec aec) add_test(NAME check_buffer_sizes COMMAND check_buffer_sizes) add_executable(check_long_fs check_long_fs.c) -target_link_libraries(check_long_fs check_aec aec) +target_link_libraries(check_long_fs PUBLIC check_aec aec) add_test(NAME check_long_fs COMMAND check_long_fs) add_executable(check_szcomp check_szcomp.c) -target_link_libraries(check_szcomp check_aec sz) +target_link_libraries(check_szcomp PUBLIC check_aec sz) add_test(NAME check_szcomp COMMAND check_szcomp ${PROJECT_SOURCE_DIR}/data/121B2TestData/ExtendedParameters/sar32bit.dat) if(UNIX) add_test( NAME sampledata.sh - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/sampledata.sh ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/sampledata.sh + ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - set(SAMPLE_DATA_DIR "${PROJECT_SOURCE_DIR}/data") + set(SAMPLE_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../data") set(SAMPLE_DATA_NAME "121B2TestData") set(SAMPLE_DATA_URL "https://cwe.ccsds.org/sls/docs/SLS-DC/BB121B2TestData/121B2TestData.zip") add_custom_target( diff --git a/tests/Makefile.am b/tests/Makefile.am index eb624144bb2a1b769f970f96e8a2df672ca11e20..ef122eabcc34b38fc369a70e4f5601ddb4ef7871 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS = color-tests -AM_CPPFLAGS = -I$(top_srcdir)/src +AM_CPPFLAGS = -I$(top_srcdir)/include TESTS = check_code_options check_buffer_sizes check_long_fs \ szcomp.sh sampledata.sh TEST_EXTENSIONS = .sh @@ -10,15 +10,15 @@ check_PROGRAMS = check_code_options check_buffer_sizes check_long_fs \ check_szcomp check_code_options_SOURCES = check_code_options.c check_aec.h \ -$(top_srcdir)/src/libaec.h +$(top_srcdir)/include/libaec.h check_buffer_sizes_SOURCES = check_buffer_sizes.c check_aec.h \ -$(top_srcdir)/src/libaec.h +$(top_srcdir)/include/libaec.h check_long_fs_SOURCES = check_long_fs.c check_aec.h \ -$(top_srcdir)/src/libaec.h +$(top_srcdir)/include/libaec.h -check_szcomp_SOURCES = check_szcomp.c $(top_srcdir)/src/szlib.h +check_szcomp_SOURCES = check_szcomp.c $(top_srcdir)/include/szlib.h LDADD = libcheck_aec.la $(top_builddir)/src/libaec.la check_szcomp_LDADD = $(top_builddir)/src/libsz.la