[MPlayer-dev-eng] [PATCH] External libass detection in mingw

Josh joshf87 at live.com
Mon Jan 14 08:13:34 CET 2013


On 1/12/2013 08:05, Xidorn Quan wrote:
> On Sat, Jan 12, 2013 at 7:28 PM, Josh <joshf87 at live.com> wrote:
>> -        if cc_check -lass ; then
>> -            res_comment="external"
>> -            extra_ldflags="$extra_ldflags -lass"
>> -        elif test "$ass_internal" = auto ; then
>> +        for ld_ass in "-lass" "-lass -lfreetype" "-lass -lenca -lfreetype" ; do
>
> I believe it should be better to use "$($_freetypeconfig --libs)"
> instead of "-lfreetype" here.
>
>> +          if cc_check $ld_ass ; then
>> +              res_comment="external"
>> +              extra_ldflags="$extra_ldflags $ld_ass"
>> +          fi
>> +        done
>> +        if test "$ass_internal" = auto ; then
>>               ass_internal=yes
>>           else
>>               _ass=no
>

The patch sucks anyway (doesn't undefine ass_internal).

The external libass check fails because it's compiled with ENCA & -lenca 
isn't in the "cc_check", after modifying the cc_check it gives a "yes 
(external)". I didn't modify "extra_ldflags", because strangely, -lenca 
is added automatically after -lass in EXTRALIBS.

It doesn't read from pkgconfig or other config file, and putting ENCA 
before ASS/SSA didn't change that "-lenca" was required for the cc_check.

Then the external libass will fail to link because "-lfreetype" is 
missing. This is what I end up with:

if cc_check -lass -lenca ; then
   res_comment="external"
   extra_ldflags="$extra_ldflags -lass $($_freetypeconfig --libs)"

Using internal libass (external fails):

============ Checking for SSA/ASS support ============

#include <ft2build.h>
#include FT_FREETYPE_H
#if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 
2) && (FREETYPE_PATCH < 1)))
#error "Need FreeType 2.2.1 or newer"
#endif
int main(void) { return 0; }

cc -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith 
-Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes 
-Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement 
-std=gnu99 -Werror-implicit-function-declaration -O4 -march=i486 
-mtune=generic -pipe -ffast-math -fomit-frame-pointer 
-fno-tree-vectorize /tmp/mplayer-configure-4778-3092/tmp.c -Ilibdvdread4 
-I. -Iffmpeg  -fno-common  -I/mingw/include/  -I/mingw/include/freetype2 
-I/mingw/include -static  -lwinmm -ffast-math -lws2_32 -liconv -lpng -lz 
-lmng -ljpeg -lz -ljpeg -lbluray -lcdio_cdda -lcdio -lcdio_paranoia 
-lwinmm -L/mingw/lib -lfreetype -lz -lfontconfig -lexpat -lfreetype -lz 
-lfribidi  -L/mingw/lib -lcaca -lz -lSDL -lwinmm -lgdi32 -ldxguid 
-lopengl32 -lgdi32 -lwinmm -lgdi32  -o 
/tmp/mplayer-configure-4778-3092/tmp.exe -I/mingw/include/freetype2 
-I/mingw/include -L/mingw/lib -lfreetype -lz -lm



#include <ass/ass.h>
int main(void) {
#if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00910000
#error "libass version too old"
#endif
   ass_process_force_style(0);
   return 0;
}

cc -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith 
-Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes 
-Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement 
-std=gnu99 -Werror-implicit-function-declaration -O4 -march=i486 
-mtune=generic -pipe -ffast-math -fomit-frame-pointer 
-fno-tree-vectorize /tmp/mplayer-configure-4778-3092/tmp.c -Ilibdvdread4 
-I. -Iffmpeg  -fno-common  -I/mingw/include/  -I/mingw/include/freetype2 
-I/mingw/include -static  -lwinmm -ffast-math -lws2_32 -liconv -lpng -lz 
-lmng -ljpeg -lz -ljpeg -lbluray -lcdio_cdda -lcdio -lcdio_paranoia 
-lwinmm -L/mingw/lib -lfreetype -lz -lfontconfig -lexpat -lfreetype -lz 
-lfribidi  -L/mingw/lib -lcaca -lz -lSDL -lwinmm -lgdi32 -ldxguid 
-lopengl32 -lgdi32 -lwinmm -lgdi32  -o 
/tmp/mplayer-configure-4778-3092/tmp.exe -lass -lm
E:/Buildsys/MinGW/lib\libass.a(ass_utils.o): In function 
`ass_guess_buffer_cp':
E:\Buildsys\MinGW\src\libass-git\libass/ass_utils.c:199: undefined 
reference to `enca_get_languages'
E:\Buildsys\MinGW\src\libass-git\libass/ass_utils.c:210: undefined 
reference to `enca_analyser_alloc'
E:\Buildsys\MinGW\src\libass-git\libass/ass_utils.c:211: undefined 
reference to `enca_analyse_const'
E:\Buildsys\MinGW\src\libass-git\libass/ass_utils.c:212: undefined 
reference to `enca_charset_name'
E:\Buildsys\MinGW\src\libass-git\libass/ass_utils.c:217: undefined 
reference to `enca_analyser_free'
collect2: ld returned 1 exit status


Result is: yes


More information about the MPlayer-dev-eng mailing list