From 176c368d31c5e523968a15ec37518368662ecfef Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Wed, 11 Sep 2024 06:06:59 +0200 Subject: [PATCH] Applied updates --- configure.ac | 2 +- m4/common.m4 | 39 +++++++++++++++++++++++++++++++++++---- m4/libcerror.m4 | 6 ++++-- m4/pthread.m4 | 6 ++++-- 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 9666fa3..0b30b74 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libcthreads], - [20240511], + [20240911], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/m4/common.m4 b/m4/common.m4 index b14eef5..c2ea816 100644 --- a/m4/common.m4 +++ b/m4/common.m4 @@ -1,6 +1,6 @@ dnl Checks for common headers and functions dnl -dnl Version: 20240511 +dnl Version: 20240513 dnl Function to test if a certain feature was disabled AC_DEFUN([AX_COMMON_ARG_DISABLE], @@ -564,11 +564,42 @@ AC_DEFUN([AX_COMMON_CHECK_LOCAL], 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], - [ac_cv_$1=yes - - m4_foreach( + [m4_foreach( [function], [$3], [AC_CHECK_LIB( diff --git a/m4/libcerror.m4 b/m4/libcerror.m4 index 44ce6f3..02263bb 100644 --- a/m4/libcerror.m4 +++ b/m4/libcerror.m4 @@ -1,6 +1,6 @@ dnl Checks for libcerror required headers and functions dnl -dnl Version: 20240511 +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 @@ -38,7 +38,9 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB], AS_IF( [test "x$ac_cv_header_libcerror_h" = xno], [ac_cv_libcerror=no], - [AX_CHECK_LIB_FUNCTIONS( + [ac_cv_libcerror=yes + + AX_CHECK_LIB_FUNCTIONS( [libcerror], [cerror], [[libcerror_get_version], diff --git a/m4/pthread.m4 b/m4/pthread.m4 index 041b6dd..830fb5f 100644 --- a/m4/pthread.m4 +++ b/m4/pthread.m4 @@ -1,6 +1,6 @@ dnl Functions for pthread dnl -dnl Version: 20240511 +dnl Version: 20240513 dnl Function to detect if pthread is available AC_DEFUN([AX_PTHREAD_CHECK_LIB], @@ -24,7 +24,9 @@ AC_DEFUN([AX_PTHREAD_CHECK_LIB], AS_IF( [test "x$ac_cv_header_pthread_h" = xno], [ac_cv_pthread=no], - [AX_CHECK_LIB_FUNCTIONS( + [ac_cv_pthread=yes + + AX_CHECK_LIB_FUNCTIONS( [pthread], [pthread], [[pthread_create],