From e0a57fa266c8d1bb8b27cc43a5eed41eef540434 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Sun, 13 Nov 2022 21:01:00 -0500 Subject: [PATCH 01/13] configure: remove unused strip/stripping They were from FFmpeg, but unused by MythTV. --- mythtv/configure | 45 ++------------------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 406d554443d..4f5b4eb77ab 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -613,10 +613,6 @@ add_ldlibflags(){ append LDLIBFLAGS $($ldflags_filter "$@") } -add_stripflags(){ - append ASMSTRIPFLAGS "$@" -} - add_extralibs(){ prepend extralibs $($ldflags_filter "$@") } @@ -837,20 +833,6 @@ check_ldflags(){ test_ldflags "$@" && add_ldflags "$@" } -test_stripflags(){ - log test_stripflags "$@" - # call check_cc to get a fresh TMPO - check_cc <&1 | grep -q "\-D "; then else ranlib_default="${cross_prefix}${ranlib_default}" fi -strip_default="${cross_prefix}${strip_default}" windres_default="${cross_prefix}${windres_default}" sysinclude_default="${sysroot}/usr/include" -set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \ +set_default arch cc cxx doxygen pkg_config ranlib sysinclude \ target_exec target_os x86asmexe nvcc enabled cross_compile || host_cc_default=$cc set_default host_cc @@ -3370,7 +3345,6 @@ probe_cc(){ # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency # with MSVC which enables it by default. _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise' - disable stripping elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then # lld can emulate multiple different linkers; in ms link.exe mode, # the -? parameter gives the help output which contains an identifyable @@ -3402,7 +3376,6 @@ probe_cc(){ _ld_lib='lib%.a' _ld_path='-libpath:' _flags='-nologo' - disable stripping elif $_cc --version 2>/dev/null | grep -q ^cparser; then _type=cparser _ident=$($_cc --version | head -n1) @@ -4317,7 +4290,6 @@ case $target_os in ;; bsd/os) add_extralibs -lpoll -lgnugetopt - strip="strip -d" ;; darwin) enable appleremote @@ -4341,7 +4313,6 @@ case $target_os in #Need to add @rpath in front of install name so test unit can use non-installed lib SHFLAGS='-headerpad_max_install_names -dynamiclib -Wl,-single_module -Wl,-install_name,@rpath/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)' enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress - strip="${strip} -x" add_ldflags -Wl,-dynamic,-search_paths_first SLIBSUF=".dylib" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)' @@ -4497,8 +4468,6 @@ case $target_os in ranlib="echo ignoring ranlib" ;; os/2*) - strip="lxlite -CS" - striptype="" objformat="aout" add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf' @@ -4727,10 +4696,9 @@ elif test x$compile_type = x"profile" ; then add_cxxflags -DNDEBUG check_cxxflags -O2 enable debug - disable stripping elif test x$compile_type = x"debug"; then enable debug - disable optimizations stripping + disable optimizations fi enabled silent_cc && append CCONFIG "silent" @@ -5861,9 +5829,6 @@ enabled rpath && add_ldexeflags -Wl,-rpath,$libdir enabled rpath && add_ldlibflags -Wl,-rpath,$libdir test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic -# add some strip flags -check_stripflags -x - enabled neon_clobber_test && check_ldflags -Wl,--wrap,avcodec_open2 \ -Wl,--wrap,avcodec_decode_audio4 \ @@ -6982,9 +6947,6 @@ if enabled source_path_used; then map 'test -f "$source_path/$v" && $ln_s "$source_path/$v" $v' $FILES fi -enabled stripping || strip="echo skipping strip" -enabled stripping || striptype="" - config_files="$TMPH $TMPMAK" if enabled backend; then @@ -7166,8 +7128,6 @@ AR_O=$ar_o QMAKE_AR=$ar $arflags RANLIB=$ranlib QMAKE_RANLIB=$ranlib -STRIP=$strip -STRIPTYPE=$striptype NVCC=$nvcc CP=cp -p LN_S=$ln_s @@ -7203,7 +7163,6 @@ DOXYGEN=$doxygen LDFLAGS=$LDFLAGS LDEXEFLAGS=$LDEXEFLAGS LDLIBFLAGS=$LDLIBFLAGS -ASMSTRIPFLAGS=$ASMSTRIPFLAGS X86ASMFLAGS=$X86ASMFLAGS BUILDSUF=$build_suffix PROGSSUF=$progs_suffix From c53d81a8830844e93f65681fad95bdd6a78831fb Mon Sep 17 00:00:00 2001 From: ulmus-scott Date: Sun, 12 Dec 2021 19:06:38 -0500 Subject: [PATCH 02/13] configure: unconditionally enable debugging symbols They already were, but make it clearer. --- mythtv/configure | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 4f5b4eb77ab..83e01b8c49d 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -4685,19 +4685,17 @@ if test $target_os = android ; then append CONFIG_INCLUDEPATH $sysinclude "${sysroot}${prefix}" fi +enable debug append CCONFIG "$compile_type" if test x$compile_type = x"release" ; then add_cflags -DNDEBUG add_cxxflags -DNDEBUG check_cxxflags -O2 - enable debug elif test x$compile_type = x"profile" ; then add_cflags -DNDEBUG add_cxxflags -DNDEBUG check_cxxflags -O2 - enable debug elif test x$compile_type = x"debug"; then - enable debug disable optimizations fi From dc98561a47bbe9cbaf02b2787ec2a69a31cc6b4f Mon Sep 17 00:00:00 2001 From: ulmus-scott Date: Sun, 12 Dec 2021 19:54:49 -0500 Subject: [PATCH 03/13] configure: move various optimization settings together Removed duplicate test for non-zero length optflags, since it was already checked if zero length. --- mythtv/configure | 64 ++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 83e01b8c49d..7fd671b24bf 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -4699,6 +4699,34 @@ elif test x$compile_type = x"debug"; then disable optimizations fi +if [ -z "$optflags" ]; then + if enabled small; then + optflags=$cflags_size + elif enabled optimizations; then + optflags=$cflags_speed + else + optflags=$cflags_noopt + fi +fi + +check_optflags(){ + check_cflags "$@" + enabled lto && check_ldflags "$@" +} + +check_optflags $optflags +check_optflags -fno-math-errno +check_optflags -fno-signed-zeros + +if enabled lto; then + test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker" + check_cflags -flto + check_cxxflags -flto + check_ldflags -flto $cpuflags + disable inline_asm_direct_symbol_refs +fi + + enabled silent_cc && append CCONFIG "silent" disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer @@ -5879,16 +5907,6 @@ EOF fi fi -if [ -z "$optflags" ]; then - if enabled small; then - optflags=$cflags_size - elif enabled optimizations; then - optflags=$cflags_speed - else - optflags=$cflags_noopt - fi -fi - if [ -z "$nvccflags" ]; then nvccflags=$nvccflags_default fi @@ -5899,22 +5917,6 @@ else nvccflags="$nvccflags -m32" fi -check_optflags(){ - check_cflags "$@" - enabled lto && check_ldflags "$@" -} - -check_optflags $optflags -check_optflags -fno-math-errno -check_optflags -fno-signed-zeros - -if enabled lto; then - test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker" - check_cflags -flto - check_cxxflags -flto - check_ldflags -flto $cpuflags - disable inline_asm_direct_symbol_refs -fi if enabled dvb; then [ -d "$dvb_path" ] || dvb_path="${sysroot}/usr/include" @@ -6290,15 +6292,7 @@ if test $target_os = darwin; then fi fi -if [ -n "$optflags" ]; then - add_cflags $optflags -elif enabled small; then - add_cflags $cflags_size -elif enabled optimizations; then - add_cflags $cflags_speed -else - add_cflags $cflags_noopt -fi + check_cflags -fno-math-errno check_cflags -fno-signed-zeros check_cc -mno-red-zone < Date: Sun, 12 Dec 2021 21:47:06 -0500 Subject: [PATCH 04/13] configure: remove duplicated C flags Added with optimization flags --- mythtv/configure | 2 -- 1 file changed, 2 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 7fd671b24bf..1bf42e3b532 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -6293,8 +6293,6 @@ if test $target_os = darwin; then fi -check_cflags -fno-math-errno -check_cflags -fno-signed-zeros check_cc -mno-red-zone < Date: Sun, 12 Dec 2021 21:59:36 -0500 Subject: [PATCH 05/13] configure: add ffmpeg_optenableif() copies ffmpeg_optenable but removes the else branch --- mythtv/configure | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 1bf42e3b532..0d80dd336db 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -6707,6 +6707,16 @@ ffmpeg_optenable() { done } +ffmpeg_optenableif() { + while test -n "$1" ; do + val=$(eval "echo \$$1") + if enabled "$1" ; then + ffopts="$ffopts --enable-"$(echo "$1" | sed 's/_/-/g') + fi + shift + done +} + ffopts= ffmpeg_optset arch cross_prefix sysroot sysinclude cc cxx ld cpu ffmpeg_optset extra_cxxflags extra_ldflags target_os @@ -6726,34 +6736,13 @@ if test $target_os = "android"; then else disable mediacodec fi -if enabled vaapi; then - ffopts="$ffopts --enable-vaapi" -fi -if enabled mmal; then - ffopts="$ffopts --enable-mmal" -fi +ffmpeg_optenableif vaapi mmal libaom libdav1d gnutls lto if enabled drm; then ffopts="$ffopts --enable-libdrm" fi -if enabled libaom; then - ffopts="$ffopts --enable-libaom" -fi - - -if enabled libdav1d; then - ffopts="$ffopts --enable-libdav1d" -fi - -if enabled gnutls; then - ffopts="$ffopts --enable-gnutls" -fi - -if enabled lto; then - ffopts="$ffopts --enable-lto" -fi if test "$ID" = "raspbian"; then case $cpu in From 827f240d38f9ada8838bad458ecc73937d6578d5 Mon Sep 17 00:00:00 2001 From: ulmus-scott Date: Mon, 13 Dec 2021 17:15:11 -0500 Subject: [PATCH 06/13] mythplugins: remove vestiges of XV(MC) and DIRECTFB --- mythplugins/settings.pro | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mythplugins/settings.pro b/mythplugins/settings.pro index 62761bff535..c616cd2f91f 100644 --- a/mythplugins/settings.pro +++ b/mythplugins/settings.pro @@ -34,7 +34,6 @@ macx:CONFIG += console # figure out compile flags based on qmake info QMAKE_CXXFLAGS += $$ARCHFLAGS -QMAKE_CXXFLAGS += $$CONFIG_DIRECTFB_CXXFLAGS QMAKE_CXXFLAGS_SHLIB = -DPIC -fPIC QMAKE_CXXFLAGS += $$CXXFLAGS $$ECXXFLAGS @@ -69,11 +68,8 @@ contains(CONFIG_LIBMP3LAME, "yes") { EXTRA_LIBS += $$CONFIG_AUDIO_ALSA_LIBS EXTRA_LIBS += $$CONFIG_AUDIO_JACK_LIBS EXTRA_LIBS += $$CONFIG_FIREWIRE_LIBS -EXTRA_LIBS += $$CONFIG_DIRECTFB_LIBS EXTRA_LIBS += $$LOCAL_LIBDIR_X11 -EXTRA_LIBS += $$CONFIG_XV_LIBS -EXTRA_LIBS += $$CONFIG_XVMC_LIBS EXTRA_LIBS += $$CONFIG_OPENGL_VSYNC_LIBS LIRC_LIBS = $$CONFIG_LIRC_LIBS From 6d874a6f4c1aa8af85129c51a32f3649b3d6fd08 Mon Sep 17 00:00:00 2001 From: ulmus-scott Date: Mon, 13 Dec 2021 17:40:58 -0500 Subject: [PATCH 07/13] mythplugins/configure: remove unused OpenGL setting/checks I think these have been unused since MythGallery was removed: fce4029a6b2bb6a12350b180ea14843a0fa7dfd0 --- mythplugins/configure | 8 -------- mythplugins/settings.pro | 1 - 2 files changed, 9 deletions(-) diff --git a/mythplugins/configure b/mythplugins/configure index b041981fd5d..5d03fb9454a 100755 --- a/mythplugins/configure +++ b/mythplugins/configure @@ -316,7 +316,6 @@ flix " CONFIG_LIST=" -opengl exif newexif dcraw @@ -609,8 +608,6 @@ ECXXFLAGS=$(cat mythconfig.mak | grep -e "^ECXXFLAGS=") ECXXFLAGS=${ECXXFLAGS#ECXXFLAGS=} CXXPPFLAGS=$(cat mythconfig.mak | grep -e "^CXXPPFLAGS=") CXXPPFLAGS=${CXXPPFLAGS#CXXPPFLAGS=} -OPENGLV=$(cat mythconfig.mak | grep -e "^CONFIG_OPENGL_VIDEO=yes") -OPENGLES=$(cat mythconfig.mak | grep -e "^HAVE_GLES2_GL2_H=yes") WEBKIT=$(cat mythconfig.mak | grep -e "^CONFIG_QTWEBKIT=yes") EXTRALIBS=$(cat mythconfig.mak | grep -e "^EXTRALIBS=") @@ -640,11 +637,6 @@ qmake=${qmake#QMAKE=} qt_version_str=`$qmake -query QT_VERSION` qt_version=$(version2num $qt_version_str) -# rely on what was discover during MythTV configure -if enabled opengl && test "$OPENGLV" != "CONFIG_OPENGL_VIDEO=yes"; then - disable opengl -fi - if ! check_lib libexif/exif-data.h exif_loader_new -lexif ; then disable exif fi diff --git a/mythplugins/settings.pro b/mythplugins/settings.pro index c616cd2f91f..781c7634a55 100644 --- a/mythplugins/settings.pro +++ b/mythplugins/settings.pro @@ -70,7 +70,6 @@ EXTRA_LIBS += $$CONFIG_AUDIO_JACK_LIBS EXTRA_LIBS += $$CONFIG_FIREWIRE_LIBS EXTRA_LIBS += $$LOCAL_LIBDIR_X11 -EXTRA_LIBS += $$CONFIG_OPENGL_VSYNC_LIBS LIRC_LIBS = $$CONFIG_LIRC_LIBS From d872d91d4bef32a01e206681a126ad864fe7772b Mon Sep 17 00:00:00 2001 From: ulmus-scott Date: Mon, 13 Dec 2021 19:56:17 -0500 Subject: [PATCH 08/13] configure: remove unnecessary lines from libcec test --- mythtv/configure | 3 --- 1 file changed, 3 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 0d80dd336db..1b67260bae6 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -6230,9 +6230,6 @@ if enabled libcec ; then else check_cxx -I"$libcec_path" < -#include -using namespace std; -using namespace CEC; #include int main(void) { #if (CEC_LIB_VERSION_MAJOR < 2) From 5d9253ee1e19197aa76f260a8fa9f5c22d98954f Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Tue, 31 Dec 2024 20:45:05 -0500 Subject: [PATCH 09/13] configure: remove COMPLEX_FUNCS Neither cabs() nor cexp() are used. --- mythtv/configure | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 1b67260bae6..6816d075ee2 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -876,21 +876,6 @@ int main(void){ $func(); } EOF } -check_complexfunc(){ - log check_complexfunc "$@" - func=$1 - narg=$2 - shift 2 - test $narg = 2 && args="f, g" || args="f * I" - disable $func - check_ld "cc" "$@" < -#include -float foo(complex float f, complex float g) { return $func($args); } -int main(void){ return (int) foo; } -EOF -} - check_mathfunc(){ log check_mathfunc "$@" func=$1 @@ -1680,12 +1665,6 @@ INTRINSICS_LIST=" intrinsics_neon " -# unfortunately necessary because of internal FFmpeg header use -COMPLEX_FUNCS=" - cabs - cexp -" - MATH_FUNCS=" atanf atan2f @@ -1827,7 +1806,6 @@ HAVE_LIST=" $ARCH_FEATURES $ATOMICS_LIST $BUILTIN_LIST - $COMPLEX_FUNCS $HAVE_LIST_CMDLINE $HAVE_LIST_PUB $HEADERS_LIST @@ -5559,10 +5537,6 @@ for func in $MATH_FUNCS; do eval check_mathfunc $func \${${func}_args:-1} $LIBM done -for func in $COMPLEX_FUNCS; do - eval check_complexfunc $func \${${func}_args:-1} -done - # these are off by default, so fail if requested and not available enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 From b7e10656936c41349aeb6bbe338f0b8512d103cd Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Tue, 31 Dec 2024 21:18:06 -0500 Subject: [PATCH 10/13] configure: remove MATH_FUNCS Only used in FFmpeg. --- mythtv/configure | 59 ------------------------------------------------ 1 file changed, 59 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 6816d075ee2..f31a1b770de 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -876,20 +876,6 @@ int main(void){ $func(); } EOF } -check_mathfunc(){ - log check_mathfunc "$@" - func=$1 - narg=$2 - shift 2 - test $narg = 2 && args="f, g" || args="f" - disable $func - check_ld "cc" "$@" < -float foo(float f, float g) { return $func($args); } -int main(void){ return (int) foo; } -EOF -} - check_func_headers(){ log check_func_headers "$@" headers=$1 @@ -1665,38 +1651,6 @@ INTRINSICS_LIST=" intrinsics_neon " -MATH_FUNCS=" - atanf - atan2f - cbrt - cbrtf - copysign - cosf - erf - exp2 - exp2f - expf - hypot - isfinite - isinf - isnan - ldexpf - llrint - llrintf - log2 - log2f - log10f - lrint - lrintf - powf - rint - round - roundf - sinf - trunc - truncf -" - SYSTEM_FUNCS=" access arc4random @@ -1810,7 +1764,6 @@ HAVE_LIST=" $HAVE_LIST_PUB $HEADERS_LIST $INTRINSICS_LIST - $MATH_FUNCS $SYSTEM_FUNCS $THREADS_LIST $TOOLCHAIN_FEATURES @@ -5525,18 +5478,6 @@ require zip zip.h zip_open -lzip # On some systems dynamic loading requires no extra linker flags check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl -check_lib libm math.h sin -lm && LIBM="-lm" - -atan2f_args=2 -copysign_args=2 -hypot_args=2 -ldexpf_args=2 -powf_args=2 - -for func in $MATH_FUNCS; do - eval check_mathfunc $func \${${func}_args:-1} $LIBM -done - # these are off by default, so fail if requested and not available enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 From ad408f8f49c55120d81d2b1050c1eeebe5ce59a6 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Tue, 31 Dec 2024 23:32:02 -0500 Subject: [PATCH 11/13] configure: trim SYSTEM_FUNCS and TYPES_LIST Functions used in MythTV: access closesocket eglGetProcAddress fcntl fork getaddrinfo gettimeofday gmtime_r inet_aton isatty jack_port_get_latency_range LoadLibrary localtime_r lstat mkstemp mmap nanosleep PeekNamedPipe sysconf sysctl usleep wl_surface_set_opaque_region Not checked for: libexiv2: MapViewOfFile Sleep libbluray: strerror_r gettimeofday libdvdnav: setmode ffnvcodec: LoadLibrary Only used are: HAVE_GETMNTENT_R in libmythbluray HAVE_GETTIMEOFDAY in libdvdnav, libdvdread, libmythbase/logging.cpp and libmythbase/loggingserver.cpp libexiv2 has its own EXV_HAVE_GMTIME_R EXV_HAVE_STRERROR_R EXV_HAVE_MMAP EXV_HAVE_LSTAT When removing closesocket, also remove unused HAVE_STRUCT_*, including CONDITION_VARIABLE_Ptr, socklen_t, struct_rusage_ru_maxrss, and struct_stat_st_mtim_tv_nsec kCMVideoCodecType_HEVC is FFmpeg only. --- mythtv/configure | 189 +++-------------------------------------------- 1 file changed, 9 insertions(+), 180 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index f31a1b770de..59a5dd1c675 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -1047,16 +1047,6 @@ check_builtin(){ check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name" } -check_compile_assert(){ - log check_compile_assert "$@" - name=$1 - headers=$2 - condition=$3 - shift 3 - disable "$name" - check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name" -} - require(){ log require "$@" name_version="$1" @@ -1651,61 +1641,17 @@ INTRINSICS_LIST=" intrinsics_neon " -SYSTEM_FUNCS=" - access - arc4random - clock_gettime - closesocket - CommandLineToArgvW - CoTaskMemFree - CryptGenRandom - fcntl - flt_lim - fork - getaddrinfo - gethrtime +SYSTEM_FUNCS_BLURAY=" getmntent_r - getopt - GetProcessAffinityMask - GetProcessMemoryInfo - GetProcessTimes - getrusage - GetSystemTimeAsFileTime +" + +SYSTEM_FUNCS_DVDNAV=" gettimeofday - glob - glXGetProcAddress - gmtime_r - inet_aton - isatty - jack_port_get_latency_range - kbhit - LoadLibrary - localtime_r - lstat - lzo1x_999_compress - mach_absolute_time - MapViewOfFile - mkstemp - mmap - mprotect - nanosleep - PeekNamedPipe - pthread_cancel - sched_getaffinity - SetConsoleTextAttribute - SetConsoleCtrlHandler - setmode - setrlimit - Sleep - strerror_r - sysconf - sysctl - usleep - UTGetOSTypeFromString - VirtualAlloc - wglGetProcAddress - eglGetProcAddress - wl_surface_set_opaque_region +" + +SYSTEM_FUNCS=" + $SYSTEM_FUNCS_BLURAY + $SYSTEM_FUNCS_DVDNAV " TOOLCHAIN_FEATURES=" @@ -1735,21 +1681,6 @@ TOOLCHAIN_FEATURES=" " TYPES_LIST=" - CONDITION_VARIABLE_Ptr - kCMVideoCodecType_HEVC - socklen_t - struct_addrinfo - struct_group_source_req - struct_ip_mreq_source - struct_ipv6_mreq - struct_msghdr_msg_flags - struct_pollfd - struct_rusage_ru_maxrss - struct_sctp_event_subscribe - struct_sockaddr_in6 - struct_sockaddr_sa_len - struct_sockaddr_storage - struct_stat_st_mtim_tv_nsec struct_hdr_metadata_infoframe " @@ -4593,9 +4524,6 @@ case $libc_type in ;; esac -check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" || - add_cppflags '-I\$(SRC_PATH)/compat/float' - esc(){ echo "$*" | sed 's/%/%25/g;s/:/%3a/g' } @@ -5058,46 +4986,6 @@ check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_ check_ldflags -Wl,--as-needed check_ldflags -Wl,-z,noexecstack -if ! disabled network; then - check_func getaddrinfo $network_extralibs - check_func inet_aton $network_extralibs - - check_type netdb.h "struct addrinfo" - check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE - check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE - check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE - check_type poll.h "struct pollfd" - check_type netinet/sctp.h "struct sctp_event_subscribe" - check_struct "sys/socket.h" "struct msghdr" msg_flags - check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len - check_type netinet/in.h "struct sockaddr_in6" - check_type "sys/types.h sys/socket.h" "struct sockaddr_storage" - check_type "sys/types.h sys/socket.h" socklen_t - - # Prefer arpa/inet.h over winsock2 - if check_header arpa/inet.h ; then - check_func closesocket - elif check_header winsock2.h ; then - check_func_headers winsock2.h closesocket -lws2 && - network_extralibs="-lws2" || - { check_func_headers winsock2.h closesocket -lws2_32 && - network_extralibs="-lws2_32"; } || disable winsock2_h network - check_func_headers ws2tcpip.h getaddrinfo $network_extralibs - - check_type ws2tcpip.h socklen_t - check_type ws2tcpip.h "struct addrinfo" - check_type ws2tcpip.h "struct group_source_req" - check_type ws2tcpip.h "struct ip_mreq_source" - check_type ws2tcpip.h "struct ipv6_mreq" - check_type winsock2.h "struct pollfd" - check_struct winsock2.h "struct sockaddr" sa_len - check_type ws2tcpip.h "struct sockaddr_in6" - check_type ws2tcpip.h "struct sockaddr_storage" - else - disable network - fi -fi - use_pkg_config sqlite3 sqlite3 "sqlite3.h" sqlite3_load_extension && enable sqlite3 require_pkg_config samplerate samplerate samplerate.h src_get_version -lm @@ -5149,8 +5037,6 @@ check_builtin MemoryBarrier windows.h "MemoryBarrier()" check_builtin sarestart signal.h "SA_RESTART" check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" -lpthread check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)" -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 x264.h X264_CSP_BGR case "$custom_allocator" in @@ -5164,50 +5050,7 @@ case "$custom_allocator" in ;; esac -check_func access -check_func_headers stdlib.h arc4random -check_func_headers time.h clock_gettime || - { check_lib clock_gettime time.h clock_gettime -lrt && LIBRT="-lrt"; } -check_func fcntl -check_func fork -check_func gethrtime -check_func getopt -check_func getrusage check_func gettimeofday -check_func isatty -check_func mach_absolute_time -check_func mkstemp -check_func mmap -check_func mprotect -# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that -check_func_headers time.h nanosleep || - { check_lib nanosleep time.h nanosleep -lrt && LIBRT="-lrt"; } -check_func sched_getaffinity -check_func setrlimit -check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE -check_func strerror_r -check_func sysconf -check_func sysctl -check_func usleep - -check_func_headers conio.h kbhit -check_func_headers io.h setmode -check_func_headers lzo/lzo1x.h lzo1x_999_compress -check_func_headers stdlib.h getenv -check_func_headers sys/stat.h lstat - -check_func_headers windows.h GetProcessAffinityMask -check_func_headers windows.h GetProcessTimes -check_func_headers windows.h GetSystemTimeAsFileTime -check_func_headers windows.h LoadLibrary -check_func_headers windows.h MapViewOfFile -check_func_headers windows.h PeekNamedPipe -check_func_headers windows.h SetConsoleTextAttribute -check_func_headers windows.h SetConsoleCtrlHandler -check_func_headers windows.h Sleep -check_func_headers windows.h VirtualAlloc -check_struct windows.h "CONDITION_VARIABLE" Ptr -check_func_headers glob.h glob check_header d3d11.h check_header direct.h @@ -5249,11 +5092,6 @@ check_header linux/videodev2.h # so we also check that atomics actually work here check_builtin stdatomic_h stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)" -check_lib ole32 "windows.h" CoTaskMemFree -lole32 -check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32 -check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom -ladvapi32 -check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi - #Myth check for MYTHTV_HAVE_LIST check_header byteswap.h check_header sys/endian.h @@ -5267,8 +5105,6 @@ check_func_headers "sys/types.h sys/socket.h ifaddrs.h" getifaddrs check_func_headers sys/time.h gettimeofday #End MythTV check -check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss - check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h d3d11.h" "ID3D11VideoDecoder" @@ -5324,11 +5160,6 @@ if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads fi - -if enabled pthreads; then - check_func pthread_cancel -fi - enabled ffmpeg_pthreads && enable pthreads # Check for taglib for libmythmetadata. MSYS2 uses taglib-config.cmd @@ -7227,8 +7058,6 @@ if enabled cygwin ; then echo "#endif" >> $TMPH fi -enabled getenv || echo "#define getenv(x) NULL" >> $TMPH - print_config ARCH_ "$config_files" $ARCH_LIST print_config HAVE_ "$config_files" $HAVE_LIST print_config HAVE_ "$config_files" $MYTHTV_HAVE_LIST From e22ca3ee7d6553390977a0f283885a3c8ad22a47 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Wed, 1 Jan 2025 00:23:45 -0500 Subject: [PATCH 12/13] do not reference HAVE_AV_CONFIG_H outside FFmpeg This is only defined when building FFmpeg, otherwise it should not be defined and does not need to be `undef`ed. --- mythtv/external/libmythdvdnav/config.h.in | 1 - mythtv/external/libmythdvdnav/libmythdvdnav.pro | 2 -- mythtv/libs/libmythtv/io/mythavformatwriter.h | 1 - mythtv/libs/libmythtv/mythplayer.cpp | 3 --- mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h | 1 - 5 files changed, 8 deletions(-) diff --git a/mythtv/external/libmythdvdnav/config.h.in b/mythtv/external/libmythdvdnav/config.h.in index 534402ce334..58d5403d37a 100644 --- a/mythtv/external/libmythdvdnav/config.h.in +++ b/mythtv/external/libmythdvdnav/config.h.in @@ -8,7 +8,6 @@ #define DVDREAD_VERSION @DVDREAD_VERSION@ #define DVDREAD_VERSION_STRING "@DVDREAD_VERSION@" -#define HAVE_AV_CONFIG_H #cmakedefine HAVE_DLFCN_H #cmakedefine01 HAVE_GETTIMEOFDAY #cmakedefine01 HAVE_BIGENDIAN diff --git a/mythtv/external/libmythdvdnav/libmythdvdnav.pro b/mythtv/external/libmythdvdnav/libmythdvdnav.pro index fcc25f43ca5..a2e0456adcb 100644 --- a/mythtv/external/libmythdvdnav/libmythdvdnav.pro +++ b/mythtv/external/libmythdvdnav/libmythdvdnav.pro @@ -42,8 +42,6 @@ DEFINES += DVDREAD_VERSION_MICRO=$$dvdread_micro DEFINES += DVDREAD_VERSION=$$dvdread_version DEFINES += DVDREAD_VERSION_STRING=\\\"$$dvdread_version\\\" -DEFINES += HAVE_AV_CONFIG_H - # DEFINES += LOG_DEBUG TRACE QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2) diff --git a/mythtv/libs/libmythtv/io/mythavformatwriter.h b/mythtv/libs/libmythtv/io/mythavformatwriter.h index 8c7329b770a..696d3525a86 100644 --- a/mythtv/libs/libmythtv/io/mythavformatwriter.h +++ b/mythtv/libs/libmythtv/io/mythavformatwriter.h @@ -10,7 +10,6 @@ #include "libmythtv/io/mythmediawriter.h" #include "libmythtv/mythavutil.h" -#undef HAVE_AV_CONFIG_H extern "C" { #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp index 28176c3ac65..19f9cfb75ca 100644 --- a/mythtv/libs/libmythtv/mythplayer.cpp +++ b/mythtv/libs/libmythtv/mythplayer.cpp @@ -1,7 +1,4 @@ // -*- Mode: c++ -*- - -#undef HAVE_AV_CONFIG_H - // C++ headers #include #include diff --git a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h index c3c7158390d..cd894927eba 100644 --- a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h +++ b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h @@ -31,7 +31,6 @@ #include "lzo/lzo1x.h" #include "v4lrecorder.h" -#undef HAVE_AV_CONFIG_H extern "C" { #include "libavcodec/avcodec.h" } From 3029b22326725a50d78d781ae30fbb1affd27fa6 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Wed, 1 Jan 2025 01:49:38 -0500 Subject: [PATCH 13/13] configure: trim HEADERS_LIST libexiv2 has its own EXV_HAVE_SYS_MMAN_H and EXV_HAVE_UNISTD_H Switch NuppelVideoRecorder.cpp to __has_include(). Remove never defined HAVE_CONFIG_H in lirc_client.cpp. MALLOC_PREFIX is only used in FFmpeg --- mythtv/configure | 137 ++++-------------- .../recorders/NuppelVideoRecorder.cpp | 4 +- mythtv/libs/libmythui/devices/lirc_client.cpp | 5 - 3 files changed, 27 insertions(+), 119 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 59a5dd1c675..1ce135d547f 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -1584,57 +1584,43 @@ HAVE_LIST_PUB=" fast_unaligned " +HEADERS_LIST_BLURAY=" + dirent_h + dlfcn_h + mntent_h + pthread_h + strings_h + sys_dl_h + sys_time_h +" + +HEADERS_LIST_UDFREAD=" + fcntl_h + pthread_h + unistd_h +" + +HEADERS_LIST_DVDNAV=" + dlfcn_h + sys_param_h +" + +HEADERS_LIST_LIBMPEG2=" + altivec_h +" + HEADERS_LIST=" altivec_h - arpa_inet_h - asm_types_h - d3d11_h - dispatch_dispatch_h - dev_bktr_ioctl_bt848_h - dev_bktr_ioctl_meteor_h - dev_ic_bt8xx_h - dev_video_bktr_ioctl_bt848_h - dev_video_meteor_ioctl_meteor_h - direct_h dirent_h dlfcn_h - dxgidebug_h - dxva_h - ES2_gl_h - EGL_egl_h - GLES2_gl2_h fcntl_h - gsm_h - io_h - linux_videodev_h - linux_videodev2_h - mach_mach_time_h - machine_ioctl_bt848_h - machine_ioctl_meteor_h mntent_h - opencv2_core_core_c_h - OpenGL_gl3_h - poll_h pthread_h - soundcard_h - stdatomic_h strings_h sys_dl_h - sys_mman_h sys_param_h - sys_resource_h - sys_select_h - sys_soundcard_h sys_time_h - sys_un_h - termios_h - udplite_h unistd_h - valgrind_valgrind_h - vulkan_vulkan_core_h - windows_h - winsock2_h - wayland_client_h " INTRINSICS_LIST=" @@ -1769,7 +1755,6 @@ MYTHTV_CONFIG_LIST=' ' MYTHTV_HAVE_LIST=' - byteswap_h bdj_j2me fe_can_2g_modulation ftime @@ -1780,7 +1765,6 @@ MYTHTV_HAVE_LIST=' stdint_h sync_file_range close_range - sys_endian_h ' MYTHTV_LIST=' @@ -4183,8 +4167,6 @@ case $target_os in enabled x86_64 && objformat="macho64" || objformat="macho32" enabled_any pic shared x86_64 || { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; } - check_header dispatch/dispatch.h && - add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore' version_script='-exported_symbols_list' VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"' ;; @@ -5039,62 +5021,25 @@ check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwai check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)" check_builtin x264_csp_bgr x264.h X264_CSP_BGR -case "$custom_allocator" in - jemalloc) - # jemalloc by default does not use a prefix - require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc - ;; - tcmalloc) - require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc - malloc_prefix=tc_ - ;; -esac - check_func gettimeofday -check_header d3d11.h -check_header direct.h check_header dirent.h check_header dlfcn.h -check_header dxgidebug.h -check_header dxva.h check_header dxva2api.h -D_WIN32_WINNT=0x0600 check_header fcntl.h -check_header io.h -check_header mach/mach_time.h -check_header malloc.h check_header mntent.h check_func_headers mntent.h getmntent_r -check_header net/udplite.h -check_header poll.h check_header pthread.h check_header strings.h check_header sys/dl.h -check_header sys/mman.h check_header sys/param.h -check_header sys/resource.h -check_header sys/select.h check_header sys/time.h -check_header sys/un.h -check_header termios.h check_header unistd.h check_header valgrind/valgrind.h check_header vulkan/vulkan_core.h -check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox -check_header windows.h -check_header asm/types.h -check_header linux/videodev.h check_header linux/videodev2.h - -# it seems there are versions of clang in some distros that try to use the -# gcc headers, which explodes for stdatomic -# so we also check that atomics actually work here -check_builtin stdatomic_h stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)" - #Myth check for MYTHTV_HAVE_LIST -check_header byteswap.h -check_header sys/endian.h check_header va/va.h check_header va/va_x11.h check_header va/va_glx.h @@ -5105,10 +5050,6 @@ check_func_headers "sys/types.h sys/socket.h ifaddrs.h" getifaddrs check_func_headers sys/time.h gettimeofday #End MythTV check -check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 -check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 -check_type "windows.h d3d11.h" "ID3D11VideoDecoder" -check_type "windows.h d3d11.h" "ID3D11VideoContext" check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602 check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC" @@ -5440,15 +5381,6 @@ check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_def check_type "dshow.h" IBaseFilter -# check for ioctl_meteor.h, ioctl_bt848.h and alternatives -{ check_header dev/bktr/ioctl_meteor.h && - check_header dev/bktr/ioctl_bt848.h; } || -{ check_header machine/ioctl_meteor.h && - check_header machine/ioctl_bt848.h; } || -{ check_header dev/video/meteor/ioctl_meteor.h && - check_header dev/video/bktr/ioctl_bt848.h; } || -check_header dev/ic/bt8xx.h - if check_struct sys/soundcard.h audio_buf_info bytes; then enable_safe sys/soundcard.h else @@ -6385,22 +6317,6 @@ for thread in $THREADS_LIST; do fi done -if disabled stdatomic_h; then - if enabled atomics_gcc; then - add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc' - elif enabled atomics_win32; then - add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32' - elif enabled atomics_suncc; then - add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc' - elif enabled pthreads; then - add_compat atomics/pthread/stdatomic.o - add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread' - else - enabled threads && die "Threading is enabled, but no atomics are available" - add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy' - fi -fi - # Check if requested libraries were found. for lib in $AUTODETECT_LIBS; do requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found"; @@ -7041,9 +6957,6 @@ EOF test -n "$assert_level" && echo "#define ASSERT_LEVEL $assert_level" >>$TMPH -test -n "$malloc_prefix" && - echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH - if enabled cygwin ; then echo "#ifndef llrint" >> $TMPH echo "#define llrint llrint // make sure not to define twice" >> $TMPH diff --git a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp index 6f499b56172..3e53b90a67a 100644 --- a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp @@ -42,9 +42,9 @@ extern "C" { #define bswap_dbl(x) bswap_64(x) -#if HAVE_BYTESWAP_H +#if __has_include() # include /* bswap_16|32|64 */ -#elif HAVE_SYS_ENDIAN_H +#elif __has_include() # include # if !defined(bswap_16) && defined(bswap16) # define bswap_16(x) bswap16(x) diff --git a/mythtv/libs/libmythui/devices/lirc_client.cpp b/mythtv/libs/libmythui/devices/lirc_client.cpp index 4df76f62f68..24969d7a595 100644 --- a/mythtv/libs/libmythui/devices/lirc_client.cpp +++ b/mythtv/libs/libmythui/devices/lirc_client.cpp @@ -12,11 +12,6 @@ * * System wide LIRCRC support by Michal Svec */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include #include #include