[FFmpeg-cvslog] configure: fix --custom-allocator

Timo Rothenpieler git at videolan.org
Mon Oct 9 21:39:48 EEST 2023


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Wed Aug 23 23:44:47 2023 +0200| [3914abf76e3d1e65c41f7483ba76bc61f5057670] | committer: Timo Rothenpieler

configure: fix --custom-allocator

The custom-allocator logic has been completely defunct since a while,
since nothing depends on those targets, they never get used.
This updates jemalloc to pkg-config, adds the fallback option for
potential arbitrary allocators, and finally actually adds the libraries
to LDFLAGS.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3914abf76e3d1e65c41f7483ba76bc61f5057670
---

 configure | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 8a1a1b8584..bc0c0bd4e4 100755
--- a/configure
+++ b/configure
@@ -6358,16 +6358,26 @@ if enabled float16; then
 fi
 
 case "$custom_allocator" in
+    "")
+    ;;
     jemalloc)
-        # jemalloc by default does not use a prefix
-        require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
+        test -n "$malloc_prefix" ||
+            malloc_prefix=$($pkg_config --variable=jemalloc_prefix $pkg_config_flags jemalloc 2>/dev/null)
+        require_pkg_config custom_allocator jemalloc jemalloc/jemalloc.h ${malloc_prefix}malloc
     ;;
     tcmalloc)
-        require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
+        require_pkg_config custom_allocator libtcmalloc gperftools/tcmalloc.h tc_malloc
         malloc_prefix=tc_
     ;;
+    *)
+        require_pkg_config custom_allocator "$custom_allocator" stdlib.h malloc
+    ;;
 esac
 
+if test -n "$custom_allocator"; then
+    add_extralibs "$custom_allocator_extralibs"
+fi
+
 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



More information about the ffmpeg-cvslog mailing list