[FFmpeg-devel] [PATCH] libx264: support for BUILD >= 63
Måns Rullgård
mans
Wed Sep 17 00:52:50 CEST 2008
Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> On date Tuesday 2008-09-16 11:28:56 +0200, Stefano Sabatini encoded:
>> On date Tuesday 2008-09-16 09:24:40 +0100, M?ns Rullg?rd encoded:
>> > Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> [...]
>> > It's always been expected that uses should have a recent version of
>> > libraries they build FFmpeg against. Testing every little thing would
>> > become such a chore.
>>
>> We know which version we need, and a simple check in the configure
>> should ensure that the user is compiling against it.
>>
>> > > And while we're at it we could assert(X264_BUILD == x264_build()) in
>> > > the init code (assuming that function is implemented).
>> >
>> > It a little harsh with assert(), wouldn't you say? In fact, this
>> > shouldn't be needed at all, assuming libx264 uses correct shared
>> > library versioning.
>>
>> See my other mail in response to Dark Shikari, but I have not a strong
>> opinion on this, the configure check may be sufficient.
>
> Attached there is a first experiment with check_version.
>
> Regards.
> --
> FFmpeg = Furious & Frightening Martial Portentous Extravagant Gymnast
>
> Index: configure
> ===================================================================
> --- configure (revision 15339)
> +++ configure (working copy)
> @@ -521,6 +521,29 @@
> EOF
> }
>
> +check_version(){
> + log check_version "$@"
> + headers=$1
> + version_def=$2
> + version_num=$3
> + shift 3
> + incs=""
> + for hdr in $headers; do
> + incs="$incs
> +#include <$hdr>"
> + done
> + check_ld "$@" <<EOF
> +$incs
> +int main(int argc, char **argv){
> + if ($version_def >= $version_num)
> + return 0;
> + else
> + return 1;
> +}
> +EOF
> + check_cmd $TMPE
> +}
> +
> check_lib(){
> log check_lib "$@"
> header="$1"
> @@ -608,6 +631,17 @@
> check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
> }
>
> +require3(){
> + name="$1"
> + headers="$2"
> + func="$3"
> + version_def="$4"
> + version_num="$5"
> + shift 5
> + check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
> + check_version "$headers" $version_def $version_num "$@" || die "ERROR: $name requires $version_def >= $version_num"
> +}
Rejected. It doesn't work if cross-compiling. It may have other
faults too; I didn't check carefully. Besides, I don't think this
check is necessary.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list