I tried


https://www.gnu.org/software/autoconf-archive/ax_check_library.html

like this 

$ git diff configure.ac
diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index fb65862d..3ce9b14e 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -28,7 +28,7 @@ CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS" CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS" CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1" CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" 

 -CFG_CFLAGS+=" -I/usr/include -I/usr/local/include  - I/data/data/com.termux/files/usr/include/a52dec" 
 +CFG_CFLAGS+=" -I/usr/include -I/usr/local/include"


 CFG_CFLAGS+=" -I/usr/include/freetype2 -I/usr/local/include/freetype2" CFG_CFLAGS+=" -I/data/data/com.termux/files/usr/include/freetype2"
 CFG_CFLAGS+=" -I/usr/include/uuid -I/usr/local/include/uuid" @@ -645,6 +645,8 @@ CHECK_LIB([libwebp], [webp], [WebPGetEncoderVersion]) CHECK_HEADERS([libwebp], [libwebp headers], [webp/encode.h])
 CHECK_LIB([a52dec], [a52], [a52_init]) CHECK_HEADERS([a52dec], [a52 headers], [stdint.h a52dec/a52.h]) 


 +AX_CHECK_LIBRARY([a52dec], [a52dec/a52.h], [a52]) 
 +echo $a52dec_CPPFLAGS 


 CHECK_LIB([encore], [encore], [encore]) CHECK_HEADERS([encore], [encore headers], [encore.h])
 CHECK_LIB([giflib], [gif], [DGifOpen]) @@ -1114,6 +1116,7 @@ echo " using: thirdparty build = $WANT_CIN_3RDPARTY" echo " using: single-user = $WANT_CINBIN_BUILD"
 echo " using: static-build = $WANT_STATIC_BUILD" echo " using: ladspa-build = $WANT_LADSPA_BUILD"

+echo " using CPPFLAGS = $CPPFLAGS" 
 echo ""
 

AC_SUBST(WANT_CIN_3RDPARTY)
@@ -1124,6 +1127,7 @@ AC_SUBST(WANT_X265_HIDEPTH)                      
 AC_SUBST(CFG_CFLAGS) AC_SUBST(CFG_CXXFLAGS)
+AC_SUBST(CPPFLAGS)                                                    
 AC_CONFIG_FILES([Makefile]) AC_OUTPUT
No bracket in bottom line (press RETURN)

it prints:

checking a52 headers... yes 
 checking for stdio.h... (cached) yes
checking for stdlib.h... yes 
 checking for string.h... yes
checking for inttypes.h... yes 
 checking for stdint.h... (cached) yes
checking for strings.h... yes 
 checking for sys/stat.h... yes
checking for sys/types.h... yes 
 checking for unistd.h... yes
checking for a52dec/a52.h... yes
checking for main in -la52... yes                                      
checking for encore.h... no

but in top-level Makefile corresponding variables are empty:
.... 
WANT_XV = yes 
 WANT_XXF86VM = yes 
 a52dec_CPPFLAGS = 
 a52dec_LDFLAGS = 
 abs_builddir = /data/data/com.termux/files/home/cingg/cinelerra/cinelerra-5.1 
 abs_srcdir = /data/data/com.termux/files/home/cingg/cinelerra/cinelerra-5.1 
 abs_top_builddir = /data/data/com.termux/files/home/cingg/cinelerra/cinelerra-5.1 abs_top_srcdir = /data/data/com.termux/files/home/cingg/cinelerra/cinelerra-5.1 
 ac_ct_CC = gcc 
 ac_ct_CXX = g++
.... 

I am at lost 

On Saturday, April 9, 2022, Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
so, it detected header but cppflags/cflags still not updated. 

I found gl_ABSOLUTE_HEADER macro from gnulib/m4 but it only adds '-D PATH_TO_HEADER=///path_to_header' gcc flags and PATH_TO_HEADER define to config.h 

I thought confuge not just find libs but alters cflags/cppflags/ldflags - but apparently our does not quite work this way.. 

theres was AC_LIB_LINKFLAGS
https://www.gnu.org/software/gnulib/manual/html_node/Searching-for-Libraries.html

but it also assumes 
" These macros assume that when a library is installed in some_directory/lib, its include files are installed in some_directory/include." 

in our case this is wrong.. 

so I am stuck at adding one more " -I" directive to configure.ac... 

On Friday, April 8, 2022, Andrea paz <gamberucci.andrea@gmail.com> wrote:
> can you send me config.log too? (to see if configure picked up liba52/a52.h header)