[mythtv] Build system issues with FFmpeg 5.1

Scott Theisen scott.the.elm at gmail.com
Tue Aug 30 17:50:32 UTC 2022



On 8/26/22 10:47, Peter Bennett wrote:
>
> On 8/21/22 21:50, Scott Theisen wrote:
>> On 8/21/22 21:43, Scott Theisen wrote:
>>> Hello all,
>>>
>>> When I copy https://github.com/ulmus-scott/FFmpeg/tree/release5.1 
>>> into MythTV and constify some pointers in libmyth/audio to satisfy 
>>> -fpermissive, I get the following error:
>>>
>>> ```
>>> make[2]: *** No rule to make target 
>>> '../../external/FFmpeg/libswresample/libmythswresample.so.', needed 
>>> by 'libmyth-33.so.33.0.0'.  Stop.
>>> ```
>>>
>>> It should be `libmythswresample.so.4`.  In 
>>> `mythtv/libs/libmyth/Makefile`, libmythavutil.so.57 has its version 
>>> number, but libmythavcodec also is missing its version number.
>>>
>>> I suspect this is due to FFmpeg splitting their version macros 
>>> across two files, version_major.h and version.h.  libavutil has an 
>>> empty version_major.h, only using version.h.
>>>
>>> The problem appears to be in configure in get_version() on line 
>>> 7749, but I have no idea how to fix it.  (Concatenating both files 
>>> before processing with awk?)
>>>
>>> Any suggestions are greatly appreciated.
>>>
>>
>> This appears to work, unless someone has a better suggestion:
>>
>> ```
>> diff --git a/mythtv/configure b/mythtv/configure
>> index 69c0a8f4c6..4fcc627a9a 100755
>> --- a/mythtv/configure
>> +++ b/mythtv/configure
>> @@ -7750,7 +7750,8 @@ get_version(){
>>      lcname=lib${1}
>>      name=$(toupper $lcname)
>>      file=$source_path/external/FFmpeg/$lcname/version.h
>> -    eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" 
>> "$file")
>> + file_major=$source_path/external/FFmpeg/$lcname/version_major.h
>> +    eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" 
>> "$file_major" "$file")
>>      enabled raise_major && eval 
>> ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
>>      eval 
>> ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
>>      eval echo "${lcname}_VERSION=\$${name}_VERSION" >> $TMPMAK
>> ```
>>
>>
> I suggest add comments above the awk stuff, explaining what the 
> purpose is, as you did above, that is is needed because of the two 
> version header files.
>

Should I add the comments to configure, or is my commit message sufficient?

```
mythtv/configure: fix detection of FFmpeg's version numbers

FFmpeg has split their version.h into version_major.h and version.h.

libavutil has an empty version_major.h.
```

Scott



More information about the mythtv-dev mailing list