@@ -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