aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-03-09 11:28:43 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-03-09 11:28:43 +0100
commit8075b64af4c598d5f6ad3e8e8f2650a4f00ba505 (patch)
treece0308881ce145f809626fcef9a5b26b204e5e3c
parent03dc9c2285568073d922dd0168f88a313131b89d (diff)
v4l-utils: add --enable-v4l2-compliance/ctl-32 option
Add --enable-v4l2-compliance-32 and --enable-v4l2-ctl-32 options to the configure script. If enabled, and gcc/g++ multilib is installed, then 32 bit variants of these utilities are built in order to test the 32-to-64 kernel compat layer. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--configure.ac41
-rw-r--r--utils/v4l2-compliance/.gitignore1
-rw-r--r--utils/v4l2-compliance/Makefile.am7
-rw-r--r--utils/v4l2-ctl/.gitignore1
-rw-r--r--utils/v4l2-ctl/Makefile.am12
5 files changed, 59 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 8585a79d..a9cdfa2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -340,6 +340,21 @@ AM_CONDITIONAL([HAVE_LINUX_I2C_DEV], [test x$linux_i2c_dev = xyes])
AM_ICONV
+# does this compiler support -m32 ?
+AC_MSG_CHECKING([if gcc accepts -m32])
+safe_CFLAGS=$CFLAGS
+CFLAGS="-m32"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ return 0;
+]])], [
+ AC_DEFINE([HAVE_M32], [1], [gcc supports -m32])
+ AC_MSG_RESULT([yes])
+], [
+ AC_DEFINE([HAVE_M32], [0], [gcc does not support -m32])
+ AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
# directories
AC_ARG_WITH(libv4l1subdir,
@@ -444,6 +459,14 @@ AC_ARG_ENABLE(v4l2-compliance-libv4l,
esac]
)
+AC_ARG_ENABLE(v4l2-compliance-32,
+ AS_HELP_STRING([--enable-v4l2-compliance-32], [enable v4l2-compliance-32 compilation (for debugging purposes only)]),
+ [case "${enableval}" in
+ yes | no ) ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-v4l2-compliance-32) ;;
+ esac]
+)
+
AC_ARG_ENABLE(v4l2-ctl-libv4l,
AS_HELP_STRING([--disable-v4l2-ctl-libv4l], [disable use of libv4l in v4l2-ctl]),
[case "${enableval}" in
@@ -460,11 +483,19 @@ AC_ARG_ENABLE(v4l2-ctl-stream-to,
esac]
)
+AC_ARG_ENABLE(v4l2-ctl-32,
+ AS_HELP_STRING([--enable-v4l2-ctl-32], [enable v4l2-ctl-32 compilation (for debugging purposes only)]),
+ [case "${enableval}" in
+ yes | no ) ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-v4l2-ctl-32) ;;
+ esac]
+)
+
AC_ARG_ENABLE(qv4l2,
AS_HELP_STRING([--disable-qv4l2], [disable qv4l2 compilation]),
[case "${enableval}" in
yes | no ) ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-qv4l2) ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-qv4l2) ;;
esac]
)
@@ -472,7 +503,7 @@ AC_ARG_ENABLE(qvidcap,
AS_HELP_STRING([--disable-qvidcap], [disable qvidcap compilation]),
[case "${enableval}" in
yes | no ) ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-qvidcap) ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-qvidcap) ;;
esac]
)
@@ -513,8 +544,10 @@ AM_CONDITIONAL([WITH_QTGL], [test x${qt_desktop_opengl} = xyes])
AM_CONDITIONAL([WITH_GCONV], [test x$enable_gconv = xyes -a x$enable_shared == xyes -a x$with_gconvdir != x -a -f $with_gconvdir/gconv-modules])
AM_CONDITIONAL([WITH_V4L2_CTL_LIBV4L], [test x${enable_v4l2_ctl_libv4l} != xno])
AM_CONDITIONAL([WITH_V4L2_CTL_STREAM_TO], [test x${enable_v4l2_ctl_stream_to} != xno])
+AM_CONDITIONAL([WITH_V4L2_CTL_32], [test x${enable_v4l2_ctl_32} == xyes])
AM_CONDITIONAL([WITH_V4L2_COMPLIANCE], [test x$ac_cv_func_fork = xyes])
AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_LIBV4L], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_libv4l} != xno])
+AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_32], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_32} == xyes])
AM_CONDITIONAL([WITH_BPF], [test x$enable_bpf != xno -a x$libelf_pkgconfig = xyes -a x$CLANG = xclang])
# append -static to libtool compile and link command to enforce static libs
@@ -551,8 +584,10 @@ AM_COND_IF([WITH_V4L_PLUGINS], [USE_V4L_PLUGINS="yes"
AM_COND_IF([WITH_V4L_WRAPPERS], [USE_V4L_WRAPPERS="yes"], [USE_V4L_WRAPPERS="no"])
AM_COND_IF([WITH_GCONV], [USE_GCONV="yes"], [USE_GCONV="no"])
AM_COND_IF([WITH_V4L2_CTL_LIBV4L], [USE_V4L2_CTL_LIBV4L="yes"], [USE_V4L2_CTL_LIBV4L="no"])
+AM_COND_IF([WITH_V4L2_CTL_32], [USE_V4L2_CTL_32="yes"], [USE_V4L2_CTL_32="no"])
AM_COND_IF([WITH_V4L2_COMPLIANCE], [USE_V4L2_COMPLIANCE="yes"], [USE_V4L2_COMPLIANCE="no"])
AM_COND_IF([WITH_V4L2_COMPLIANCE_LIBV4L], [USE_V4L2_COMPLIANCE_LIBV4L="yes"], [USE_V4L2_COMPLIANCE_LIBV4L="no"])
+AM_COND_IF([WITH_V4L2_COMPLIANCE_32], [USE_V4L2_COMPLIANCE_32="yes"], [USE_V4L2_COMPLIANCE_32="no"])
AM_COND_IF([WITH_BPF], [USE_BPF="yes"
AC_DEFINE([HAVE_BPF], [1], [BPF IR decoder support enabled])],
[USE_BPF="no"])
@@ -599,7 +634,9 @@ compile time options summary
qv4l2 : $USE_QV4L2
qvidcap : $USE_QVIDCAP
v4l2-ctl uses libv4l : $USE_V4L2_CTL_LIBV4L
+ v4l2-ctl-32 : $USE_V4L2_CTL_32
v4l2-compliance : $USE_V4L2_COMPLIANCE
v4l2-compliance uses libv4l: $USE_V4L2_COMPLIANCE_LIBV4L
+ v4l2-compliance-32 : $USE_V4L2_COMPLIANCE_32
BPF IR Decoders: : $USE_BPF
EOF
diff --git a/utils/v4l2-compliance/.gitignore b/utils/v4l2-compliance/.gitignore
index 4d31123a..da415475 100644
--- a/utils/v4l2-compliance/.gitignore
+++ b/utils/v4l2-compliance/.gitignore
@@ -1,3 +1,4 @@
v4l2-compliance
+v4l2-compliance-32
v4l2-compliance.1
version.h
diff --git a/utils/v4l2-compliance/Makefile.am b/utils/v4l2-compliance/Makefile.am
index dd5d20ca..26682352 100644
--- a/utils/v4l2-compliance/Makefile.am
+++ b/utils/v4l2-compliance/Makefile.am
@@ -2,6 +2,10 @@ bin_PROGRAMS = v4l2-compliance
man_MANS = v4l2-compliance.1
DEFS :=
+if WITH_V4L2_COMPLIANCE_32 && HAVE_M32
+bin_PROGRAMS += v4l2-compliance-32
+endif
+
v4l2_compliance_SOURCES = v4l2-compliance.cpp v4l2-compliance.h \
v4l2-test-debug.cpp v4l2-test-input-output.cpp \
v4l2-test-controls.cpp v4l2-test-io-config.cpp v4l2-test-formats.cpp v4l2-test-buffers.cpp \
@@ -28,6 +32,9 @@ version.h:
touch $@ ; \
fi
+v4l2-compliance-32$(EXEEXT):
+ g++ -o $@ -static -m32 -DNO_LIBV4L2 -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/utils/common $(top_srcdir)/utils/v4l2-compliance/*.cpp
+
clean-local:
-rm -vf version.h
diff --git a/utils/v4l2-ctl/.gitignore b/utils/v4l2-ctl/.gitignore
index 0cb69392..94616e96 100644
--- a/utils/v4l2-ctl/.gitignore
+++ b/utils/v4l2-ctl/.gitignore
@@ -1,3 +1,4 @@
v4l2-ctl
+v4l2-ctl-32
v4l2-ctl.1
media-bus-format-names.h
diff --git a/utils/v4l2-ctl/Makefile.am b/utils/v4l2-ctl/Makefile.am
index f612e0ee..5504efaa 100644
--- a/utils/v4l2-ctl/Makefile.am
+++ b/utils/v4l2-ctl/Makefile.am
@@ -2,6 +2,10 @@ bin_PROGRAMS = v4l2-ctl
man_MANS = v4l2-ctl.1
DEFS :=
+if WITH_V4L2_CTL_32 && HAVE_M32
+bin_PROGRAMS += v4l2-ctl-32
+endif
+
v4l2_ctl_SOURCES = v4l2-ctl.cpp v4l2-ctl.h v4l2-ctl-common.cpp v4l2-ctl-tuner.cpp \
v4l2-ctl-io.cpp v4l2-ctl-stds.cpp v4l2-ctl-vidcap.cpp v4l2-ctl-vidout.cpp \
v4l2-ctl-overlay.cpp v4l2-ctl-vbi.cpp v4l2-ctl-selection.cpp v4l2-ctl-misc.cpp \
@@ -10,7 +14,7 @@ v4l2_ctl_SOURCES = v4l2-ctl.cpp v4l2-ctl.h v4l2-ctl-common.cpp v4l2-ctl-tuner.cp
media-info.cpp v4l2-info.cpp codec-fwht.c codec-v4l2-fwht.c
v4l2_ctl_CPPFLAGS = -I$(top_srcdir)/utils/common
-media-bus-format-names.h: ../../include/linux/media-bus-format.h
+media-bus-format-names.h: $(top_srcdir)/include/linux/media-bus-format.h
sed -e '/#define MEDIA_BUS_FMT/ ! d; s/.*FMT_//; /FIXED/ d; s/\t.*//; s/.*/{ \"&\", MEDIA_BUS_FMT_& },/;' \
< $< > $@
@@ -27,4 +31,10 @@ if !WITH_V4L2_CTL_STREAM_TO
DEFS += -DNO_STREAM_TO
endif
+v4l2-ctl-32$(EXEEXT): media-bus-format-names.h
+ cat $(top_srcdir)/utils/v4l2-ctl/$(filter %.c,$(v4l2_ctl_SOURCES)) >$@.c
+ gcc -static -m32 -DNO_LIBV4L2 -c -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/utils/common $@.c
+ g++ -static -m32 -DNO_LIBV4L2 -o $@ -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/utils/common $(top_srcdir)/utils/v4l2-ctl/$(filter %.cpp,$(v4l2_ctl_SOURCES)) $@.o
+ rm -f $@.c $@.o
+
EXTRA_DIST = Android.mk v4l2-ctl.1

Privacy Policy