[FFmpeg-devel] [PATCH v2.1 1/2] configure: Add test_ioctl and test for SIOCGIFINDEX
Peter Enderborg
peterend at axis.com
Fri Aug 8 10:27:34 EEST 2025
Adds a generic ioctl tester and a specific test SIOCGIFINDEX
that sets ioctl_gifindex. It is a network specific feature
and the tests are run only in network context.
Signed-off-by: Peter Enderborg <peterend at axis.com>
---
configure | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/configure b/configure
index 712ed947ff..9c9de9f525 100755
--- a/configure
+++ b/configure
@@ -1279,6 +1279,20 @@ int x;
EOF
}
+test_ioctl(){
+ log test_ioctl "$@"
+ ctl=$1
+ shift 1
+ test_cc "$@" <<EOF
+#include <stddef.h>
+#include <sys/ioctl.h>
+int f;
+void x(){
+ioctl(f, $ctl, NULL);
+}
+EOF
+}
+
check_cflags(){
log check_cflags "$@"
test_cflags "$@" && add_cflags "$@"
@@ -2536,6 +2550,7 @@ HAVE_LIST="
$TOOLCHAIN_FEATURES
$TYPES_LIST
gzip
+ ioctl_gifindex
ioctl_posix
libdrm_getfb2
makeinfo
@@ -2668,6 +2683,7 @@ CONFIG_EXTRA="
vvc_sei
wma_freqs
wmv2dsp
+
"
CMDLINE_SELECT="
@@ -6026,6 +6042,7 @@ case $target_os in
linux)
enable section_data_rel_ro
enabled_any arm aarch64 && enable_weak linux_perf
+
;;
irix*)
target_os=irix
@@ -6631,6 +6648,7 @@ if ! disabled network; then
else
disable network
fi
+ test_ioctl SIOCGIFINDEX && enable ioctl_gifindex
fi
check_builtin MemoryBarrier windows.h "MemoryBarrier()"
--
2.34.1
More information about the ffmpeg-devel
mailing list