From 6f04796d499e7faf122c62fb357eceb9bc5499c7 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Mon, 20 May 2024 10:21:53 +0200 Subject: [PATCH] Applied updates and worked on format support --- configure.ac | 2 +- libewf/libewf_chunk_data.c | 159 ++-- libewf/libewf_chunk_data.h | 4 + libewf/libewf_chunk_descriptor.c | 30 +- libewf/libewf_chunk_descriptor.h | 4 + libewf/libewf_chunk_group.c | 15 - libewf/libewf_section_descriptor.c | 6 +- libewf/libewf_volume_section.c | 2 +- libewf/libewf_write_io_handle.c | 22 + m4/common.m4 | 212 ++++-- m4/libbfio.m4 | 319 ++------ m4/libcaes.m4 | 99 +-- m4/libcdata.m4 | 558 +++----------- m4/libcdatetime.m4 | 225 +----- m4/libcerror.m4 | 85 +-- m4/libcfile.m4 | 180 +---- m4/libclocale.m4 | 79 +- m4/libcnotify.m4 | 81 +-- m4/libcpath.m4 | 120 +-- m4/libcsplit.m4 | 114 +-- m4/libcthreads.m4 | 257 ++----- m4/libfcache.m4 | 145 +--- m4/libfdata.m4 | 530 +++----------- m4/libfdatetime.m4 | 513 +++---------- m4/libfguid.m4 | 95 +-- m4/libfvalue.m4 | 663 +++-------------- m4/libhmac.m4 | 161 +--- m4/libodraw.m4 | 171 +---- m4/libsmdev.m4 | 196 +---- m4/libsmraw.m4 | 133 +--- m4/libuna.m4 | 1087 +++++----------------------- m4/pthread.m4 | 144 +--- tests/Makefile.am | 1 + tests/ewf_test_chunk_data.c | 239 +++++- 34 files changed, 1593 insertions(+), 5058 deletions(-) diff --git a/configure.ac b/configure.ac index b8b5c8cd..0971878e 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libewf], - [20240506], + [20240520], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/libewf/libewf_chunk_data.c b/libewf/libewf_chunk_data.c index 100f98c7..2a204836 100644 --- a/libewf/libewf_chunk_data.c +++ b/libewf/libewf_chunk_data.c @@ -616,6 +616,108 @@ int libewf_chunk_data_pack_with_64_bit_pattern_fill( return( -1 ); } +/* Unpacks the chunk data using 64-bit pattern fill + * Returns 1 if successful or -1 on error + */ +int libewf_chunk_data_unpack_with_64_bit_pattern_fill( + libewf_chunk_data_t *chunk_data, + libcerror_error_t **error ) +{ + static char *function = "libewf_chunk_data_unpack_with_64_bit_pattern_fill"; + size_t remaining_chunk_size = 0; + + if( chunk_data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid chunk data.", + function ); + + return( -1 ); + } + if( chunk_data->data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid chunk data - missing data.", + function ); + + return( -1 ); + } + if( chunk_data->compressed_data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid chunk data - missing compressed data.", + function ); + + return( -1 ); + } + if( chunk_data->compressed_data_size < (size_t) 8 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid chunk data - compressed data size value out of bounds.", + function ); + + return( -1 ); + } + remaining_chunk_size = (size_t) chunk_data->chunk_size; + + switch( remaining_chunk_size % 8 ) + { + case 7: + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 6 ]; + + LIBEWF_ATTRIBUTE_FALLTHROUGH; + case 6: + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 5 ]; + + LIBEWF_ATTRIBUTE_FALLTHROUGH; + case 5: + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 4 ]; + + LIBEWF_ATTRIBUTE_FALLTHROUGH; + case 4: + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 3 ]; + + LIBEWF_ATTRIBUTE_FALLTHROUGH; + case 3: + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 2 ]; + + LIBEWF_ATTRIBUTE_FALLTHROUGH; + case 2: + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 1 ]; + + LIBEWF_ATTRIBUTE_FALLTHROUGH; + case 1: + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 0 ]; + } + while( remaining_chunk_size > 0 ) + { +/* TODO make this memory aligned ? */ + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 7 ]; + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 6 ]; + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 5 ]; + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 4 ]; + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 3 ]; + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 2 ]; + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 1 ]; + ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 0 ]; + } + chunk_data->data_size = chunk_data->chunk_size; + + return( 1 ); +} + /* Packs the chunk data using empty block compression * Returns 1 if successful or -1 on error */ @@ -1157,7 +1259,6 @@ int libewf_chunk_data_unpack( libcerror_error_t **error ) { static char *function = "libewf_chunk_data_unpack"; - size_t remaining_chunk_size = 0; uint32_t calculated_checksum = 0; if( chunk_data == NULL ) @@ -1269,61 +1370,19 @@ int libewf_chunk_data_unpack( if( ( chunk_data->range_flags & LIBEWF_RANGE_FLAG_USES_PATTERN_FILL ) != 0 ) { -/* TODO move into libewf_chunk_data_unpack_with_64_bit_pattern_fill */ - if( chunk_data->compressed_data_size < (size_t) 8 ) + if( libewf_chunk_data_unpack_with_64_bit_pattern_fill( + chunk_data, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid chunk data - compressed data size value out of bounds.", + LIBCERROR_ERROR_DOMAIN_COMPRESSION, + LIBCERROR_COMPRESSION_ERROR_COMPRESS_FAILED, + "%s: unable to decompress chunk data using 64-bit pattern fill.", function ); goto on_error; } - remaining_chunk_size = (size_t) chunk_data->chunk_size; - - switch( remaining_chunk_size % 8 ) - { - case 7: - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 7 ]; - - LIBEWF_ATTRIBUTE_FALLTHROUGH; - case 6: - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 6 ]; - - LIBEWF_ATTRIBUTE_FALLTHROUGH; - case 5: - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 5 ]; - - LIBEWF_ATTRIBUTE_FALLTHROUGH; - case 4: - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 4 ]; - - LIBEWF_ATTRIBUTE_FALLTHROUGH; - case 3: - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 3 ]; - - LIBEWF_ATTRIBUTE_FALLTHROUGH; - case 2: - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 2 ]; - - LIBEWF_ATTRIBUTE_FALLTHROUGH; - case 1: - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 1 ]; - } - while( remaining_chunk_size > 0 ) - { -/* TODO make this memory aligned ? */ - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 7 ]; - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 6 ]; - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 5 ]; - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 4 ]; - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 3 ]; - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 2 ]; - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 1 ]; - ( chunk_data->data )[ --remaining_chunk_size ] = ( chunk_data->compressed_data )[ 0 ]; - } } else { @@ -1468,7 +1527,7 @@ int libewf_chunk_data_unpack( } /* Checks if a buffer containing the chunk data is filled with same value bytes (empty-block) - * Returns 1 if a pattern was found, 0 if not or -1 on error + * Returns 1 if an empty block was found, 0 if not or -1 on error */ int libewf_chunk_data_check_for_empty_block( const uint8_t *data, diff --git a/libewf/libewf_chunk_data.h b/libewf/libewf_chunk_data.h index 7cdca8e4..daae203e 100644 --- a/libewf/libewf_chunk_data.h +++ b/libewf/libewf_chunk_data.h @@ -131,6 +131,10 @@ int libewf_chunk_data_pack_with_64_bit_pattern_fill( libewf_chunk_data_t *chunk_data, libcerror_error_t **error ); +int libewf_chunk_data_unpack_with_64_bit_pattern_fill( + libewf_chunk_data_t *chunk_data, + libcerror_error_t **error ); + int libewf_chunk_data_pack_with_empty_block_compression( libewf_chunk_data_t *chunk_data, const uint8_t *compressed_zero_byte_empty_block, diff --git a/libewf/libewf_chunk_descriptor.c b/libewf/libewf_chunk_descriptor.c index b6977b6f..eb6d62c2 100644 --- a/libewf/libewf_chunk_descriptor.c +++ b/libewf/libewf_chunk_descriptor.c @@ -294,9 +294,9 @@ int libewf_chunk_descriptor_write_data( return( -1 ); } - chunk_data_offset = chunk_descriptor->data_offset; - chunk_data_size = chunk_descriptor->data_size; - range_flags = chunk_descriptor->range_flags; + chunk_data_offset = chunk_descriptor->data_offset; + chunk_data_size = chunk_descriptor->data_size; + range_flags = chunk_descriptor->range_flags; if( format_version == 1 ) { @@ -360,12 +360,28 @@ int libewf_chunk_descriptor_write_data( } if( ( range_flags & LIBEWF_RANGE_FLAG_USES_PATTERN_FILL ) != 0 ) { + if( memory_copy( + ( (ewf_table_entry_v2_t *) data )->chunk_data_offset, + chunk_descriptor->pattern_fill, + 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy pattern fill.", + function ); + + return( -1 ); + } chunk_data_flags |= LIBEWF_CHUNK_DATA_FLAG_USES_PATTERN_FILL; } - byte_stream_copy_from_uint64_little_endian( - ( (ewf_table_entry_v2_t *) data )->chunk_data_offset, - chunk_data_offset ); - + else + { + byte_stream_copy_from_uint64_little_endian( + ( (ewf_table_entry_v2_t *) data )->chunk_data_offset, + chunk_data_offset ); + } byte_stream_copy_from_uint32_little_endian( ( (ewf_table_entry_v2_t *) data )->chunk_data_size, (uint32_t) chunk_data_size ); diff --git a/libewf/libewf_chunk_descriptor.h b/libewf/libewf_chunk_descriptor.h index 468fc666..7afe7f5b 100644 --- a/libewf/libewf_chunk_descriptor.h +++ b/libewf/libewf_chunk_descriptor.h @@ -43,6 +43,10 @@ struct libewf_chunk_descriptor */ size64_t data_size; + /* The (chunk data) pattern fill + */ + uint8_t pattern_fill[ 8 ]; + /* The (chunk data) range flags */ uint32_t range_flags; diff --git a/libewf/libewf_chunk_group.c b/libewf/libewf_chunk_group.c index 12068f06..4fe52c88 100644 --- a/libewf/libewf_chunk_group.c +++ b/libewf/libewf_chunk_group.c @@ -802,13 +802,6 @@ int libewf_chunk_group_fill_v1( return( -1 ); } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif return( 1 ); } @@ -1022,14 +1015,6 @@ int libewf_chunk_group_fill_v2( return( -1 ); } chunk_index++; - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif } return( 1 ); } diff --git a/libewf/libewf_section_descriptor.c b/libewf/libewf_section_descriptor.c index 652c72e7..508e3bce 100644 --- a/libewf/libewf_section_descriptor.c +++ b/libewf/libewf_section_descriptor.c @@ -1278,7 +1278,7 @@ int libewf_section_descriptor_write_data( else if( format_version == 2 ) { libcnotify_printf( - "%s: type\t\t\t\t\t: 0x%08" PRIx32 " (", + "%s: type\t\t\t\t: 0x%08" PRIx32 " (", function, section_descriptor->type ); libewf_debug_print_section_type( @@ -1287,7 +1287,7 @@ int libewf_section_descriptor_write_data( ")\n" ); libcnotify_printf( - "%s: data flags\t\t\t\t: 0x%08" PRIx32 "\n", + "%s: data flags\t\t\t: 0x%08" PRIx32 "\n", function, section_descriptor->data_flags ); libewf_debug_print_section_data_flags( @@ -1311,7 +1311,7 @@ int libewf_section_descriptor_write_data( data_size ); libcnotify_printf( - "%s: padding size\t\t\t\t: %" PRIu32 "\n", + "%s: padding size\t\t\t: %" PRIu32 "\n", function, section_descriptor->padding_size ); diff --git a/libewf/libewf_volume_section.c b/libewf/libewf_volume_section.c index 9ffbda8d..7ac4c9da 100644 --- a/libewf/libewf_volume_section.c +++ b/libewf/libewf_volume_section.c @@ -104,7 +104,7 @@ int libewf_volume_section_e01_read_data( if( libcnotify_verbose != 0 ) { libcnotify_printf( - "%s: volume section data:\n", + "%s: volume section data:\n", function ); libcnotify_print_data( data, diff --git a/libewf/libewf_write_io_handle.c b/libewf/libewf_write_io_handle.c index c2eedd73..8307b4c7 100644 --- a/libewf/libewf_write_io_handle.c +++ b/libewf/libewf_write_io_handle.c @@ -2829,6 +2829,11 @@ int libewf_write_io_handle_generate_table_entries_data( libcnotify_printf( "\tHas checksum\n" ); } + if( ( chunk_descriptor->range_flags & LIBEWF_RANGE_FLAG_USES_PATTERN_FILL ) != 0 ) + { + libcnotify_printf( + "\tUses pattern fill\n" ); + } libcnotify_printf( "\n" ); } @@ -3567,6 +3572,23 @@ ssize_t libewf_write_io_handle_write_new_chunk_create_chunk( chunk_descriptor->data_size = (size64_t) write_count - chunk_data->padding_size; chunk_descriptor->range_flags = chunk_data->range_flags; + if( ( chunk_data->range_flags & LIBEWF_RANGE_FLAG_USES_PATTERN_FILL ) != 0 ) + { + if( memory_copy( + chunk_descriptor->pattern_fill, + chunk_data->data, + 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy pattern fill.", + function ); + + goto on_error; + } + } if( libcdata_array_append_entry( write_io_handle->chunks_section, &entry_index, diff --git a/m4/common.m4 b/m4/common.m4 index 71c18b82..c2ea816e 100644 --- a/m4/common.m4 +++ b/m4/common.m4 @@ -1,11 +1,10 @@ dnl Checks for common headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240513 dnl Function to test if a certain feature was disabled AC_DEFUN([AX_COMMON_ARG_DISABLE], -[ - AC_ARG_ENABLE( + [AC_ARG_ENABLE( [$1], [AS_HELP_STRING( [--disable-$1], @@ -17,12 +16,11 @@ AC_DEFUN([AX_COMMON_ARG_DISABLE], [whether to disable $3], [ac_cv_enable_$2], [ac_cv_enable_$2="yes"])dnl -]) + ]) dnl Function to test if a certain feature was enabled AC_DEFUN([AX_COMMON_ARG_ENABLE], -[ - AC_ARG_ENABLE( + [AC_ARG_ENABLE( [$1], [AS_HELP_STRING( [--enable-$1], @@ -34,12 +32,11 @@ AC_DEFUN([AX_COMMON_ARG_ENABLE], [whether to enable $3], [ac_cv_enable_$2], [ac_cv_enable_$2=$4])dnl -]) + ]) dnl Function to test if the location of a certain feature was provided AC_DEFUN([AX_COMMON_ARG_WITH], -[ - AC_ARG_WITH( + [AC_ARG_WITH( [$1], [AS_HELP_STRING( [--with-$1[[=$5]]], @@ -51,21 +48,19 @@ AC_DEFUN([AX_COMMON_ARG_WITH], [whether to use $3], [ac_cv_with_$2], [ac_cv_with_$2=$4])dnl -]) + ]) -dnl Function to detect whether shared libary support should be disabled +dnl Function to detect whether shared library support should be disabled AC_DEFUN([AX_COMMON_CHECK_DISABLE_SHARED_LIBS], -[ - AX_COMMON_ARG_DISABLE( + [AX_COMMON_ARG_DISABLE( [shared-libs], [shared_libs], [disable shared library support]) -]) + ]) dnl Function to detect whether debug output should be enabled AC_DEFUN([AX_COMMON_CHECK_ENABLE_DEBUG_OUTPUT], -[ - AX_COMMON_ARG_ENABLE( + [AX_COMMON_ARG_ENABLE( [debug-output], [debug_output], [enable debug output], @@ -79,12 +74,11 @@ AC_DEFUN([AX_COMMON_CHECK_ENABLE_DEBUG_OUTPUT], [Define to 1 if debug output should be used.]) ac_cv_enable_debug_output=yes]) -]) + ]) dnl Function to detect whether static executables support should be enabled AC_DEFUN([AX_COMMON_CHECK_ENABLE_STATIC_EXECUTABLES], -[ - AX_COMMON_ARG_ENABLE( + [AX_COMMON_ARG_ENABLE( [static-executables], [static_executables], [build static executables (binaries)], @@ -99,12 +93,11 @@ AC_DEFUN([AX_COMMON_CHECK_ENABLE_STATIC_EXECUTABLES], ac_cv_enable_static_executables=yes enable_shared=no]) -]) + ]) dnl Function to detect whether verbose output should be enabled AC_DEFUN([AX_COMMON_CHECK_ENABLE_VERBOSE_OUTPUT], -[ - AX_COMMON_ARG_ENABLE( + [AX_COMMON_ARG_ENABLE( [verbose-output], [verbose_output], [enable verbose output], @@ -118,22 +111,20 @@ AC_DEFUN([AX_COMMON_CHECK_ENABLE_VERBOSE_OUTPUT], [Define to 1 if verbose output should be used.]) ac_cv_enable_verbose_output=yes]) -]) + ]) dnl Function to detect whether static executables support should be enabled AC_DEFUN([AX_COMMON_CHECK_ENABLE_WIDE_CHARACTER_TYPE], -[ - AX_COMMON_ARG_ENABLE( + [AX_COMMON_ARG_ENABLE( [wide-character-type], [wide_character_type], [enable wide character type support], [no]) -]) + ]) dnl Function to detect whether WINAPI support should be enabled AC_DEFUN([AX_COMMON_CHECK_ENABLE_WINAPI], -[ - AX_COMMON_ARG_ENABLE( + [AX_COMMON_ARG_ENABLE( [winapi], [winapi], [enable WINAPI support for cross-compilation], @@ -156,13 +147,12 @@ AC_DEFUN([AX_COMMON_CHECK_ENABLE_WINAPI], [detected MSYS enabling WINAPI support for cross-compilation]) ac_cv_enable_winapi=yes], [*],[ac_cv_enable_winapi=no]) + ]) ]) -]) dnl Function to detect whether printf conversion specifier "%jd" is available AC_DEFUN([AX_COMMON_CHECK_FUNC_PRINTF_JD], -[ - AC_MSG_CHECKING( + [AC_MSG_CHECKING( [whether printf supports the conversion specifier "%jd"]) SAVE_CFLAGS="$CFLAGS" @@ -187,7 +177,7 @@ AC_DEFUN([AX_COMMON_CHECK_FUNC_PRINTF_JD], [[printf( "%jd", (off_t) 10 ); ]] )], [ac_cv_cv_have_printf_jd=yes], [ac_cv_cv_have_printf_jd=no]) - ]) + ]) dnl Third try to see if the program runs correctly AS_IF( @@ -202,7 +192,7 @@ if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ]] )], [ac_cv_cv_have_printf_jd=yes], [ac_cv_cv_have_printf_jd=no], [ac_cv_cv_have_printf_jd=undetermined]) - ]) + ]) AC_LANG_POP(C) CFLAGS="$SAVE_CFLAGS" @@ -217,13 +207,12 @@ if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ]] )], [Define to 1 whether printf supports the conversion specifier "%jd".]) ], [AC_MSG_RESULT( [$ac_cv_cv_have_printf_jd]) + ]) ]) -]) dnl Function to detect whether printf conversion specifier "%zd" is available AC_DEFUN([AX_COMMON_CHECK_FUNC_PRINTF_ZD], -[ - AC_MSG_CHECKING( + [AC_MSG_CHECKING( [whether printf supports the conversion specifier "%zd"]) SAVE_CFLAGS="$CFLAGS" @@ -248,7 +237,7 @@ AC_DEFUN([AX_COMMON_CHECK_FUNC_PRINTF_ZD], [[printf( "%zd", (size_t) 10 ); ]] )], [ac_cv_cv_have_printf_zd=yes], [ac_cv_cv_have_printf_zd=no]) - ]) + ]) dnl Third try to see if the program runs correctly AS_IF( @@ -263,7 +252,7 @@ if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ]] )], [ac_cv_cv_have_printf_zd=yes], [ac_cv_cv_have_printf_zd=no], [ac_cv_cv_have_printf_zd=undetermined]) - ]) + ]) AC_LANG_POP(C) CFLAGS="$SAVE_CFLAGS" @@ -278,13 +267,12 @@ if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ]] )], [Define to 1 whether printf supports the conversion specifier "%zd".]) ], [AC_MSG_RESULT( [$ac_cv_cv_have_printf_zd]) + ]) ]) -]) dnl Function to detect if common dependencies are available AC_DEFUN([AX_COMMON_CHECK_LOCAL], -[ - dnl Headers included in common/common.h + [dnl Headers included in common/common.h AS_IF( [test "x$ac_cv_enable_winapi" = xyes], [AC_CHECK_HEADERS([windows.h]) @@ -294,13 +282,13 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], [AC_MSG_FAILURE( [Missing header: windows.h header is required to compile with winapi support], [1]) + ]) ]) - ]) AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_HEADERS([libintl.h]) - ]) + ]) dnl Headers included in common/types.h AC_CHECK_HEADERS([limits.h]) @@ -319,56 +307,56 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], [AC_MSG_FAILURE( [Missing function: fclose], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_feof" != xyes], [AC_MSG_FAILURE( [Missing function: feof], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_fgets" != xyes], [AC_MSG_FAILURE( [Missing function: fgets], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_fopen" != xyes], [AC_MSG_FAILURE( [Missing function: fopen], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_fread" != xyes], [AC_MSG_FAILURE( [Missing function: fread], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_fseeko" != xyes && test "x$ac_cv_func_fseeko64" != xyes], [AC_MSG_FAILURE( [Missing function: fseeko and fseeko64], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_fwrite" != xyes], [AC_MSG_FAILURE( [Missing function: fwrite], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_vfprintf" != xyes], [AC_MSG_FAILURE( [Missing function: vfprintf], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], @@ -379,8 +367,8 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], [AC_MSG_FAILURE( [Missing function: fgetws], [1]) + ]) ]) - ]) dnl Memory functions used in common/memory.h AC_CHECK_FUNCS([free malloc memcmp memcpy memset realloc]) @@ -390,42 +378,42 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], [AC_MSG_FAILURE( [Missing function: free], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_malloc" != xyes], [AC_MSG_FAILURE( [Missing function: malloc], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_memcmp" != xyes], [AC_MSG_FAILURE( [Missing function: memcmp], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_memcpy" != xyes], [AC_MSG_FAILURE( [Missing function: memcpy], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_memset" != xyes], [AC_MSG_FAILURE( [Missing function: memset], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_realloc" != xyes], [AC_MSG_FAILURE( [Missing function: realloc], [1]) - ]) + ]) dnl Narrow character string functions used in common/narrow_string.h AC_CHECK_FUNCS([memchr memrchr snprintf sscanf strcasecmp strchr strlen strncasecmp strncmp strncpy strnicmp strrchr strstr vsnprintf]) @@ -435,21 +423,21 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], [AC_MSG_FAILURE( [Missing functions: memchr and strchr], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_memcmp" != xyes && test "x$ac_cv_func_strncmp" != xyes], [AC_MSG_FAILURE( [Missing functions: memcmp and strncmp], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_memcpy" != xyes && test "x$ac_cv_func_strncpy" != xyes], [AC_MSG_FAILURE( [Missing functions: memcpy and strncpy], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_memrchr" = xyes], @@ -458,56 +446,56 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], AS_IF( [test "x$ac_cv_decl_memrchr" != xyes], [ac_cv_func_memrchr=no]) - ]) + ]) AS_IF( [test "x$ac_cv_func_memrchr" != xyes && test "x$ac_cv_func_strrchr" != xyes], [AC_MSG_FAILURE( [Missing functions: strrchr and memrchr], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_snprintf" != xyes], [AC_MSG_FAILURE( [Missing function: snprintf], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_sscanf" != xyes], [AC_MSG_FAILURE( [Missing function: sscanf], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_strlen" != xyes], [AC_MSG_FAILURE( [Missing function: strlen], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_strcasecmp" != xyes && test "x$ac_cv_func_strncasecmp" != xyes && test "x$ac_cv_func_strnicmp" != xyes], [AC_MSG_FAILURE( [Missing functions: strncasecmp, strcasecmp and strnicmp], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_strstr" != xyes], [AC_MSG_FAILURE( [Missing function: strstr], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_vsnprintf" != xyes], [AC_MSG_FAILURE( [Missing function: vsnprintf], [1]) - ]) + ]) dnl Wide character string functions used in common/wide_string.h AS_IF( @@ -519,60 +507,128 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], [AC_MSG_FAILURE( [Missing function: swprintf], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_wmemchr" != xyes && test "x$ac_cv_func_wcschr" != xyes], [AC_MSG_FAILURE( [Missing functions: wmemchr and wcschr], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_wmemcmp" != xyes && test "x$ac_cv_func_wcsncmp" != xyes], [AC_MSG_FAILURE( [Missing functions: wmemcmp and wcsncmp], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_wmemcpy" != xyes && test "x$ac_cv_func_wcsncpy" != xyes], [AC_MSG_FAILURE( [Missing functions: wmemcpy and wcsncpy], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_wmemrchr" != xyes && test "x$ac_cv_func_wcsrchr" != xyes], [AC_MSG_FAILURE( [Missing functions: wmemrchr and wcsrchr], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_wcslen" != xyes], [AC_MSG_FAILURE( [Missing function: wcslen], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_wcsncasecmp" != xyes && test "x$ac_cv_func_wcscasecmp" != xyes && test "x$ac_cv_func_wcsnicmp" != xyes && test "x$ac_cv_func_towlower" != xyes], [AC_MSG_FAILURE( [Missing functions: wcsncasecmp, wcscasecmp, wcsnicmp and towlower], [1]) - ]) + ]) AS_IF( [test "x$ac_cv_func_wcsstr" != xyes], [AC_MSG_FAILURE( [Missing function: wcsstr], [1]) + ]) ]) - ]) dnl Check for printf conversion specifier support AX_COMMON_CHECK_FUNC_PRINTF_JD AX_COMMON_CHECK_FUNC_PRINTF_ZD -]) + ]) + +dnl Function to test if a library with a specific definition is available +AC_DEFUN([AX_CHECK_LIB_DEFINITION], + [AC_CACHE_CHECK( + [if `$2' is defined], + [ac_cv_$1_definition_$2], + [AC_LANG_PUSH(C) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <$1.h>]], + [[int test = $2; + +return( 0 ); ]] + )], + [ac_cv_$1_definition_$2=yes], + [ac_cv_$1_definition_$2=no]) + AC_LANG_POP(C)]) + + AS_IF( + [test "x$ac_cv_$1_definition_$2" != xyes], + [ac_cv_$1=no]) + ]) + +dnl Function to test if a library with specific definitions is available +AC_DEFUN([AX_CHECK_LIB_DEFINITIONS], + [m4_foreach( + [definition], + [$2], + [AX_CHECK_LIB_DEFINITION( + [$1], + [definition]) + ]) + ]) + +dnl Function to test if a library with specific functions is available +AC_DEFUN([AX_CHECK_LIB_FUNCTIONS], + [m4_foreach( + [function], + [$3], + [AC_CHECK_LIB( + [$2], + [function], + [ac_cv_$1_dummy=yes], + [ac_cv_$1=no]) + ]) + ]) + +dnl Function to check if an user specified library directory exists +AC_DEFUN([AX_CHECK_LIB_DIRECTORY_EXISTS], + [AS_IF( + [test -d "$ac_cv_with_$1"], + [CFLAGS="$CFLAGS -I${ac_cv_with_$1}/include" + LDFLAGS="$LDFLAGS -L${ac_cv_with_$1}/lib"], + [AC_MSG_FAILURE( + [no such directory: $ac_cv_with_$1], + [1]) + ]) + ]) + +dnl Function to warn if no supported library was found in an user specified directory +AC_DEFUN([AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE], + [AS_IF( + [test "x$ac_cv_$1" != xyes && test "x$ac_cv_with_$1" != x && test "x$ac_cv_with_$1" != xauto-detect && test "x$ac_cv_with_$1" != xyes], + [AC_MSG_FAILURE( + [unable to find supported $1 in directory: $ac_cv_with_$1], + [1]) + ]) + ]) diff --git a/m4/libbfio.m4 b/m4/libbfio.m4 index 112bac64..caebad16 100644 --- a/m4/libbfio.m4 +++ b/m4/libbfio.m4 @@ -1,6 +1,6 @@ dnl Checks for libbfio required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240518 dnl Function to detect if libbfio is available dnl ac_libbfio_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBBFIO_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_with_libbfio" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libbfio"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libbfio}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libbfio}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libbfio], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libbfio])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -67,268 +59,69 @@ AC_DEFUN([AX_LIBBFIO_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libbfio_h" = xno], [ac_cv_libbfio=no], - [dnl Check for the individual functions - ac_cv_libbfio=yes - - AC_CHECK_LIB( - bfio, - libbfio_get_version, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - - dnl Handle functions - AC_CHECK_LIB( - bfio, - libbfio_handle_free, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_open, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_close, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_exists, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_read_buffer, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_read_buffer_at_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_write_buffer, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_write_buffer_at_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_seek_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - - AC_CHECK_LIB( - bfio, - libbfio_handle_is_open, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_get_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_get_size, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_set_track_offsets_read, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_get_number_of_offsets_read, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_handle_get_offset_read, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - - dnl File functions - AC_CHECK_LIB( - bfio, - libbfio_file_initialize, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_file_get_name_size, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_file_get_name, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_file_set_name, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - - AS_IF( - [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - bfio, - libbfio_file_get_name_size_wide, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_file_get_name_wide, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_file_set_name_wide, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - ]) + [ac_cv_libbfio=yes - dnl Pool functions - AC_CHECK_LIB( - bfio, - libbfio_pool_initialize, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_free, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_clone, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - - AC_CHECK_LIB( - bfio, - libbfio_pool_get_number_of_handles, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_get_handle, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_set_handle, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_append_handle, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_remove_handle, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_get_maximum_number_of_open_handles, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_set_maximum_number_of_open_handles, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - - AC_CHECK_LIB( - bfio, - libbfio_pool_open, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_reopen, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_close, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_close_all, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_read_buffer, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_read_buffer_at_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_write_buffer, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_write_buffer_at_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_seek_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_get_offset, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - AC_CHECK_LIB( - bfio, - libbfio_pool_get_size, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) - - dnl File pool functions - AC_CHECK_LIB( - bfio, - libbfio_file_pool_open, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) + AX_CHECK_LIB_FUNCTIONS( + [libbfio], + [bfio], + [[libbfio_get_version], + [libbfio_handle_free], + [libbfio_handle_open], + [libbfio_handle_close], + [libbfio_handle_exists], + [libbfio_handle_read_buffer], + [libbfio_handle_read_buffer_at_offset], + [libbfio_handle_write_buffer], + [libbfio_handle_write_buffer_at_offset], + [libbfio_handle_seek_offset], + [libbfio_handle_is_open], + [libbfio_handle_get_offset], + [libbfio_handle_get_size], + [libbfio_handle_set_track_offsets_read], + [libbfio_handle_get_number_of_offsets_read], + [libbfio_handle_get_offset_read], + [libbfio_file_initialize], + [libbfio_file_get_name_size], + [libbfio_file_get_name], + [libbfio_file_set_name], + [libbfio_pool_initialize], + [libbfio_pool_free], + [libbfio_pool_clone], + [libbfio_pool_get_number_of_handles], + [libbfio_pool_get_handle], + [libbfio_pool_set_handle], + [libbfio_pool_append_handle], + [libbfio_pool_remove_handle], + [libbfio_pool_get_maximum_number_of_open_handles], + [libbfio_pool_set_maximum_number_of_open_handles], + [libbfio_pool_open], + [libbfio_pool_reopen], + [libbfio_pool_close], + [libbfio_pool_close_all], + [libbfio_pool_read_buffer], + [libbfio_pool_read_buffer_at_offset], + [libbfio_pool_write_buffer], + [libbfio_pool_write_buffer_at_offset], + [libbfio_pool_seek_offset], + [libbfio_pool_get_offset], + [libbfio_pool_get_size], + [libbfio_file_pool_open]]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - bfio, - libbfio_file_pool_open_wide, - [ac_cv_libbfio_dummy=yes], - [ac_cv_libbfio=no]) + [AX_CHECK_LIB_FUNCTIONS( + [libbfio], + [bfio], + [[libbfio_file_get_name_size_wide], + [libbfio_file_get_name_wide], + [libbfio_file_set_name_wide], + [libbfio_file_pool_open_wide]]) ]) ac_cv_libbfio_LIBADD="-lbfio"]) ]) - AS_IF( - [test "x$ac_cv_libbfio" != xyes && test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_with_libbfio" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libbfio in directory: $ac_cv_with_libbfio], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libbfio]) ]) AS_IF( diff --git a/m4/libcaes.m4 b/m4/libcaes.m4 index b819d703..4d6ad47a 100644 --- a/m4/libcaes.m4 +++ b/m4/libcaes.m4 @@ -1,6 +1,6 @@ dnl Checks for libcaes required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240520 dnl Function to detect if libcaes is available dnl ac_libcaes_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCAES_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcaes" != x && test "x$ac_cv_with_libcaes" != xauto-detect && test "x$ac_cv_with_libcaes" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcaes"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcaes}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcaes}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcaes], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcaes])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,80 +38,27 @@ AC_DEFUN([AX_LIBCAES_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcaes_h" = xno], [ac_cv_libcaes=no], - [dnl Check for the individual functions - ac_cv_libcaes=yes - - AC_CHECK_LIB( - caes, - libcaes_get_version, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - - dnl Context functions - AC_CHECK_LIB( - caes, - libcaes_context_initialize, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - AC_CHECK_LIB( - caes, - libcaes_context_free, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - AC_CHECK_LIB( - caes, - libcaes_context_set_key, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - - dnl Tweaked context functions - AC_CHECK_LIB( - caes, - libcaes_tweaked_context_initialize, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - AC_CHECK_LIB( - caes, - libcaes_tweaked_context_free, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - AC_CHECK_LIB( - caes, - libcaes_tweaked_context_set_keys, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - - dnl Crypt functions - AC_CHECK_LIB( - caes, - libcaes_crypt_cbc, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - AC_CHECK_LIB( - caes, - libcaes_crypt_ccm, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - AC_CHECK_LIB( - caes, - libcaes_crypt_ecb, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) - AC_CHECK_LIB( - caes, - libcaes_crypt_xts, - [ac_cv_libcaes_dummy=yes], - [ac_cv_libcaes=no]) + [ac_cv_libcaes=yes + + AX_CHECK_LIB_FUNCTIONS( + [libcaes], + [caes], + [[libcaes_get_version], + [libcaes_context_initialize], + [libcaes_context_free], + [libcaes_context_set_key], + [libcaes_tweaked_context_initialize], + [libcaes_tweaked_context_free], + [libcaes_tweaked_context_set_keys], + [libcaes_crypt_cbc], + [libcaes_crypt_ccm], + [libcaes_crypt_ecb], + [libcaes_crypt_xts]]) ac_cv_libcaes_LIBADD="-lcaes"]) ]) - AS_IF( - [test "x$ac_cv_libcaes" != xyes && test "x$ac_cv_with_libcaes" != x && test "x$ac_cv_with_libcaes" != xauto-detect && test "x$ac_cv_with_libcaes" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcaes in directory: $ac_cv_with_libcaes], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcaes]) ]) AS_IF( diff --git a/m4/libcdata.m4 b/m4/libcdata.m4 index aa01d932..74cea9d1 100644 --- a/m4/libcdata.m4 +++ b/m4/libcdata.m4 @@ -1,6 +1,6 @@ dnl Checks for libcdata required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240514 dnl Function to detect if libcdata is available dnl ac_libcdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCDATA_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_with_libcdata" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcdata"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcdata}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcdata}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcdata], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcdata])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,466 +38,102 @@ AC_DEFUN([AX_LIBCDATA_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcdata_h" = xno], [ac_cv_libcdata=no], - [dnl Check for the individual functions - ac_cv_libcdata=yes - - AC_CHECK_LIB( - cdata, - libcdata_get_version, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - - dnl Array functions - AC_CHECK_LIB( - cdata, - libcdata_array_initialize, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_free, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_empty, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_clone, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_resize, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_reverse, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_get_number_of_entries, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_get_entry_by_index, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_get_entry_by_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_set_entry_by_index, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_prepend_entry, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_append_entry, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_insert_entry, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_array_remove_entry, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - - dnl Balanced tree functions - AC_CHECK_LIB( - cdata, - libcdata_btree_initialize, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_btree_free, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_btree_get_number_of_values, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_btree_get_value_by_index, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_btree_get_value_by_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_btree_insert_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_btree_replace_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_btree_remove_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - - dnl List functions - AC_CHECK_LIB( - cdata, - libcdata_list_initialize, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_free, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_empty, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_clone, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_get_number_of_elements, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_get_first_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_get_last_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_get_element_by_index, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_get_value_by_index, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_prepend_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_prepend_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_append_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_append_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_insert_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_insert_element_with_existing, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_insert_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_insert_value_with_existing, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_remove_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) + [ac_cv_libcdata=yes - dnl List element functions - AC_CHECK_LIB( - cdata, - libcdata_list_element_initialize, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_free, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_get_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_set_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_get_previous_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_set_previous_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_get_next_element, - [ac_cv_libcdata_dummy=yes], - AC_CHECK_LIB( - cdata, - libcdata_list_element_set_next_element, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_get_elements, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_list_element_set_elements, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - [ac_cv_libcdata=no]) - - dnl Range list functions - AC_CHECK_LIB( - cdata, - libcdata_range_list_initialize, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_free, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_empty, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_clone, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_get_number_of_elements, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_insert_range, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_insert_range_list, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_remove_range, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_get_range_by_index, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_get_range_at_offset, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_range_is_present, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_range_has_overlapping_range, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_range_list_get_spanning_range, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - - dnl Tree node functions - AC_CHECK_LIB( - cdata, - libcdata_tree_node_initialize, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_free, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_empty, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_clone, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_set_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_parent_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_set_parent_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_previous_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_set_previous_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_next_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_set_next_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_nodes, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_set_nodes, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_append_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_append_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_insert_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_insert_value, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_replace_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_remove_node, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_number_of_sub_nodes, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_sub_node_by_index, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) - AC_CHECK_LIB( - cdata, - libcdata_tree_node_get_leaf_node_list, - [ac_cv_libcdata_dummy=yes], - [ac_cv_libcdata=no]) + AX_CHECK_LIB_FUNCTIONS( + [libcdata], + [cdata], + [[libcdata_get_version], + [libcdata_array_initialize], + [libcdata_array_free], + [libcdata_array_empty], + [libcdata_array_clone], + [libcdata_array_resize], + [libcdata_array_reverse], + [libcdata_array_get_number_of_entries], + [libcdata_array_get_entry_by_index], + [libcdata_array_get_entry_by_value], + [libcdata_array_set_entry_by_index], + [libcdata_array_prepend_entry], + [libcdata_array_append_entry], + [libcdata_array_insert_entry], + [libcdata_array_remove_entry], + [libcdata_btree_initialize], + [libcdata_btree_free], + [libcdata_btree_get_number_of_values], + [libcdata_btree_get_value_by_index], + [libcdata_btree_get_value_by_value], + [libcdata_btree_insert_value], + [libcdata_btree_replace_value], + [libcdata_btree_remove_value], + [libcdata_list_initialize], + [libcdata_list_free], + [libcdata_list_empty], + [libcdata_list_clone], + [libcdata_list_get_number_of_elements], + [libcdata_list_get_first_element], + [libcdata_list_get_last_element], + [libcdata_list_get_element_by_index], + [libcdata_list_get_value_by_index], + [libcdata_list_prepend_element], + [libcdata_list_prepend_value], + [libcdata_list_append_element], + [libcdata_list_append_value], + [libcdata_list_insert_element], + [libcdata_list_insert_element_with_existing], + [libcdata_list_insert_value], + [libcdata_list_insert_value_with_existing], + [libcdata_list_remove_element], + [libcdata_list_element_initialize], + [libcdata_list_element_free], + [libcdata_list_element_get_value], + [libcdata_list_element_set_value], + [libcdata_list_element_get_previous_element], + [libcdata_list_element_set_previous_element], + [libcdata_list_element_get_next_element], + [libcdata_list_element_get_elements], + [libcdata_list_element_set_elements], + [libcdata_range_list_initialize], + [libcdata_range_list_free], + [libcdata_range_list_empty], + [libcdata_range_list_clone], + [libcdata_range_list_get_number_of_elements], + [libcdata_range_list_insert_range], + [libcdata_range_list_insert_range_list], + [libcdata_range_list_remove_range], + [libcdata_range_list_get_range_by_index], + [libcdata_range_list_get_range_at_offset], + [libcdata_range_list_range_is_present], + [libcdata_range_list_range_has_overlapping_range], + [libcdata_range_list_get_spanning_range], + [libcdata_tree_node_initialize], + [libcdata_tree_node_free], + [libcdata_tree_node_empty], + [libcdata_tree_node_clone], + [libcdata_tree_node_get_value], + [libcdata_tree_node_set_value], + [libcdata_tree_node_get_parent_node], + [libcdata_tree_node_set_parent_node], + [libcdata_tree_node_get_previous_node], + [libcdata_tree_node_set_previous_node], + [libcdata_tree_node_get_next_node], + [libcdata_tree_node_set_next_node], + [libcdata_tree_node_get_nodes], + [libcdata_tree_node_set_nodes], + [libcdata_tree_node_append_node], + [libcdata_tree_node_append_value], + [libcdata_tree_node_insert_node], + [libcdata_tree_node_insert_value], + [libcdata_tree_node_replace_node], + [libcdata_tree_node_remove_node], + [libcdata_tree_node_get_number_of_sub_nodes], + [libcdata_tree_node_get_sub_node_by_index], + [libcdata_tree_node_get_leaf_node_list]]) ac_cv_libcdata_LIBADD="-lcdata"]) ]) - AS_IF( - [test "x$ac_cv_libcdata" != xyes && test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_with_libcdata" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcdata in directory: $ac_cv_with_libcdata], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcdata]) ]) AS_IF( diff --git a/m4/libcdatetime.m4 b/m4/libcdatetime.m4 index 8e66daab..74470acd 100644 --- a/m4/libcdatetime.m4 +++ b/m4/libcdatetime.m4 @@ -1,6 +1,6 @@ dnl Checks for libcdatetime required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240514 dnl Function to detect if libcdatetime is available dnl ac_libcdatetime_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCDATETIME_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcdatetime" != x && test "x$ac_cv_with_libcdatetime" != xauto-detect], - [AS_IF( - [test -d "$ac_cv_with_libcdatetime"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcdatetime}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcdatetime}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcdatetime], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcdatetime])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,186 +38,47 @@ AC_DEFUN([AX_LIBCDATETIME_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcdatetime_h" = xno], [ac_cv_libcdatetime=no], - [dnl Check for the individual functions - ac_cv_libcdatetime=yes - - AC_CHECK_LIB( - cdatetime, - libcdatetime_get_version, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - dnl Time elements functions - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_initialize, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_free, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_copy, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_year, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_day_of_year, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_month, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_day_of_month, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_date_values, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_hours, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_minutes, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_seconds, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_milli_seconds, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_micro_seconds, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_nano_seconds, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_time_values, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_set_current_time_utc, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_set_current_time_localtime, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_delta_in_seconds, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_set_from_delta_in_seconds, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_get_string_size, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_copy_to_string, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_elements_copy_to_string_with_index, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - dnl Timestamp functions - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_initialize, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_free, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_copy, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_set_current_time, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_get_delta_in_seconds, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_get_string_size, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_copy_to_string, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) - AC_CHECK_LIB( - cdatetime, - libcdatetime_timestamp_copy_to_string_with_index, - [ac_cv_libcdatetime_dummy=yes], - [ac_cv_libcdatetime=no]) + [ac_cv_libcdatetime=yes + + AX_CHECK_LIB_FUNCTIONS( + [libcdatetime], + [cdatetime], + [[libcdatetime_get_version], + [libcdatetime_elements_initialize], + [libcdatetime_elements_free], + [libcdatetime_elements_copy], + [libcdatetime_elements_get_year], + [libcdatetime_elements_get_day_of_year], + [libcdatetime_elements_get_month], + [libcdatetime_elements_get_day_of_month], + [libcdatetime_elements_get_date_values], + [libcdatetime_elements_get_hours], + [libcdatetime_elements_get_minutes], + [libcdatetime_elements_get_seconds], + [libcdatetime_elements_get_milli_seconds], + [libcdatetime_elements_get_micro_seconds], + [libcdatetime_elements_get_nano_seconds], + [libcdatetime_elements_get_time_values], + [libcdatetime_elements_set_current_time_utc], + [libcdatetime_elements_set_current_time_localtime], + [libcdatetime_elements_get_delta_in_seconds], + [libcdatetime_elements_set_from_delta_in_seconds], + [libcdatetime_elements_get_string_size], + [libcdatetime_elements_copy_to_string], + [libcdatetime_elements_copy_to_string_with_index], + [libcdatetime_timestamp_initialize], + [libcdatetime_timestamp_free], + [libcdatetime_timestamp_copy], + [libcdatetime_timestamp_set_current_time], + [libcdatetime_timestamp_get_delta_in_seconds], + [libcdatetime_timestamp_get_string_size], + [libcdatetime_timestamp_copy_to_string], + [libcdatetime_timestamp_copy_to_string_with_index]]) ac_cv_libcdatetime_LIBADD="-lcdatetime"]) ]) - AS_IF( - [test "x$ac_cv_libcdatetime" != xyes && test "x$ac_cv_with_libcdatetime" != x && test "x$ac_cv_with_libcdatetime" != xauto-detect && test "x$ac_cv_with_libcdatetime" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcdatetime in directory: $ac_cv_with_libcdatetime], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcdatetime]) ]) AS_IF( diff --git a/m4/libcerror.m4 b/m4/libcerror.m4 index e9abcdbc..02263bb1 100644 --- a/m4/libcerror.m4 +++ b/m4/libcerror.m4 @@ -1,6 +1,6 @@ dnl Checks for libcerror required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240513 dnl Function to detect if libcerror is available dnl ac_libcerror_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_with_libcerror" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcerror"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcerror}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcerror}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcerror], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcerror])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,68 +38,25 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcerror_h" = xno], [ac_cv_libcerror=no], - [dnl Check for the individual functions - ac_cv_libcerror=yes - - AC_CHECK_LIB( - cerror, - libcerror_get_version, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - - dnl Error functions - AC_CHECK_LIB( - cerror, - libcerror_error_free, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - AC_CHECK_LIB( - cerror, - libcerror_error_set, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - AC_CHECK_LIB( - cerror, - libcerror_error_matches, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - AC_CHECK_LIB( - cerror, - libcerror_error_fprint, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - AC_CHECK_LIB( - cerror, - libcerror_error_sprint, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - AC_CHECK_LIB( - cerror, - libcerror_error_backtrace_fprint, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - AC_CHECK_LIB( - cerror, - libcerror_error_backtrace_sprint, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) - - dnl System error functions - AC_CHECK_LIB( - cerror, - libcerror_system_set_error, - [ac_cv_libcerror_dummy=yes], - [ac_cv_libcerror=no]) + [ac_cv_libcerror=yes + + AX_CHECK_LIB_FUNCTIONS( + [libcerror], + [cerror], + [[libcerror_get_version], + [libcerror_error_free], + [libcerror_error_set], + [libcerror_error_matches], + [libcerror_error_fprint], + [libcerror_error_sprint], + [libcerror_error_backtrace_fprint], + [libcerror_error_backtrace_sprint], + [libcerror_system_set_error]]) ac_cv_libcerror_LIBADD="-lcerror"]) ]) - AS_IF( - [test "x$ac_cv_libcerror" != xyes && test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_with_libcerror" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcerror in directory: $ac_cv_with_libcerror], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcerror]) ]) AS_IF( diff --git a/m4/libcfile.m4 b/m4/libcfile.m4 index 81ac5f14..e9e77295 100644 --- a/m4/libcfile.m4 +++ b/m4/libcfile.m4 @@ -1,6 +1,6 @@ dnl Checks for libcfile required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240514 dnl Function to detect if libcfile is available dnl ac_libcfile_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCFILE_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_with_libcfile" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcfile"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcfile}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcfile}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcfile], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcfile])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -67,151 +59,47 @@ AC_DEFUN([AX_LIBCFILE_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcfile_h" = xno], [ac_cv_libcfile=no], - [dnl Check for the individual functions - ac_cv_libcfile=yes - - AC_CHECK_LIB( - cfile, - libcfile_get_version, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - - dnl File functions - AC_CHECK_LIB( - cfile, - libcfile_file_initialize, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_free, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_open, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_open_with_error_code, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_close, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_read_buffer, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_read_buffer_with_error_code, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_write_buffer, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_write_buffer_with_error_code, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_seek_offset, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_resize, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_is_open, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_get_offset, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_get_size, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_is_device, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_io_control_read, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_io_control_read_with_error_code, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - - AS_IF( - [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - cfile, - libcfile_file_open_wide, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_open_wide_with_error_code, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - ]) + [ac_cv_libcfile=yes - dnl Support functions - AC_CHECK_LIB( - cfile, - libcfile_file_exists, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_remove, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) + AX_CHECK_LIB_FUNCTIONS( + [libcfile], + [cfile], + [[libcfile_get_version], + [libcfile_file_initialize], + [libcfile_file_free], + [libcfile_file_open], + [libcfile_file_open_with_error_code], + [libcfile_file_close], + [libcfile_file_read_buffer], + [libcfile_file_read_buffer_with_error_code], + [libcfile_file_write_buffer], + [libcfile_file_write_buffer_with_error_code], + [libcfile_file_seek_offset], + [libcfile_file_resize], + [libcfile_file_is_open], + [libcfile_file_get_offset], + [libcfile_file_get_size], + [libcfile_file_is_device], + [libcfile_file_io_control_read], + [libcfile_file_io_control_read_with_error_code], + [libcfile_file_exists], + [libcfile_file_remove]]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - cfile, - libcfile_file_exists_wide, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) - AC_CHECK_LIB( - cfile, - libcfile_file_remove_wide, - [ac_cv_libcfile_dummy=yes], - [ac_cv_libcfile=no]) + [AX_CHECK_LIB_FUNCTIONS( + [libcfile], + [cfile], + [[libcfile_file_open_wide], + [libcfile_file_open_wide_with_error_code], + [libcfile_file_exists_wide], + [libcfile_file_remove_wide]]) ]) ac_cv_libcfile_LIBADD="-lcfile"]) ]) - AS_IF( - [test "x$ac_cv_libcfile" != xyes && test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_with_libcfile" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcfile in directory: $ac_cv_with_libcfile], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcfile]) ]) AS_IF( diff --git a/m4/libclocale.m4 b/m4/libclocale.m4 index bd5a10e5..e9cb5bbe 100644 --- a/m4/libclocale.m4 +++ b/m4/libclocale.m4 @@ -1,6 +1,6 @@ dnl Checks for libclocale required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240513 dnl Function to detect if libclocale is available dnl ac_libclocale_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_with_libclocale" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libclocale"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libclocale}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libclocale}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libclocale], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libclocale])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -67,36 +59,19 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libclocale_h" = xno], [ac_cv_libclocale=no], - [dnl Check for the individual functions - ac_cv_libclocale=yes - - AC_CHECK_LIB( - clocale, - libclocale_get_version, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) + [ac_cv_libclocale=yes - dnl Codepage functions - AC_CHECK_LIB( - clocale, - libclocale_codepage, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) - AC_CHECK_LIB( - clocale, - libclocale_codepage_get, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) - AC_CHECK_LIB( - clocale, - libclocale_codepage_set, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) - AC_CHECK_LIB( - clocale, - libclocale_codepage_copy_from_string, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) + AX_CHECK_LIB_FUNCTIONS( + [libclocale], + [clocale], + [[libclocale_get_version], + [libclocale_codepage], + [libclocale_codepage_get], + [libclocale_codepage_set], + [libclocale_codepage_copy_from_string], + [libclocale_locale_get_codepage], + [libclocale_locale_get_decimal_point], + [libclocale_initialize]]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], @@ -107,34 +82,10 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LIB], [ac_cv_libclocale=no]) ]) - dnl Locale functions - AC_CHECK_LIB( - clocale, - libclocale_locale_get_codepage, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) - AC_CHECK_LIB( - clocale, - libclocale_locale_get_decimal_point, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) - - dnl Support functions - AC_CHECK_LIB( - clocale, - libclocale_initialize, - [ac_cv_libclocale_dummy=yes], - [ac_cv_libclocale=no]) - ac_cv_libclocale_LIBADD="-lclocale"]) ]) - AS_IF( - [test "x$ac_cv_libclocale" != xyes && test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_with_libclocale" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libclocale in directory: $ac_cv_with_libclocale], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libclocale]) ]) AS_IF( diff --git a/m4/libcnotify.m4 b/m4/libcnotify.m4 index e382bdb0..c0404ccd 100644 --- a/m4/libcnotify.m4 +++ b/m4/libcnotify.m4 @@ -1,6 +1,6 @@ dnl Checks for libcnotify required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240513 dnl Function to detect if libcnotify is available dnl ac_libcnotify_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_with_libcnotify" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcnotify"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcnotify}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcnotify}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcnotify], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcnotify])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,65 +38,24 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcnotify_h" = xno], [ac_cv_libcnotify=no], - [dnl Check for the individual functions - ac_cv_libcnotify=yes - - AC_CHECK_LIB( - cnotify, - libcnotify_get_version, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) - - dnl Print functions - AC_CHECK_LIB( - cnotify, - libcnotify_printf, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) - AC_CHECK_LIB( - cnotify, - libcnotify_print_data, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) - AC_CHECK_LIB( - cnotify, - libcnotify_print_error_backtrace, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) - - dnl Stream functions - AC_CHECK_LIB( - cnotify, - libcnotify_stream_set, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) - AC_CHECK_LIB( - cnotify, - libcnotify_stream_open, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) - AC_CHECK_LIB( - cnotify, - libcnotify_stream_close, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) - - dnl Verbose functions - AC_CHECK_LIB( - cnotify, - libcnotify_verbose_set, - [ac_cv_libcnotify_dummy=yes], - [ac_cv_libcnotify=no]) + [ac_cv_libcnotify=yes + + AX_CHECK_LIB_FUNCTIONS( + [libcnotify], + [cnotify], + [[libcnotify_get_version], + [libcnotify_printf], + [libcnotify_print_data], + [libcnotify_print_error_backtrace], + [libcnotify_stream_set], + [libcnotify_stream_open], + [libcnotify_stream_close], + [libcnotify_verbose_set]]) ac_cv_libcnotify_LIBADD="-lcnotify"]) ]) - AS_IF( - [test "x$ac_with_libcnotify" != xyes && test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_with_libcnotify" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcnotify in directory: $ac_cv_with_libcnotify], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcnotify]) ]) AS_IF( diff --git a/m4/libcpath.m4 b/m4/libcpath.m4 index bf44d46e..ad4cfe6e 100644 --- a/m4/libcpath.m4 +++ b/m4/libcpath.m4 @@ -1,6 +1,6 @@ dnl Checks for libcpath required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240518 dnl Function to detect if libcpath is available dnl ac_libcpath_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCPATH_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_with_libcpath" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcpath"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcpath}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcpath}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcpath], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcpath])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -67,100 +59,38 @@ AC_DEFUN([AX_LIBCPATH_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcpath_h" = xno], [ac_cv_libcpath=no], - [dnl Check for the individual functions - ac_cv_libcpath=yes - - AC_CHECK_LIB( - cpath, - libcpath_get_version, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) + [ac_cv_libcpath=yes - dnl Path functions - AC_CHECK_LIB( - cpath, - libcpath_path_change_directory, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_current_working_directory, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_full_path, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_sanitized_filename, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_sanitized_path, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_join, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_make_directory, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) + AX_CHECK_LIB_FUNCTIONS( + [libcpath], + [cpath], + [[libcpath_get_version], + [libcpath_path_change_directory], + [libcpath_path_get_current_working_directory], + [libcpath_path_get_full_path], + [libcpath_path_get_sanitized_filename], + [libcpath_path_get_sanitized_path], + [libcpath_path_join], + [libcpath_path_make_directory]]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - cpath, - libcpath_path_change_directory_wide, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_current_working_directory_wide, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_full_path_wide, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_sanitized_filename_wide, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_get_sanitized_path_wide, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_join_wide, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) - AC_CHECK_LIB( - cpath, - libcpath_path_make_directory_wide, - [ac_cv_libcpath_dummy=yes], - [ac_cv_libcpath=no]) + [AX_CHECK_LIB_FUNCTIONS( + [libcpath], + [cpath], + [[libcpath_path_change_directory_wide], + [libcpath_path_get_current_working_directory_wide], + [libcpath_path_get_full_path_wide], + [libcpath_path_get_sanitized_filename_wide], + [libcpath_path_get_sanitized_path_wide], + [libcpath_path_join_wide], + [libcpath_path_make_directory_wide]]) ]) ac_cv_libcpath_LIBADD="-lcpath"]) ]) - AS_IF( - [test "x$ac_cv_libcpath" != xyes && test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_with_libcpath" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcpath in directory: $ac_cv_with_libcpath], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcpath]) ]) AS_IF( diff --git a/m4/libcsplit.m4 b/m4/libcsplit.m4 index 1ac7b9f2..20bbec94 100644 --- a/m4/libcsplit.m4 +++ b/m4/libcsplit.m4 @@ -1,6 +1,6 @@ dnl Checks for libcsplit required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240513 dnl Function to detect if libcsplit is available dnl ac_libcsplit_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCSPLIT_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_with_libcsplit" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcsplit"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcsplit}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcsplit}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcsplit], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcsplit])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -67,95 +59,37 @@ AC_DEFUN([AX_LIBCSPLIT_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcsplit_h" = xno], [ac_cv_libcsplit=no], - [dnl Check for the individual functions - ac_cv_libcsplit=yes - - AC_CHECK_LIB( - csplit, - libcsplit_get_version, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - - dnl Narrow string functions - AC_CHECK_LIB( - csplit, - libcsplit_narrow_string_split, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - - dnl Narrow split string functions - AC_CHECK_LIB( - csplit, - libcsplit_narrow_split_string_free, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_narrow_split_string_get_string, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_narrow_split_string_get_number_of_segments, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_narrow_split_string_get_segment_by_index, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_narrow_split_string_set_segment_by_index, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) + [ac_cv_libcsplit=yes + + AX_CHECK_LIB_FUNCTIONS( + [libcsplit], + [csplit], + [[libcsplit_get_version], + [libcsplit_narrow_string_split], + [libcsplit_narrow_split_string_free], + [libcsplit_narrow_split_string_get_string], + [libcsplit_narrow_split_string_get_number_of_segments], + [libcsplit_narrow_split_string_get_segment_by_index], + [libcsplit_narrow_split_string_set_segment_by_index]]) dnl Wide string functions AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - csplit, - libcsplit_wide_string_split, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - - dnl Wide split string functions - AC_CHECK_LIB( - csplit, - libcsplit_wide_split_string_free, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_wide_split_string_get_string, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_wide_split_string_get_number_of_segments, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_wide_split_string_get_segment_by_index, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) - AC_CHECK_LIB( - csplit, - libcsplit_wide_split_string_set_segment_by_index, - [ac_cv_libcsplit_dummy=yes], - [ac_cv_libcsplit=no]) + [AX_CHECK_LIB_FUNCTIONS( + [libcsplit], + [csplit], + [[libcsplit_wide_string_split], + [libcsplit_wide_split_string_free], + [libcsplit_wide_split_string_get_string], + [libcsplit_wide_split_string_get_number_of_segments], + [libcsplit_wide_split_string_get_segment_by_index], + [libcsplit_wide_split_string_set_segment_by_index]]) ]) ac_cv_libcsplit_LIBADD="-lcsplit"]) ]) - AS_IF( - [test "x$ac_cv_libcsplit" != xyes && test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_with_libcsplit" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcsplit in directory: $ac_cv_with_libcsplit], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcsplit]) ]) AS_IF( diff --git a/m4/libcthreads.m4 b/m4/libcthreads.m4 index c9c4e46a..a2217643 100644 --- a/m4/libcthreads.m4 +++ b/m4/libcthreads.m4 @@ -1,6 +1,6 @@ dnl Checks for libcthreads required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240513 dnl Function to detect if libcthreads is available dnl ac_libcthreads_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_with_libcthreads" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libcthreads"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcthreads}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcthreads}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libcthreads], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libcthreads])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,215 +38,52 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcthreads_h" = xno], [ac_cv_libcthreads=no], - [dnl Check for the individual functions - ac_cv_libcthreads=yes - - AC_CHECK_LIB( - cthreads, - libcthreads_get_version, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - - dnl Thread functions - AC_CHECK_LIB( - cthreads, - libcthreads_thread_create, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_thread_join, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - - dnl Thread attributes functions - AC_CHECK_LIB( - cthreads, - libcthreads_thread_attributes_initialize, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_thread_attributes_free, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - - dnl Condition functions - AC_CHECK_LIB( - cthreads, - libcthreads_condition_initialize, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_condition_free, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_condition_broadcast, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_condition_signal, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_condition_wait, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - - dnl Lock functions - AC_CHECK_LIB( - cthreads, - libcthreads_lock_initialize, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_lock_free, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_lock_grab, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_lock_release, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - - dnl Mutex functions - AC_CHECK_LIB( - cthreads, - libcthreads_mutex_initialize, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_mutex_free, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_mutex_grab, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_mutex_try_grab, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_mutex_release, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) + [ac_cv_libcthreads=yes - dnl Read/Write lock functions - AC_CHECK_LIB( - cthreads, - libcthreads_read_write_lock_initialize, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_read_write_lock_free, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_read_write_lock_grab_for_read, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_read_write_lock_grab_for_write, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_read_write_lock_release_for_read, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_read_write_lock_release_for_write, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - - dnl Queue functions - AC_CHECK_LIB( - cthreads, - libcthreads_queue_initialize, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_queue_free, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_queue_type_pop, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_queue_pop, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_queue_try_push, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_queue_push, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_queue_push_sorted, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - - dnl Thread pool functions - AC_CHECK_LIB( - cthreads, - libcthreads_thread_pool_create, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_thread_pool_push, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_thread_pool_push_sorted, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) - AC_CHECK_LIB( - cthreads, - libcthreads_thread_pool_join, - [ac_cv_libcthreads_dummy=yes], - [ac_cv_libcthreads=no]) + AX_CHECK_LIB_FUNCTIONS( + [libcthreads], + [cthreads], + [[libcthreads_get_version], + [libcthreads_thread_create], + [libcthreads_thread_join], + [libcthreads_thread_attributes_initialize], + [libcthreads_thread_attributes_free], + [libcthreads_condition_initialize], + [libcthreads_condition_free], + [libcthreads_condition_broadcast], + [libcthreads_condition_signal], + [libcthreads_condition_wait], + [libcthreads_lock_initialize], + [libcthreads_lock_free], + [libcthreads_lock_grab], + [libcthreads_lock_release], + [libcthreads_mutex_initialize], + [libcthreads_mutex_free], + [libcthreads_mutex_grab], + [libcthreads_mutex_try_grab], + [libcthreads_mutex_release], + [libcthreads_read_write_lock_initialize], + [libcthreads_read_write_lock_free], + [libcthreads_read_write_lock_grab_for_read], + [libcthreads_read_write_lock_grab_for_write], + [libcthreads_read_write_lock_release_for_read], + [libcthreads_read_write_lock_release_for_write], + [libcthreads_queue_initialize], + [libcthreads_queue_free], + [libcthreads_queue_type_pop], + [libcthreads_queue_pop], + [libcthreads_queue_try_push], + [libcthreads_queue_push], + [libcthreads_queue_push_sorted], + [libcthreads_thread_pool_create], + [libcthreads_thread_pool_push], + [libcthreads_thread_pool_push_sorted], + [libcthreads_thread_pool_join]]) ac_cv_libcthreads_LIBADD="-lcthreads"]) ]) - AS_IF( - [test "x$ac_cv_libcthreads" != xyes && test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_with_libcthreads" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libcthreads in directory: $ac_cv_with_libcthreads], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libcthreads]) ]) AS_IF( diff --git a/m4/libfcache.m4 b/m4/libfcache.m4 index f063bae2..8d84e7f8 100644 --- a/m4/libfcache.m4 +++ b/m4/libfcache.m4 @@ -1,6 +1,6 @@ dnl Checks for libfcache required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240514 dnl Function to detect if libfcache is available dnl ac_libfcache_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBFCACHE_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect && test "x$ac_cv_with_libfcache" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libfcache"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libfcache}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfcache}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libfcache], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libfcache])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,120 +38,35 @@ AC_DEFUN([AX_LIBFCACHE_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libfcache_h" = xno], [ac_cv_libfcache=no], - [dnl Check for the individual functions - ac_cv_libfcache=yes - - AC_CHECK_LIB( - fcache, - libfcache_get_version, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - - dnl Cache functions - AC_CHECK_LIB( - fcache, - libfcache_cache_initialize, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_free, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_clone, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_clear, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_get_number_of_entries, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_get_number_of_cache_values, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_clear_value_by_index, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_get_value_by_identifier, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_get_value_by_index, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_set_value_by_identifier, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_set_value_by_index, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - - dnl Cache value functions - AC_CHECK_LIB( - fcache, - libfcache_cache_value_free, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_value_clear, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_value_get_identifier, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_value_set_identifier, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_value_get_value, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) - AC_CHECK_LIB( - fcache, - libfcache_cache_value_set_value, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) + [ac_cv_libfcache=yes - dnl Date time functions - AC_CHECK_LIB( - fcache, - libfcache_date_time_get_timestamp, - [ac_cv_libfcache_dummy=yes], - [ac_cv_libfcache=no]) + AX_CHECK_LIB_FUNCTIONS( + [libfcache], + [fcache], + [[libfcache_get_version], + [libfcache_cache_initialize], + [libfcache_cache_free], + [libfcache_cache_clone], + [libfcache_cache_clear], + [libfcache_cache_get_number_of_entries], + [libfcache_cache_get_number_of_cache_values], + [libfcache_cache_clear_value_by_index], + [libfcache_cache_get_value_by_identifier], + [libfcache_cache_get_value_by_index], + [libfcache_cache_set_value_by_identifier], + [libfcache_cache_set_value_by_index], + [libfcache_cache_value_free], + [libfcache_cache_value_clear], + [libfcache_cache_value_get_identifier], + [libfcache_cache_value_set_identifier], + [libfcache_cache_value_get_value], + [libfcache_cache_value_set_value], + [libfcache_date_time_get_timestamp]]) ac_cv_libfcache_LIBADD="-lfcache"]) ]) - AS_IF( - [test "x$ac_cv_libfcache" != xyes && test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect && test "x$ac_cv_with_libfcache" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libfcache in directory: $ac_cv_with_libfcache], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libfcache]) ]) AS_IF( diff --git a/m4/libfdata.m4 b/m4/libfdata.m4 index 50ffbb10..7d2d88e4 100644 --- a/m4/libfdata.m4 +++ b/m4/libfdata.m4 @@ -1,6 +1,6 @@ dnl Functions for libfdata dnl -dnl Version: 20240413 +dnl Version: 20240520 dnl Function to detect if libfdata is available dnl ac_libfdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBFDATA_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect && test "x$ac_cv_with_libfdata" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libfdata"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libfdata}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfdata}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libfdata], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libfdata])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,423 +38,117 @@ AC_DEFUN([AX_LIBFDATA_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libfdata_h" = xno], [ac_cv_libfdata=no], - [dnl Check for the individual functions - ac_cv_libfdata=yes - - AC_CHECK_LIB( - fdata, - libfdata_get_version, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl Area functions - AC_CHECK_LIB( - fdata, - libfdata_area_initialize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_free, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_clone, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_empty, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_resize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_number_of_segments, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_set_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_prepend_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_append_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_element_data_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_set_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl List functions - AC_CHECK_LIB( - fdata, - libfdata_list_initialize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_free, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_clone, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_empty, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_resize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_reverse, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_number_of_elements, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_list_element_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_prepend_element, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_append_element, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_append_list, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_is_element_set, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_mapped_range, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_mapped_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_mapped_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_mapped_size_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_mapped_size_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_by_index_with_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_by_index_with_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_append_element_with_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_index_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_list_element_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_cache_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_value_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_value_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) + [ac_cv_libfdata=yes - dnl List element functions - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl Range list functions - dnl TODO: add functions - - dnl Stream functions - AC_CHECK_LIB( - fdata, - libfdata_stream_initialize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_free, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_clone, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_empty, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_resize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_reverse, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_get_number_of_segments, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_set_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_prepend_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_append_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_set_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_mapped_range, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_index_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_read_buffer, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_read_buffer_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_write_buffer, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_seek_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl Tree list functions - dnl TODO: add functions - - dnl Vector list functions - dnl TODO: add functions + AX_CHECK_LIB_FUNCTIONS( + [libfdata], + [fdata], + [[libfdata_get_version], + [libfdata_area_initialize], + [libfdata_area_free], + [libfdata_area_clone], + [libfdata_area_empty], + [libfdata_area_resize], + [libfdata_area_get_number_of_segments], + [libfdata_area_get_segment_by_index], + [libfdata_area_set_segment_by_index], + [libfdata_area_prepend_segment], + [libfdata_area_append_segment], + [libfdata_area_get_element_data_size], + [libfdata_area_get_element_value_at_offset], + [libfdata_area_set_element_value_at_offset], + [libfdata_area_get_size], + [libfdata_list_initialize], + [libfdata_list_free], + [libfdata_list_clone], + [libfdata_list_empty], + [libfdata_list_resize], + [libfdata_list_reverse], + [libfdata_list_get_number_of_elements], + [libfdata_list_get_list_element_by_index], + [libfdata_list_get_element_by_index], + [libfdata_list_set_element_by_index], + [libfdata_list_prepend_element], + [libfdata_list_append_element], + [libfdata_list_append_list], + [libfdata_list_is_element_set], + [libfdata_list_get_element_mapped_range], + [libfdata_list_get_mapped_offset], + [libfdata_list_set_mapped_offset], + [libfdata_list_get_mapped_size_by_index], + [libfdata_list_set_mapped_size_by_index], + [libfdata_list_get_element_by_index_with_mapped_size], + [libfdata_list_set_element_by_index_with_mapped_size], + [libfdata_list_append_element_with_mapped_size], + [libfdata_list_get_element_index_at_offset], + [libfdata_list_get_list_element_at_offset], + [libfdata_list_get_element_at_offset], + [libfdata_list_cache_element_value], + [libfdata_list_get_element_value_by_index], + [libfdata_list_get_element_value_at_offset], + [libfdata_list_set_element_value_by_index], + [libfdata_list_set_element_value_at_offset], + [libfdata_list_get_size], + [libfdata_list_element_get_mapped_size], + [libfdata_list_element_set_mapped_size], + [libfdata_list_element_get_element_value], + [libfdata_list_element_set_element_value], + [libfdata_list_element_get_mapped_size], + [libfdata_list_element_set_mapped_size], + [libfdata_list_element_get_element_value], + [libfdata_list_element_set_element_value], + [libfdata_stream_initialize], + [libfdata_stream_free], + [libfdata_stream_clone], + [libfdata_stream_empty], + [libfdata_stream_resize], + [libfdata_stream_reverse], + [libfdata_stream_get_number_of_segments], + [libfdata_stream_get_segment_by_index], + [libfdata_stream_set_segment_by_index], + [libfdata_stream_prepend_segment], + [libfdata_stream_append_segment], + [libfdata_stream_set_mapped_size], + [libfdata_stream_get_segment_mapped_range], + [libfdata_stream_get_segment_index_at_offset], + [libfdata_stream_get_segment_at_offset], + [libfdata_stream_read_buffer], + [libfdata_stream_read_buffer_at_offset], + [libfdata_stream_write_buffer], + [libfdata_stream_seek_offset], + [libfdata_stream_get_offset], + [libfdata_stream_get_size], + [libfdata_range_list_initialize], + [libfdata_range_list_free], + [libfdata_range_list_clone], + [libfdata_range_list_empty], + [libfdata_range_list_get_list_element_at_offset], + [libfdata_range_list_get_element_at_offset], + [libfdata_range_list_insert_element], + [libfdata_range_list_get_element_value_at_offset], + [libfdata_range_list_set_element_value_at_offset], + [libfdata_vector_initialize], + [libfdata_vector_free], + [libfdata_vector_clone], + [libfdata_vector_empty], + [libfdata_vector_resize], + [libfdata_vector_get_number_of_segments], + [libfdata_vector_get_segment_by_index], + [libfdata_vector_set_segment_by_index], + [libfdata_vector_prepend_segment], + [libfdata_vector_append_segment], + [libfdata_vector_get_element_data_size], + [libfdata_vector_get_number_of_elements], + [libfdata_vector_get_element_index_at_offset], + [libfdata_vector_get_element_value_by_index], + [libfdata_vector_get_element_value_at_offset], + [libfdata_vector_set_element_value_by_index], + [libfdata_vector_get_size]]) ac_cv_libfdata_LIBADD="-lfdata"]) ]) - AS_IF( - [test "x$ac_cv_libfdata" != xyes && test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect && test "x$ac_cv_with_libfdata" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libfdata in directory: $ac_cv_with_libfdata], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libfdata]) ]) AS_IF( diff --git a/m4/libfdatetime.m4 b/m4/libfdatetime.m4 index d8f1066e..f945e4f3 100644 --- a/m4/libfdatetime.m4 +++ b/m4/libfdatetime.m4 @@ -1,6 +1,6 @@ dnl Checks for libfdatetime required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240518 dnl Function to detect if libfdatetime is available dnl ac_libfdatetime_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBFDATETIME_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect && test "x$ac_cv_with_libfdatetime" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libfdatetime"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libfdatetime}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfdatetime}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libfdatetime], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libfdatetime])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,428 +38,95 @@ AC_DEFUN([AX_LIBFDATETIME_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libfdatetime_h" = xno], [ac_cv_libfdatetime=no], - [dnl Check for the individual functions - ac_cv_libfdatetime=yes - - AC_CHECK_LIB( - fdatetime, - libfdatetime_get_version, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - - dnl FAT date time functions - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_initialize, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_free, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_from_byte_stream, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_from_32bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_to_32bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_to_utf8_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_to_utf8_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_to_utf16_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_to_utf16_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_to_utf32_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_fat_date_time_copy_to_utf32_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - - dnl FILETIME functions - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_initialize, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_free, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_from_byte_stream, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_from_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_to_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_to_utf8_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_to_utf8_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_to_utf16_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_to_utf16_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_to_utf32_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_copy_to_utf32_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_filetime_add, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - - dnl Floatingtime functions - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_initialize, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_free, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_from_byte_stream, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_from_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_to_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_to_utf8_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_to_utf8_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_to_utf16_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_to_utf16_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_to_utf32_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_floatingtime_copy_to_utf32_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - - dnl HFS time functions - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_initialize, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_free, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_from_byte_stream, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_from_32bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_to_32bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_to_utf8_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_to_utf8_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_to_utf16_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_to_utf16_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_to_utf32_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_hfs_time_copy_to_utf32_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) + [ac_cv_libfdatetime=yes - dnl NSF timedate functions - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_initialize, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_free, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_from_byte_stream, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_from_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_to_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_to_utf8_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_to_utf8_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_to_utf16_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_to_utf16_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_to_utf32_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_nsf_timedate_copy_to_utf32_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - - dnl POSIX time functions - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_initialize, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_free, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_from_byte_stream, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_from_32bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_32bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_from_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_64bit, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_utf8_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_utf8_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_utf16_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_utf16_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_utf32_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_posix_time_copy_to_utf32_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - - dnl Systemtime functions - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_initialize, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_free, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_copy_from_byte_stream, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_copy_to_utf8_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_copy_to_utf8_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_copy_to_utf16_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_copy_to_utf16_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_copy_to_utf32_string, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) - AC_CHECK_LIB( - fdatetime, - libfdatetime_systemetime_copy_to_utf32_string_with_index, - [ac_cv_libfdatetime_dummy=yes], - [ac_cv_libfdatetime=no]) + AX_CHECK_LIB_FUNCTIONS( + [libfdatetime], + [fdatetime], + [[libfdatetime_get_version], + [libfdatetime_fat_date_time_initialize], + [libfdatetime_fat_date_time_free], + [libfdatetime_fat_date_time_copy_from_byte_stream], + [libfdatetime_fat_date_time_copy_from_32bit], + [libfdatetime_fat_date_time_copy_to_32bit], + [libfdatetime_fat_date_time_copy_to_utf8_string], + [libfdatetime_fat_date_time_copy_to_utf8_string_with_index], + [libfdatetime_fat_date_time_copy_to_utf16_string], + [libfdatetime_fat_date_time_copy_to_utf16_string_with_index], + [libfdatetime_fat_date_time_copy_to_utf32_string], + [libfdatetime_fat_date_time_copy_to_utf32_string_with_index], + [libfdatetime_filetime_initialize], + [libfdatetime_filetime_free], + [libfdatetime_filetime_copy_from_byte_stream], + [libfdatetime_filetime_copy_from_64bit], + [libfdatetime_filetime_copy_to_64bit], + [libfdatetime_filetime_copy_to_utf8_string], + [libfdatetime_filetime_copy_to_utf8_string_with_index], + [libfdatetime_filetime_copy_to_utf16_string], + [libfdatetime_filetime_copy_to_utf16_string_with_index], + [libfdatetime_filetime_copy_to_utf32_string], + [libfdatetime_filetime_copy_to_utf32_string_with_index], + [libfdatetime_filetime_add], + [libfdatetime_floatingtime_initialize], + [libfdatetime_floatingtime_free], + [libfdatetime_floatingtime_copy_from_byte_stream], + [libfdatetime_floatingtime_copy_from_64bit], + [libfdatetime_floatingtime_copy_to_64bit], + [libfdatetime_floatingtime_copy_to_utf8_string], + [libfdatetime_floatingtime_copy_to_utf8_string_with_index], + [libfdatetime_floatingtime_copy_to_utf16_string], + [libfdatetime_floatingtime_copy_to_utf16_string_with_index], + [libfdatetime_floatingtime_copy_to_utf32_string], + [libfdatetime_floatingtime_copy_to_utf32_string_with_index], + [libfdatetime_hfs_time_initialize], + [libfdatetime_hfs_time_free], + [libfdatetime_hfs_time_copy_from_byte_stream], + [libfdatetime_hfs_time_copy_from_32bit], + [libfdatetime_hfs_time_copy_to_32bit], + [libfdatetime_hfs_time_copy_to_utf8_string], + [libfdatetime_hfs_time_copy_to_utf8_string_with_index], + [libfdatetime_hfs_time_copy_to_utf16_string], + [libfdatetime_hfs_time_copy_to_utf16_string_with_index], + [libfdatetime_hfs_time_copy_to_utf32_string], + [libfdatetime_hfs_time_copy_to_utf32_string_with_index], + [libfdatetime_nsf_timedate_initialize], + [libfdatetime_nsf_timedate_free], + [libfdatetime_nsf_timedate_copy_from_byte_stream], + [libfdatetime_nsf_timedate_copy_from_64bit], + [libfdatetime_nsf_timedate_copy_to_64bit], + [libfdatetime_nsf_timedate_copy_to_utf8_string], + [libfdatetime_nsf_timedate_copy_to_utf8_string_with_index], + [libfdatetime_nsf_timedate_copy_to_utf16_string], + [libfdatetime_nsf_timedate_copy_to_utf16_string_with_index], + [libfdatetime_nsf_timedate_copy_to_utf32_string], + [libfdatetime_nsf_timedate_copy_to_utf32_string_with_index], + [libfdatetime_posix_time_initialize], + [libfdatetime_posix_time_free], + [libfdatetime_posix_time_copy_from_byte_stream], + [libfdatetime_posix_time_copy_from_32bit], + [libfdatetime_posix_time_copy_to_32bit], + [libfdatetime_posix_time_copy_from_64bit], + [libfdatetime_posix_time_copy_to_64bit], + [libfdatetime_posix_time_copy_to_utf8_string], + [libfdatetime_posix_time_copy_to_utf8_string_with_index], + [libfdatetime_posix_time_copy_to_utf16_string], + [libfdatetime_posix_time_copy_to_utf16_string_with_index], + [libfdatetime_posix_time_copy_to_utf32_string], + [libfdatetime_posix_time_copy_to_utf32_string_with_index], + [libfdatetime_systemetime_initialize], + [libfdatetime_systemetime_free], + [libfdatetime_systemetime_copy_from_byte_stream], + [libfdatetime_systemetime_copy_to_utf8_string], + [libfdatetime_systemetime_copy_to_utf8_string_with_index], + [libfdatetime_systemetime_copy_to_utf16_string], + [libfdatetime_systemetime_copy_to_utf16_string_with_index], + [libfdatetime_systemetime_copy_to_utf32_string], + [libfdatetime_systemetime_copy_to_utf32_string_with_index]]) ac_cv_libfdatetime_LIBADD="-lfdatetime"]) ]) - AS_IF( - [test "x$ac_cv_libfdatetime" != xyes && test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect && test "x$ac_cv_with_libfdatetime" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libfdatetime in directory: $ac_cv_with_libfdatetime], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libfdatetime]) ]) AS_IF( diff --git a/m4/libfguid.m4 b/m4/libfguid.m4 index 5e44bb63..d0b1eceb 100644 --- a/m4/libfguid.m4 +++ b/m4/libfguid.m4 @@ -1,6 +1,6 @@ dnl Checks for libfguid required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240519 dnl Function to detect if libfguid is available dnl ac_libfguid_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBFGUID_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect && test "x$ac_cv_with_libfguid" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libfguid"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libfguid}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfguid}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libfguid], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libfguid])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,76 +38,27 @@ AC_DEFUN([AX_LIBFGUID_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libfguid_h" = xno], [ac_cv_libfguid=no], - [dnl Check for the individual functions - ac_cv_libfguid=yes - - AC_CHECK_LIB( - fguid, - libfguid_get_version, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - - dnl Identifier functions - AC_CHECK_LIB( - fguid, - libfguid_identifier_initialize, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_free, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_copy_from_byte_stream, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_get_string_size, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_copy_to_utf8_string, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_copy_to_utf8_string_with_index, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_copy_to_utf16_string, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_copy_to_utf16_string_with_index, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_copy_to_utf32_string, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) - AC_CHECK_LIB( - fguid, - libfguid_identifier_copy_to_utf32_string_with_index, - [ac_cv_libfguid_dummy=yes], - [ac_cv_libfguid=no]) + [ac_cv_libfguid=yes + + AX_CHECK_LIB_FUNCTIONS( + [libfguid], + [fguid], + [[libfguid_get_version], + [libfguid_identifier_initialize], + [libfguid_identifier_free], + [libfguid_identifier_copy_from_byte_stream], + [libfguid_identifier_get_string_size], + [libfguid_identifier_copy_to_utf8_string], + [libfguid_identifier_copy_to_utf8_string_with_index], + [libfguid_identifier_copy_to_utf16_string], + [libfguid_identifier_copy_to_utf16_string_with_index], + [libfguid_identifier_copy_to_utf32_string], + [libfguid_identifier_copy_to_utf32_string_with_index]]) ac_cv_libfguid_LIBADD="-lfguid"]) ]) - AS_IF( - [test "x$ac_cv_libfguid" != xyes && test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect && test "x$ac_cv_with_libfguid" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libfguid in directory: $ac_cv_with_libfguid], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libfguid]) ]) AS_IF( diff --git a/m4/libfvalue.m4 b/m4/libfvalue.m4 index 2a79f7db..a71d0f73 100644 --- a/m4/libfvalue.m4 +++ b/m4/libfvalue.m4 @@ -1,6 +1,6 @@ dnl Checks for libfvalue required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240519 dnl Function to detect if libfvalue is available dnl ac_libfvalue_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBFVALUE_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect && test "x$ac_cv_with_libfvalue" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libfvalue"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libfvalue}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfvalue}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libfvalue], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libfvalue])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,558 +38,115 @@ AC_DEFUN([AX_LIBFVALUE_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libfvalue_h" = xno], [ac_cv_libfvalue=no], - [dnl Check for the individual functions - ac_cv_libfvalue=yes - - AC_CHECK_LIB( - fvalue, - libfvalue_get_version, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - dnl Data handle functions - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_initialize, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_free, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_clone, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_clear, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_get_data, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_set_data, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_get_data_flags, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_set_data_flags, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_get_number_of_value_entries, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_get_value_entry, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_set_value_entry, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_data_handle_append_value_entry, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - dnl Integer functions - AC_CHECK_LIB( - fvalue, - libfvalue_string_size_from_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_utf8_string_copy_from_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf8_string_with_index_copy_from_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf8_string_copy_to_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf8_string_with_index_copy_to_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_utf16_string_copy_from_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf16_string_with_index_copy_from_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf16_string_copy_to_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf16_string_with_index_copy_to_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_utf32_string_copy_from_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf32_string_with_index_copy_from_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf32_string_copy_to_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_utf32_string_with_index_copy_to_integer, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - dnl String functions - AC_CHECK_LIB( - fvalue, - libfvalue_utf8_string_split, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_utf16_string_split, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - dnl Split string functions - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf8_string_free, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf8_string_get_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf8_string_get_number_of_segments, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf8_string_get_segment_by_index, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf16_string_free, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf16_string_get_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf16_string_get_number_of_segments, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_split_utf16_string_get_segment_by_index, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - dnl Table functions - AC_CHECK_LIB( - fvalue, - libfvalue_table_initialize, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_table_free, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_table_resize, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_table_clone, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_table_get_number_of_values, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_table_get_index_by_identifier, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_table_get_value_by_index, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_table_get_value_by_identifier, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_table_set_value_by_index, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_table_set_value, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_table_copy_from_utf8_xml_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - dnl Value functions - AC_CHECK_LIB( - fvalue, - libfvalue_value_initialize, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_free, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_clone, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_clear, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_type, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) + [ac_cv_libfvalue=yes - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_identifier, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_set_identifier, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_data_handle, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_has_data, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_data_size, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_data, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_set_data, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_data, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_format_flags, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_set_format_flags, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_number_of_value_entries, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_value_entry, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_set_value_entry, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_append_value_entry, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_boolean, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_boolean, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_8bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_8bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_16bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_16bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_32bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_32bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_64bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_64bit, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_float, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_float, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_double, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_double, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_utf8_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_utf8_string_size, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_utf8_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_utf8_string_with_index, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_utf16_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_utf16_string_size, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_utf16_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_utf16_string_with_index, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_from_utf32_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_get_utf32_string_size, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_utf32_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_copy_to_utf32_string_with_index, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_read_from_file_stream, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_write_to_file_stream, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - dnl Value type functions - AC_CHECK_LIB( - fvalue, - libfvalue_value_type_initialize, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_type_initialize_with_data_handle, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_type_set_data_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - AC_CHECK_LIB( - fvalue, - libfvalue_value_type_append_data_string, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) - - AC_CHECK_LIB( - fvalue, - libfvalue_value_type_set_data_strings_array, - [ac_cv_libfvalue_dummy=yes], - [ac_cv_libfvalue=no]) + AX_CHECK_LIB_FUNCTIONS( + [libfvalue], + [fvalue], + [[libfvalue_get_version], + [libfvalue_data_handle_initialize], + [libfvalue_data_handle_free], + [libfvalue_data_handle_clone], + [libfvalue_data_handle_clear], + [libfvalue_data_handle_get_data], + [libfvalue_data_handle_set_data], + [libfvalue_data_handle_get_data_flags], + [libfvalue_data_handle_set_data_flags], + [libfvalue_data_handle_get_number_of_value_entries], + [libfvalue_data_handle_get_value_entry], + [libfvalue_data_handle_set_value_entry], + [libfvalue_data_handle_append_value_entry], + [libfvalue_string_size_from_integer], + [libfvalue_utf8_string_copy_from_integer], + [libfvalue_utf8_string_with_index_copy_from_integer], + [libfvalue_utf8_string_copy_to_integer], + [libfvalue_utf8_string_with_index_copy_to_integer], + [libfvalue_utf16_string_copy_from_integer], + [libfvalue_utf16_string_with_index_copy_from_integer], + [libfvalue_utf16_string_copy_to_integer], + [libfvalue_utf16_string_with_index_copy_to_integer], + [libfvalue_utf32_string_copy_from_integer], + [libfvalue_utf32_string_with_index_copy_from_integer], + [libfvalue_utf32_string_copy_to_integer], + [libfvalue_utf32_string_with_index_copy_to_integer], + [libfvalue_utf8_string_split], + [libfvalue_utf16_string_split], + [libfvalue_split_utf8_string_free], + [libfvalue_split_utf8_string_get_string], + [libfvalue_split_utf8_string_get_number_of_segments], + [libfvalue_split_utf8_string_get_segment_by_index], + [libfvalue_split_utf16_string_free], + [libfvalue_split_utf16_string_get_string], + [libfvalue_split_utf16_string_get_number_of_segments], + [libfvalue_split_utf16_string_get_segment_by_index], + [libfvalue_table_initialize], + [libfvalue_table_free], + [libfvalue_table_resize], + [libfvalue_table_clone], + [libfvalue_table_get_number_of_values], + [libfvalue_table_get_index_by_identifier], + [libfvalue_table_get_value_by_index], + [libfvalue_table_get_value_by_identifier], + [libfvalue_table_set_value_by_index], + [libfvalue_table_set_value], + [libfvalue_table_copy_from_utf8_xml_string], + [libfvalue_value_initialize], + [libfvalue_value_free], + [libfvalue_value_clone], + [libfvalue_value_clear], + [libfvalue_value_get_type], + [libfvalue_value_get_identifier], + [libfvalue_value_set_identifier], + [libfvalue_value_get_data_handle], + [libfvalue_value_has_data], + [libfvalue_value_get_data_size], + [libfvalue_value_get_data], + [libfvalue_value_set_data], + [libfvalue_value_copy_data], + [libfvalue_value_get_format_flags], + [libfvalue_value_set_format_flags], + [libfvalue_value_get_number_of_value_entries], + [libfvalue_value_get_value_entry], + [libfvalue_value_set_value_entry], + [libfvalue_value_append_value_entry], + [libfvalue_value_copy_from_boolean], + [libfvalue_value_copy_to_boolean], + [libfvalue_value_copy_from_8bit], + [libfvalue_value_copy_to_8bit], + [libfvalue_value_copy_from_16bit], + [libfvalue_value_copy_to_16bit], + [libfvalue_value_copy_from_32bit], + [libfvalue_value_copy_to_32bit], + [libfvalue_value_copy_from_64bit], + [libfvalue_value_copy_to_64bit], + [libfvalue_value_copy_from_float], + [libfvalue_value_copy_to_float], + [libfvalue_value_copy_from_double], + [libfvalue_value_copy_to_double], + [libfvalue_value_copy_from_utf8_string], + [libfvalue_value_get_utf8_string_size], + [libfvalue_value_copy_to_utf8_string], + [libfvalue_value_copy_to_utf8_string_with_index], + [libfvalue_value_copy_from_utf16_string], + [libfvalue_value_get_utf16_string_size], + [libfvalue_value_copy_to_utf16_string], + [libfvalue_value_copy_to_utf16_string_with_index], + [libfvalue_value_copy_from_utf32_string], + [libfvalue_value_get_utf32_string_size], + [libfvalue_value_copy_to_utf32_string], + [libfvalue_value_copy_to_utf32_string_with_index], + [libfvalue_value_read_from_file_stream], + [libfvalue_value_write_to_file_stream], + [libfvalue_value_type_initialize], + [libfvalue_value_type_initialize_with_data_handle], + [libfvalue_value_type_set_data_string], + [libfvalue_value_type_append_data_string], + [libfvalue_value_type_set_data_strings_array]]) ac_cv_libfvalue_LIBADD="-lfvalue"]) ]) - AS_IF( - [test "x$ac_cv_libfvalue" != xyes && test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect && test "x$ac_cv_with_libfvalue" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libfvalue in directory: $ac_cv_with_libfvalue], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libfvalue]) ]) AS_IF( diff --git a/m4/libhmac.m4 b/m4/libhmac.m4 index b902eb63..55f87fe2 100644 --- a/m4/libhmac.m4 +++ b/m4/libhmac.m4 @@ -1,6 +1,6 @@ dnl Checks for libhmac required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240520 dnl Function to detect if libhmac is available dnl ac_libhmac_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBHMAC_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect && test "x$ac_cv_with_libhmac" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libhmac"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libhmac}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libhmac}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libhmac], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libhmac])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,134 +38,37 @@ AC_DEFUN([AX_LIBHMAC_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libhmac_h" = xno], [ac_cv_libhmac=no], - [dnl Check for the individual functions - ac_cv_libhmac=yes - - AC_CHECK_LIB( - hmac, - libhmac_get_version, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - - dnl MD5 functions - AC_CHECK_LIB( - hmac, - libhmac_md5_initialize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_md5_update, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_md5_finalize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_md5_free, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - - dnl SHA1 functions - AC_CHECK_LIB( - hmac, - libhmac_sha1_initialize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha1_update, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha1_finalize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha1_free, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - - dnl SHA224 functions - AC_CHECK_LIB( - hmac, - libhmac_sha224_initialize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha224_update, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha224_finalize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha224_free, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) + [ac_cv_libhmac=yes - dnl SHA256 functions - AC_CHECK_LIB( - hmac, - libhmac_sha256_initialize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha256_update, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha256_finalize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha256_free, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - - dnl SHA512 functions - AC_CHECK_LIB( - hmac, - libhmac_sha512_initialize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha512_update, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha512_finalize, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) - AC_CHECK_LIB( - hmac, - libhmac_sha512_free, - [ac_cv_libhmac_dummy=yes], - [ac_cv_libhmac=no]) + AX_CHECK_LIB_FUNCTIONS( + [libhmac], + [hmac], + [[libhmac_get_version], + [libhmac_md5_initialize], + [libhmac_md5_update], + [libhmac_md5_finalize], + [libhmac_md5_free], + [libhmac_sha1_initialize], + [libhmac_sha1_update], + [libhmac_sha1_finalize], + [libhmac_sha1_free], + [libhmac_sha224_initialize], + [libhmac_sha224_update], + [libhmac_sha224_finalize], + [libhmac_sha224_free], + [libhmac_sha256_initialize], + [libhmac_sha256_update], + [libhmac_sha256_finalize], + [libhmac_sha256_free], + [libhmac_sha512_initialize], + [libhmac_sha512_update], + [libhmac_sha512_finalize], + [libhmac_sha512_free]]) ac_cv_libhmac_LIBADD="-lhmac"]) ]) - AS_IF( - [test "x$ac_cv_libhmac" != xyes && test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect && test "x$ac_cv_with_libhmac" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libhmac in directory: $ac_cv_with_libhmac], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libhmac]) ]) AS_IF( diff --git a/m4/libodraw.m4 b/m4/libodraw.m4 index 1bf8d2f8..bf621ad2 100644 --- a/m4/libodraw.m4 +++ b/m4/libodraw.m4 @@ -1,6 +1,6 @@ dnl Checks for libodraw required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240520 dnl Function to detect if libodraw is available dnl ac_libodraw_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBODRAW_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libodraw" != x && test "x$ac_cv_with_libodraw" != xauto-detect && test "x$ac_cv_with_libodraw" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libodraw"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libodraw}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libodraw}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libodraw], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libodraw])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,137 +38,44 @@ AC_DEFUN([AX_LIBODRAW_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libodraw_h" = xno], [ac_cv_libodraw=no], - [dnl Check for the individual functions - ac_cv_libodraw=yes - - AC_CHECK_LIB( - odraw, - libodraw_get_version, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - - dnl Handle functions - AC_CHECK_LIB( - odraw, - libodraw_handle_initialize, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_free, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_signal_abort, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_open, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_open_data_files, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_close, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_read_buffer, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_seek_offset, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - - AS_IF( - [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - odraw, - libodraw_handle_open_wide, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - ]) - - AC_CHECK_LIB( - odraw, - libodraw_handle_get_bytes_per_sector, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_get_data_file, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_get_media_size, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_get_number_of_data_files, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_get_number_of_sessions, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_get_session, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_get_number_of_tracks, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_handle_get_track, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) + [ac_cv_libodraw=yes - dnl Data file functions - AC_CHECK_LIB( - odraw, - libodraw_data_file_free, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - AC_CHECK_LIB( - odraw, - libodraw_data_file_set_filename, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - - AS_IF( - [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - odraw, - libodraw_data_file_set_filename_wide, - [ac_cv_libodraw_dummy=yes], - [ac_cv_libodraw=no]) - ]) + AX_CHECK_LIB_FUNCTIONS( + [libodraw], + [odraw], + [[libodraw_get_version], + [libodraw_handle_initialize], + [libodraw_handle_free], + [libodraw_handle_signal_abort], + [libodraw_handle_open], + [libodraw_handle_open_data_files], + [libodraw_handle_close], + [libodraw_handle_read_buffer], + [libodraw_handle_seek_offset], + [libodraw_handle_get_bytes_per_sector], + [libodraw_handle_get_data_file], + [libodraw_handle_get_media_size], + [libodraw_handle_get_number_of_data_files], + [libodraw_handle_get_number_of_sessions], + [libodraw_handle_get_session], + [libodraw_handle_get_number_of_tracks], + [libodraw_handle_get_track], + [libodraw_data_file_free], + [libodraw_data_file_set_filename]]) + + AS_IF( + [test "x$ac_cv_enable_wide_character_type" != xno], + [AX_CHECK_LIB_FUNCTIONS( + [libodraw], + [odraw], + [[libodraw_handle_open_wide], + [libodraw_data_file_set_filename_wide]]) + ]) ac_cv_libodraw_LIBADD="-lodraw"]) ]) - AS_IF( - [test "x$ac_cv_libodraw" != xyes && test "x$ac_cv_with_libodraw" != x && test "x$ac_cv_with_libodraw" != xauto-detect && test "x$ac_cv_with_libodraw" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libodraw in directory: $ac_cv_with_libodraw], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libodraw]) ]) AS_IF( diff --git a/m4/libsmdev.m4 b/m4/libsmdev.m4 index 462aa64c..0847bc42 100644 --- a/m4/libsmdev.m4 +++ b/m4/libsmdev.m4 @@ -1,6 +1,6 @@ dnl Checks for libsmdev required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240520 dnl Function to detect if libsmdev is available dnl ac_libsmdev_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBSMDEV_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libsmdev" != x && test "x$ac_cv_with_libsmdev" != xauto-detect && test "x$ac_cv_with_libsmdev" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libsmdev"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libsmdev}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libsmdev}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libsmdev], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libsmdev])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,163 +38,49 @@ AC_DEFUN([AX_LIBSMDEV_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libsmdev_h" = xno], [ac_cv_libsmdev=no], - [dnl Check for the individual functions - ac_cv_libsmdev=yes - - AC_CHECK_LIB( - smdev, - libsmdev_get_version, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - - AC_CHECK_LIB( - smdev, - libsmdev_check_device, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - - AS_IF( - [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - smdev, - libsmdev_check_device_wide, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - ]) - - dnl Handle functions - AC_CHECK_LIB( - smdev, - libsmdev_handle_initialize, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_free, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_signal_abort, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - - AC_CHECK_LIB( - smdev, - libsmdev_handle_open, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_close, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_read_buffer, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_seek_offset, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) + [ac_cv_libsmdev=yes + + AX_CHECK_LIB_FUNCTIONS( + [libsmdev], + [smdev], + [[libsmdev_get_version], + [libsmdev_check_device], + [libsmdev_handle_initialize], + [libsmdev_handle_free], + [libsmdev_handle_signal_abort], + [libsmdev_handle_open], + [libsmdev_handle_close], + [libsmdev_handle_read_buffer], + [libsmdev_handle_seek_offset], + [libsmdev_handle_get_bus_type], + [libsmdev_handle_get_bytes_per_sector], + [libsmdev_handle_get_error], + [libsmdev_handle_get_utf8_information_value], + [libsmdev_handle_get_utf16_information_value], + [libsmdev_handle_get_media_size], + [libsmdev_handle_get_media_type], + [libsmdev_handle_get_number_of_errors], + [libsmdev_handle_get_number_of_sessions], + [libsmdev_handle_get_session], + [libsmdev_handle_get_number_of_tracks], + [libsmdev_handle_get_track], + [libsmdev_handle_set_error_flags], + [libsmdev_handle_set_error_granularity], + [libsmdev_handle_set_number_of_error_retries]]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_LIB( - smdev, - libsmdev_handle_open_wide, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) + [AX_CHECK_LIB_FUNCTIONS( + [libsmdev], + [smdev], + [[libsmdev_check_device_wide], + [libsmdev_handle_open_wide]]) ]) - - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_bus_type, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_bytes_per_sector, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_error, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_utf8_information_value, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_utf16_information_value, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_media_size, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_media_type, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_number_of_errors, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_number_of_sessions, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_session, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_number_of_tracks, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_get_track, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - - AC_CHECK_LIB( - smdev, - libsmdev_handle_set_error_flags, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_set_error_granularity, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) - AC_CHECK_LIB( - smdev, - libsmdev_handle_set_number_of_error_retries, - [ac_cv_libsmdev_dummy=yes], - [ac_cv_libsmdev=no]) ac_cv_libsmdev_LIBADD="-lsmdev"]) ]) - AS_IF( - [test "x$ac_cv_libsmdev" != xyes && test "x$ac_cv_with_libsmdev" != x && test "x$ac_cv_with_libsmdev" != xauto-detect && test "x$ac_cv_with_libsmdev" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libsmdev in directory: $ac_cv_with_libsmdev], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libsmdev]) ]) AS_IF( diff --git a/m4/libsmraw.m4 b/m4/libsmraw.m4 index 66e65d1e..8171d0e0 100644 --- a/m4/libsmraw.m4 +++ b/m4/libsmraw.m4 @@ -1,6 +1,6 @@ dnl Checks for libsmraw required headers and functions dnl -dnl Version: 20240413 +dnl Version: 20240520 dnl Function to detect if libsmraw is available dnl ac_libsmraw_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -14,15 +14,7 @@ AC_DEFUN([AX_LIBSMRAW_CHECK_LOCAL], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libsmraw" != x && test "x$ac_cv_with_libsmraw" != xauto-detect && test "x$ac_cv_with_libsmraw" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libsmraw"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libsmraw}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libsmraw}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libsmraw], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libsmraw])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -46,56 +38,28 @@ AC_DEFUN([AX_LIBSMRAW_CHECK_LOCAL], AS_IF( [test "x$ac_cv_header_libsmraw_h" = xno], [ac_cv_libsmraw=no], - [dnl Check for the individual functions - ac_cv_libsmraw=yes - - AC_CHECK_LIB( - smraw, - libsmraw_get_version, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - - dnl Handle functions - AC_CHECK_LIB( - smraw, - libsmraw_handle_initialize, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_free, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_signal_abort, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_open, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_close, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_read_buffer, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_seek_offset, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_write_buffer, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) + [ac_cv_libsmraw=yes + + AX_CHECK_LIB_FUNCTIONS( + [libsmraw], + [smraw], + [[libsmraw_get_version], + [libsmraw_handle_initialize], + [libsmraw_handle_free], + [libsmraw_handle_signal_abort], + [libsmraw_handle_open], + [libsmraw_handle_close], + [libsmraw_handle_read_buffer], + [libsmraw_handle_seek_offset], + [libsmraw_handle_write_buffer], + [libsmraw_handle_get_media_size], + [libsmraw_handle_get_bytes_per_sector], + [libsmraw_handle_get_utf8_information_value], + [libsmraw_handle_get_utf16_information_value], + [libsmraw_handle_set_maximum_segment_size], + [libsmraw_handle_set_media_size], + [libsmraw_handle_set_utf8_integrity_hash_value], + [libsmraw_handle_set_utf16_integrity_hash_value]]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], @@ -106,57 +70,10 @@ AC_DEFUN([AX_LIBSMRAW_CHECK_LOCAL], [ac_cv_libsmraw=no]) ]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_get_media_size, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_get_bytes_per_sector, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_get_utf8_information_value - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_get_utf16_information_value - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - - AC_CHECK_LIB( - smraw, - libsmraw_handle_set_maximum_segment_size, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_set_media_size, - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_set_utf8_integrity_hash_value - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - AC_CHECK_LIB( - smraw, - libsmraw_handle_set_utf16_integrity_hash_value - [ac_cv_libsmraw_dummy=yes], - [ac_cv_libsmraw=no]) - ac_cv_libsmraw_LIBADD="-lsmraw"]) ]) - AS_IF( - [test "x$ac_cv_libsmraw" != xyes && test "x$ac_cv_with_libsmraw" != x && test "x$ac_cv_with_libsmraw" != xauto-detect && test "x$ac_cv_with_libsmraw" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libsmraw in directory: $ac_cv_with_libsmraw], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libsmraw]) ]) AS_IF( diff --git a/m4/libuna.m4 b/m4/libuna.m4 index 996ac60d..fe1fd402 100644 --- a/m4/libuna.m4 +++ b/m4/libuna.m4 @@ -1,23 +1,6 @@ dnl Checks for libuna or required headers and functions dnl -dnl Version: 20240413 - -dnl Function to detect if a specific libuna definition is available. -AC_DEFUN([AX_LIBUNA_CHECK_DEFINITION], - [AC_CACHE_CHECK( - [if `$1' is defined], - [$2], - [AC_LANG_PUSH(C) - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[int test = $1; - -return( 0 ); ]] )], - [$2=yes], - [$2=no]) - AC_LANG_POP(C)]) - ]) +dnl Version: 20240513 dnl Function to detect if libuna is available dnl ac_libuna_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -31,15 +14,7 @@ AC_DEFUN([AX_LIBUNA_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_with_libuna" != xyes], - [AS_IF( - [test -d "$ac_cv_with_libuna"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libuna}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libuna}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libuna], - [1]) - ]) - ], + [AX_CHECK_LIB_DIRECTORY_EXISTS([libuna])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], @@ -63,894 +38,186 @@ AC_DEFUN([AX_LIBUNA_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libuna_h" = xno], [ac_cv_libuna=no], - [dnl Check for the individual functions - ac_cv_libuna=yes - - AC_CHECK_LIB( - una, - libuna_get_version, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl Base16 stream functions - AC_CHECK_LIB( - una, - libuna_base16_stream_size_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base16_stream_copy_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base16_stream_size_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base16_stream_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base16_stream_with_index_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl Base32 stream functions - AC_CHECK_LIB( - una, - libuna_base32_quintuplet_copy_from_base32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base32_quintuplet_copy_to_base32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base32_quintuplet_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base32_quintuplet_copy_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - AC_CHECK_LIB( - una, - libuna_base32_stream_size_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base32_stream_copy_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base32_stream_size_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base32_stream_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base32_stream_with_index_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl Base64 stream functions - AC_CHECK_LIB( - una, - libuna_base64_triplet_copy_from_base64_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base64_triplet_copy_to_base64_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base64_triplet_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base64_triplet_copy_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - AC_CHECK_LIB( - una, - libuna_base64_stream_size_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base64_stream_copy_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base64_stream_size_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base64_stream_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_base64_stream_with_index_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl Byte stream functions - AC_CHECK_LIB( - una, - libuna_byte_stream_size_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_byte_stream_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_byte_stream_size_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_byte_stream_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_byte_stream_size_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_byte_stream_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl Unicode character functions - AC_CHECK_LIB( - una, - libuna_unicode_character_size_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_size_to_ucs2, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_ucs2, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_ucs2, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_size_to_ucs4, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_ucs4, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_ucs4, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_size_to_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_size_to_utf8_rfc2279, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_utf8_rfc2279, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_utf8_rfc2279, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_size_to_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_unicode_character_copy_to_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl UTF-8 stream functions - AC_CHECK_LIB( - una, - libuna_utf8_stream_size_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_stream_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_stream_size_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_stream_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_stream_size_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_stream_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) + [ac_cv_libuna=yes - dnl UTF-16 stream functions - AC_CHECK_LIB( - una, - libuna_utf16_stream_size_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_stream_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_stream_size_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_stream_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_stream_size_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_stream_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl UTF-32 stream functions - AC_CHECK_LIB( - una, - libuna_utf32_stream_size_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_stream_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_stream_size_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_stream_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_stream_size_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_stream_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl UTF-8 string functions - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_compare_with_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_compare_with_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_compare_with_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_compare_with_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_compare_with_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_compare_with_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_compare_with_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_size_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_copy_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf8_string_with_index_copy_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl UTF-16 string functions - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_compare_with_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_compare_with_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - dnl libuna_utf16_string_compare_with_utf8 is implemented by libuna_utf8_string_compare_with_utf16 - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_compare_with_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_compare_with_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_compare_with_utf32, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_compare_with_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_size_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_copy_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf16_string_with_index_copy_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl UTF-32 string functions - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_with_index_copy_from_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_compare_with_byte_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_with_index_copy_from_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_compare_with_utf7_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - libuna_utf32_string_with_index_copy_from_utf8, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - dnl libuna_utf32_string_compare_with_utf8 is implemented by libuna_utf8_string_compare_with_utf32 - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_with_index_copy_from_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_compare_with_utf8_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_with_index_copy_from_utf16, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - dnl libuna_utf32_string_compare_with_utf16 is implemented by libuna_utf16_string_compare_with_utf32 - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_with_index_copy_from_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_compare_with_utf16_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_with_index_copy_from_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_compare_with_utf32_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_size_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_copy_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - AC_CHECK_LIB( - una, - libuna_utf32_string_with_index_copy_from_scsu_stream, - [ac_cv_libuna_dummy=yes], - [ac_cv_libuna=no]) - - dnl Check for definitions - AX_LIBUNA_CHECK_DEFINITION( - LIBUNA_COMPARE_LESS, - [ac_cv_libuna_defines_compare_less]) - AS_IF( - [test "x$ac_cv_libuna_defines_compare_less" != xyes], - [ac_cv_libuna=no]) - - AX_LIBUNA_CHECK_DEFINITION( - LIBUNA_COMPARE_EQUAL, - [ac_cv_libuna_defines_compare_equal]) - AS_IF( - [test "x$ac_cv_libuna_defines_compare_less" != xyes], - [ac_cv_libuna=no]) - - AX_LIBUNA_CHECK_DEFINITION( - LIBUNA_COMPARE_GREATER, - [ac_cv_libuna_defines_compare_greater]) - AS_IF( - [test "x$ac_cv_libuna_defines_compare_less" != xyes], - [ac_cv_libuna=no]) - - AX_LIBUNA_CHECK_DEFINITION( - LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE, - [ac_cv_libuna_defines_compare_greater]) - AS_IF( - [test "x$ac_cv_libuna_defines_utf16_stream_allow_unpaired_surrogate" != xyes], - [ac_cv_libuna=no]) + AX_CHECK_LIB_FUNCTIONS( + [libuna], + [una], + [[libuna_get_version], + [libuna_base16_stream_size_to_byte_stream], + [libuna_base16_stream_copy_to_byte_stream], + [libuna_base16_stream_size_from_byte_stream], + [libuna_base16_stream_copy_from_byte_stream], + [libuna_base16_stream_with_index_copy_from_byte_stream], + [libuna_base32_quintuplet_copy_from_base32_stream], + [libuna_base32_quintuplet_copy_to_base32_stream], + [libuna_base32_quintuplet_copy_from_byte_stream], + [libuna_base32_quintuplet_copy_to_byte_stream], + [libuna_base32_stream_size_to_byte_stream], + [libuna_base32_stream_copy_to_byte_stream], + [libuna_base32_stream_size_from_byte_stream], + [libuna_base32_stream_copy_from_byte_stream], + [libuna_base32_stream_with_index_copy_from_byte_stream], + [libuna_base64_triplet_copy_from_base64_stream], + [libuna_base64_triplet_copy_to_base64_stream], + [libuna_base64_triplet_copy_from_byte_stream], + [libuna_base64_triplet_copy_to_byte_stream], + [libuna_base64_stream_size_to_byte_stream], + [libuna_base64_stream_copy_to_byte_stream], + [libuna_base64_stream_size_from_byte_stream], + [libuna_base64_stream_copy_from_byte_stream], + [libuna_base64_stream_with_index_copy_from_byte_stream], + [libuna_byte_stream_size_from_utf8], + [libuna_byte_stream_copy_from_utf8], + [libuna_byte_stream_size_from_utf16], + [libuna_byte_stream_copy_from_utf16], + [libuna_byte_stream_size_from_utf32], + [libuna_byte_stream_copy_from_utf32], + [libuna_unicode_character_size_to_byte_stream], + [libuna_unicode_character_copy_from_byte_stream], + [libuna_unicode_character_copy_to_byte_stream], + [libuna_unicode_character_size_to_ucs2], + [libuna_unicode_character_copy_from_ucs2], + [libuna_unicode_character_copy_to_ucs2], + [libuna_unicode_character_size_to_ucs4], + [libuna_unicode_character_copy_from_ucs4], + [libuna_unicode_character_copy_to_ucs4], + [libuna_unicode_character_copy_from_utf7_stream], + [libuna_unicode_character_copy_to_utf7_stream], + [libuna_unicode_character_size_to_utf8], + [libuna_unicode_character_copy_from_utf8], + [libuna_unicode_character_copy_to_utf8], + [libuna_unicode_character_size_to_utf8_rfc2279], + [libuna_unicode_character_copy_from_utf8_rfc2279], + [libuna_unicode_character_copy_to_utf8_rfc2279], + [libuna_unicode_character_size_to_utf16], + [libuna_unicode_character_copy_from_utf16], + [libuna_unicode_character_copy_to_utf16], + [libuna_unicode_character_copy_from_utf16_stream], + [libuna_unicode_character_copy_to_utf16_stream], + [libuna_unicode_character_copy_from_utf32], + [libuna_unicode_character_copy_to_utf32], + [libuna_unicode_character_copy_from_utf32_stream], + [libuna_unicode_character_copy_to_utf32_stream], + [libuna_utf8_stream_size_from_utf8], + [libuna_utf8_stream_copy_from_utf8], + [libuna_utf8_stream_size_from_utf16], + [libuna_utf8_stream_copy_from_utf16], + [libuna_utf8_stream_size_from_utf32], + [libuna_utf8_stream_copy_from_utf32], + [libuna_utf16_stream_size_from_utf8], + [libuna_utf16_stream_copy_from_utf8], + [libuna_utf16_stream_size_from_utf16], + [libuna_utf16_stream_copy_from_utf16], + [libuna_utf16_stream_size_from_utf32], + [libuna_utf16_stream_copy_from_utf32], + [libuna_utf32_stream_size_from_utf8], + [libuna_utf32_stream_copy_from_utf8], + [libuna_utf32_stream_size_from_utf16], + [libuna_utf32_stream_copy_from_utf16], + [libuna_utf32_stream_size_from_utf32], + [libuna_utf32_stream_copy_from_utf32], + [libuna_utf8_string_size_from_byte_stream], + [libuna_utf8_string_copy_from_byte_stream], + [libuna_utf8_string_with_index_copy_from_byte_stream], + [libuna_utf8_string_compare_with_byte_stream], + [libuna_utf8_string_size_from_utf7_stream], + [libuna_utf8_string_copy_from_utf7_stream], + [libuna_utf8_string_with_index_copy_from_utf7_stream], + [libuna_utf8_string_compare_with_utf7_stream], + [libuna_utf8_string_size_from_utf8_stream], + [libuna_utf8_string_copy_from_utf8_stream], + [libuna_utf8_string_with_index_copy_from_utf8_stream], + [libuna_utf8_string_compare_with_utf8_stream], + [libuna_utf8_string_size_from_utf16], + [libuna_utf8_string_copy_from_utf16], + [libuna_utf8_string_with_index_copy_from_utf16], + [libuna_utf8_string_compare_with_utf16], + [libuna_utf8_string_size_from_utf16_stream], + [libuna_utf8_string_copy_from_utf16_stream], + [libuna_utf8_string_with_index_copy_from_utf16_stream], + [libuna_utf8_string_compare_with_utf16_stream], + [libuna_utf8_string_size_from_utf32], + [libuna_utf8_string_copy_from_utf32], + [libuna_utf8_string_with_index_copy_from_utf32], + [libuna_utf8_string_compare_with_utf32], + [libuna_utf8_string_size_from_utf32_stream], + [libuna_utf8_string_copy_from_utf32_stream], + [libuna_utf8_string_with_index_copy_from_utf32_stream], + [libuna_utf8_string_compare_with_utf32_stream], + [libuna_utf8_string_size_from_scsu_stream], + [libuna_utf8_string_copy_from_scsu_stream], + [libuna_utf8_string_with_index_copy_from_scsu_stream], + [libuna_utf16_string_size_from_byte_stream], + [libuna_utf16_string_copy_from_byte_stream], + [libuna_utf16_string_with_index_copy_from_byte_stream], + [libuna_utf16_string_compare_with_byte_stream], + [libuna_utf16_string_size_from_utf7_stream], + [libuna_utf16_string_copy_from_utf7_stream], + [libuna_utf16_string_with_index_copy_from_utf7_stream], + [libuna_utf16_string_compare_with_utf7_stream], + [libuna_utf16_string_size_from_utf8], + [libuna_utf16_string_copy_from_utf8], + [libuna_utf16_string_with_index_copy_from_utf8], + [libuna_utf16_string_size_from_utf8_stream], + [libuna_utf16_string_copy_from_utf8_stream], + [libuna_utf16_string_with_index_copy_from_utf8_stream], + [libuna_utf16_string_compare_with_utf8_stream], + [libuna_utf16_string_size_from_utf16_stream], + [libuna_utf16_string_copy_from_utf16_stream], + [libuna_utf16_string_with_index_copy_from_utf16_stream], + [libuna_utf16_string_compare_with_utf16_stream], + [libuna_utf16_string_size_from_utf32], + [libuna_utf16_string_copy_from_utf32], + [libuna_utf16_string_with_index_copy_from_utf32], + [libuna_utf16_string_compare_with_utf32], + [libuna_utf16_string_size_from_utf32_stream], + [libuna_utf16_string_copy_from_utf32_stream], + [libuna_utf16_string_with_index_copy_from_utf32_stream], + [libuna_utf16_string_compare_with_utf32_stream], + [libuna_utf16_string_size_from_scsu_stream], + [libuna_utf16_string_copy_from_scsu_stream], + [libuna_utf16_string_with_index_copy_from_scsu_stream], + [libuna_utf32_string_size_from_byte_stream], + [libuna_utf32_string_copy_from_byte_stream], + [libuna_utf32_string_with_index_copy_from_byte_stream], + [libuna_utf32_string_compare_with_byte_stream], + [libuna_utf32_string_size_from_utf7_stream], + [libuna_utf32_string_copy_from_utf7_stream], + [libuna_utf32_string_with_index_copy_from_utf7_stream], + [libuna_utf32_string_compare_with_utf7_stream], + [libuna_utf32_string_size_from_utf8_stream], + [libuna_utf32_string_size_from_utf8], + [libuna_utf32_string_copy_from_utf8], + [libuna_utf32_string_copy_from_utf8_stream], + [libuna_utf32_string_with_index_copy_from_utf8_stream], + [libuna_utf32_string_compare_with_utf8_stream], + [libuna_utf32_string_size_from_utf16], + [libuna_utf32_string_copy_from_utf16], + [libuna_utf32_string_with_index_copy_from_utf16], + [libuna_utf32_string_size_from_utf16_stream], + [libuna_utf32_string_copy_from_utf16_stream], + [libuna_utf32_string_with_index_copy_from_utf16_stream], + [libuna_utf32_string_compare_with_utf16_stream], + [libuna_utf32_string_size_from_utf32_stream], + [libuna_utf32_string_copy_from_utf32_stream], + [libuna_utf32_string_with_index_copy_from_utf32_stream], + [libuna_utf32_string_compare_with_utf32_stream], + [libuna_utf32_string_size_from_scsu_stream], + [libuna_utf32_string_copy_from_scsu_stream], + [libuna_utf32_string_with_index_copy_from_scsu_stream]]) + + AX_CHECK_LIB_DEFINITIONS( + [libuna], + [[LIBUNA_COMPARE_LESS], + [LIBUNA_COMPARE_EQUAL], + [LIBUNA_COMPARE_GREATER], + [LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE]]) ac_cv_libuna_LIBADD="-luna"]) ]) - AS_IF( - [test "x$ac_cv_libuna" != xyes && test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_with_libuna" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libuna in directory: $ac_cv_with_libuna], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([libuna]) ]) AS_IF( diff --git a/m4/pthread.m4 b/m4/pthread.m4 index e4fed145..830fb5f4 100644 --- a/m4/pthread.m4 +++ b/m4/pthread.m4 @@ -1,6 +1,6 @@ dnl Functions for pthread dnl -dnl Version: 20240308 +dnl Version: 20240513 dnl Function to detect if pthread is available AC_DEFUN([AX_PTHREAD_CHECK_LIB], @@ -13,13 +13,7 @@ AC_DEFUN([AX_PTHREAD_CHECK_LIB], dnl treat them as auto-detection. AS_IF( [test "x$ac_cv_with_pthread" != x && test "x$ac_cv_with_pthread" != xauto-detect && test "x$ac_cv_with_pthread" != xyes], - [AS_IF( - [test -d "$ac_cv_with_pthread"], - [CFLAGS="$CFLAGS -I${ac_cv_with_pthread}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_pthread}/lib"], - [AC_MSG_WARN([no such directory: $ac_cv_with_pthread]) - ]) - ]) + [AX_CHECK_LIB_DIRECTORY_EXISTS([pthread])]) ]) AS_IF( @@ -30,116 +24,34 @@ AC_DEFUN([AX_PTHREAD_CHECK_LIB], AS_IF( [test "x$ac_cv_header_pthread_h" = xno], [ac_cv_pthread=no], - [dnl Check for the individual functions - ac_cv_pthread=pthread - - dnl Thread functions - AC_CHECK_LIB( - pthread, - pthread_create, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_exit, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_join, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - - dnl Condition functions - AC_CHECK_LIB( - pthread, - pthread_cond_init, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_cond_destroy, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_cond_broadcast, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_cond_signal, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_cond_wait, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - - dnl Mutex functions - AC_CHECK_LIB( - pthread, - pthread_mutex_init, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_mutex_destroy, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_mutex_lock, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_mutex_trylock, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_mutex_unlock, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - - dnl Read/Write lock functions - AC_CHECK_LIB( - pthread, - pthread_rwlock_init, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_rwlock_destroy, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_rwlock_rdlock, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_rwlock_wrlock, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - AC_CHECK_LIB( - pthread, - pthread_rwlock_unlock, - [ac_pthread_dummy=yes], - [ac_cv_pthread=no]) - - ac_cv_pthread_LIBADD="-lpthread"; + [ac_cv_pthread=yes + + AX_CHECK_LIB_FUNCTIONS( + [pthread], + [pthread], + [[pthread_create], + [pthread_exit], + [pthread_join], + [pthread_cond_init], + [pthread_cond_destroy], + [pthread_cond_broadcast], + [pthread_cond_signal], + [pthread_cond_wait], + [pthread_mutex_init], + [pthread_mutex_destroy], + [pthread_mutex_lock], + [pthread_mutex_trylock], + [pthread_mutex_unlock], + [pthread_rwlock_init], + [pthread_rwlock_destroy], + [pthread_rwlock_rdlock], + [pthread_rwlock_wrlock], + [pthread_rwlock_unlock]]) + + ac_cv_pthread_LIBADD="-lpthread" ]) - AS_IF( - [test "x$ac_cv_with_pthread" != x && test "x$ac_cv_with_pthread" != xauto-detect && test "x$ac_cv_with_pthread" != xyes], - [AC_MSG_FAILURE( - [unable to find supported pthread in directory: $ac_cv_with_pthread], - [1]) - ]) + AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([pthread]) ]) AS_IF( diff --git a/tests/Makefile.am b/tests/Makefile.am index c15d9084..e038c3e5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1320,6 +1320,7 @@ ewf_test_tools_log_handle_LDADD = \ ewf_test_tools_mount_path_string_SOURCES = \ ../ewftools/mount_path_string.c ../ewftools/mount_path_string.h \ ewf_test_libcerror.h \ + ewf_test_libcpath.h \ ewf_test_macros.h \ ewf_test_tools_mount_path_string.c \ ewf_test_unused.h diff --git a/tests/ewf_test_chunk_data.c b/tests/ewf_test_chunk_data.c index 7af6cf22..d5afc87b 100644 --- a/tests/ewf_test_chunk_data.c +++ b/tests/ewf_test_chunk_data.c @@ -1130,10 +1130,12 @@ int ewf_test_chunk_data_pack_determine_pack_flags( int ewf_test_chunk_data_pack_with_64_bit_pattern_fill( void ) { - libcerror_error_t *error = NULL; - libewf_chunk_data_t *chunk_data = NULL; - uint8_t *data = NULL; - int result = 0; + uint8_t expected_compressed_data1[ 8 ] = { 1, 2, 3, 4, 5, 6, 7, 8 }; + libcerror_error_t *error = NULL; + libewf_chunk_data_t *chunk_data = NULL; + uint8_t *data = NULL; + size_t data_offset = 0; + int result = 0; /* Initialize test */ @@ -1158,6 +1160,12 @@ int ewf_test_chunk_data_pack_with_64_bit_pattern_fill( chunk_data->data_size = 512; + for( data_offset = 0; + data_offset < 512; + data_offset++ ) + { + chunk_data->data[ data_offset ] = 1 + ( data_offset % 8 ); + } /* Test regular cases */ result = libewf_chunk_data_pack_with_64_bit_pattern_fill( @@ -1182,6 +1190,16 @@ int ewf_test_chunk_data_pack_with_64_bit_pattern_fill( chunk_data->compressed_data_size, (size_t) 8 ); + result = memory_compare( + expected_compressed_data1, + chunk_data->compressed_data, + chunk_data->compressed_data_size ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + /* Clean up */ result = libewf_chunk_data_free( @@ -1379,6 +1397,215 @@ int ewf_test_chunk_data_pack_with_64_bit_pattern_fill( return( 0 ); } +/* Tests the libewf_chunk_data_unpack_with_64_bit_pattern_fill function + * Returns 1 if successful or 0 if not + */ +int ewf_test_chunk_data_unpack_with_64_bit_pattern_fill( + void ) +{ + uint8_t expected_data1[ 8 ] = { 1, 2, 3, 4, 5, 6, 7, 8 }; + libcerror_error_t *error = NULL; + libewf_chunk_data_t *chunk_data = NULL; + uint8_t *data = NULL; + int result = 0; + + /* Initialize test + */ + result = libewf_chunk_data_initialize( + &chunk_data, + 519, + 1, + &error ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + EWF_TEST_ASSERT_IS_NOT_NULL( + "chunk_data", + chunk_data ); + + EWF_TEST_ASSERT_IS_NULL( + "error", + error ); + + chunk_data->compressed_data = (uint8_t *) memory_allocate( + sizeof( uint8_t ) * 8 ); + + EWF_TEST_ASSERT_IS_NOT_NULL( + "chunk_data->compressed_data", + chunk_data->compressed_data ); + + chunk_data->compressed_data[ 0 ] = 1; + chunk_data->compressed_data[ 1 ] = 2; + chunk_data->compressed_data[ 2 ] = 3; + chunk_data->compressed_data[ 3 ] = 4; + chunk_data->compressed_data[ 4 ] = 5; + chunk_data->compressed_data[ 5 ] = 6; + chunk_data->compressed_data[ 6 ] = 7; + chunk_data->compressed_data[ 7 ] = 8; + + chunk_data->compressed_data_size = 8; + + /* Test regular cases + */ + result = libewf_chunk_data_unpack_with_64_bit_pattern_fill( + chunk_data, + &error ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + EWF_TEST_ASSERT_IS_NULL( + "error", + error ); + + EWF_TEST_ASSERT_EQUAL_SIZE( + "chunk_data->data_size", + chunk_data->data_size, + (size_t) 519 ); + + result = memory_compare( + expected_data1, + chunk_data->data, + 8 ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + result = memory_compare( + expected_data1, + &( chunk_data->data[ 512 ] ), + 7 ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + /* Clean up + */ + result = libewf_chunk_data_free( + &chunk_data, + &error ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + EWF_TEST_ASSERT_IS_NULL( + "chunk_data", + chunk_data ); + + EWF_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Initialize test + */ + result = libewf_chunk_data_initialize( + &chunk_data, + 512, + 1, + &error ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + EWF_TEST_ASSERT_IS_NOT_NULL( + "chunk_data", + chunk_data ); + + EWF_TEST_ASSERT_IS_NULL( + "error", + error ); + + chunk_data->data_size = 512; + + /* Test error cases + */ + result = libewf_chunk_data_unpack_with_64_bit_pattern_fill( + NULL, + &error ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + EWF_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + data = chunk_data->data; + + chunk_data->data = NULL; + + result = libewf_chunk_data_unpack_with_64_bit_pattern_fill( + chunk_data, + &error ); + + chunk_data->data = data; + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + EWF_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Clean up + */ + result = libewf_chunk_data_free( + &chunk_data, + &error ); + + EWF_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + EWF_TEST_ASSERT_IS_NULL( + "chunk_data", + chunk_data ); + + EWF_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( chunk_data != NULL ) + { + libewf_chunk_data_free( + &chunk_data, + NULL ); + } + return( 0 ); +} + /* Tests the libewf_chunk_data_pack_with_empty_block_compression function * Returns 1 if successful or 0 if not */ @@ -5015,6 +5242,10 @@ int main( "libewf_chunk_data_pack_with_64_bit_pattern_fill", ewf_test_chunk_data_pack_with_64_bit_pattern_fill ); + EWF_TEST_RUN( + "libewf_chunk_data_unpack_with_64_bit_pattern_fill", + ewf_test_chunk_data_unpack_with_64_bit_pattern_fill ); + EWF_TEST_RUN( "libewf_chunk_data_pack_with_empty_block_compression", ewf_test_chunk_data_pack_with_empty_block_compression );