Mailing List Archive

Build system issues with FFmpeg 5.1
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.

Thanks,

Scott


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Build system issues with FFmpeg 5.1 [ In reply to ]
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
```

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Build system issues with FFmpeg 5.1 [ In reply to ]
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.

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Build system issues with FFmpeg 5.1 [ In reply to ]
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

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Build system issues with FFmpeg 5.1 [ In reply to ]
On 8/30/22 13:50, Scott Theisen wrote:
>
>
> 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
>
>
Both in the commit message and comments in the configure above the awk
line. That way somebody looking at the code understands the reason for
the unusual construct.

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org