[FFmpeg-devel] [PATCH 1/2] configure: use custom allocator extralibs when testing memalign and posix_memalign

Peter Ross pross at xvid.org
Sun Dec 9 00:27:54 EET 2018


the memalign and posix_memalign tests currently fail when using a custom allocator,
because configure does not include the custom allocator library.
---
 configure | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 026aee6b25..4d7b2b37c3 100755
--- a/configure
+++ b/configure
@@ -5852,20 +5852,23 @@ check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
 check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
 check_builtin x264_csp_bgr "stdint.h x264.h" "X264_CSP_BGR"
 
+malloc_extralibs=
 case "$custom_allocator" in
     jemalloc)
         # jemalloc by default does not use a prefix
         require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
+        malloc_extralibs=-ljemalloc
     ;;
     tcmalloc)
         require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
         malloc_prefix=tc_
+        malloc_extralibs=${libtcmalloc_extralibs}
     ;;
 esac
 
 check_func_headers malloc.h _aligned_malloc     && enable aligned_malloc
-check_func  ${malloc_prefix}memalign            && enable memalign
-check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
+check_func  ${malloc_prefix}memalign ${malloc_extralibs} && enable memalign
+check_func  ${malloc_prefix}posix_memalign ${malloc_extralibs} && enable posix_memalign
 
 check_func  access
 check_func_headers stdlib.h arc4random
-- 
2.17.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181209/90250316/attachment.sig>


More information about the ffmpeg-devel mailing list