diff mbox

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

Message ID b34ecfbd06555653c6759d01cd0c3b92eb43ed65.1544308047.git.pross@xvid.org
State New
Headers show

Commit Message

Peter Ross Dec. 8, 2018, 10:27 p.m. UTC
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(-)

Comments

Peter Ross Dec. 17, 2018, 6:28 a.m. UTC | #1
On Sun, Dec 09, 2018 at 09:27:54AM +1100, Peter Ross wrote:
> the memalign and posix_memalign tests currently fail when using a custom allocator,
> because configure does not include the custom allocator library.

is any one using custom allocators? should i just apply these?

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
diff mbox

Patch

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