[mythtv] [RFC] New Win32 build script

Lawrence Rust lvr at softsystem.co.uk
Thu Dec 9 19:38:51 UTC 2010


On Thu, 2010-12-09 at 12:41 -0500, Doug Lytle wrote:
> Lawrence Rust wrote:
> > I would be most pleased if anyone can try this and let me know your
> > experiences.  If all goes well I'll submit it to Trac.
> >
> > Comments please...
> >    
> 
> My first attempt at cross compiling.

Thanks for the report.

[snip]
> I had to modify the xprefix to i586-pc-mingw32 for Mandriva.

That's something I can test for and add to the script.

> I get a failure to compile on Flac:
> 
> i586-pc-mingw32-gcc -DHAVE_CONFIG_H -I. -I. -I../.. 
> -DFLaC__INLINE=__inline__ -DNDEBUG -I../.. -I./include -I../../include 
> -I/home/doug/t/mythbuild/include -O3 -funroll-loops -finline-functions 
> -Wall -W -Winline -g -O2 -MT stream_decoder.lo -MD -MP -MF 
> .deps/stream_decoder.Tpo -c stream_decoder.c  -DDLL_EXPORT -DPIC -o 
> .libs/stream_decoder.o
> In file included from stream_decoder.c:56:
> ../../include/share/alloc.h:41:5: error: #error
> In file included from stream_decoder.c:56:
> ../../include/share/alloc.h: In function 'safe_malloc_mul_2op_':
> ../../include/share/alloc.h:120: error: 'SIZE_T_MAX' undeclared (first 
> use in this function)
> ../../include/share/alloc.h:120: error: (Each undeclared identifier is 
> reported only once
> ../../include/share/alloc.h:120: error: for each function it appears in.)
> ../../include/share/alloc.h: In function 'safe_malloc_mul_3op_':
> ../../include/share/alloc.h:130: error: 'SIZE_T_MAX' undeclared (first 
> use in this function)
> ../../include/share/alloc.h: In function 'safe_malloc_mul2add_':
> ../../include/share/alloc.h:143: error: 'SIZE_T_MAX' undeclared (first 
> use in this function)
> ../../include/share/alloc.h: In function 'safe_realloc_mul_2op_':
> ../../include/share/alloc.h:196: error: 'SIZE_T_MAX' undeclared (first 
> use in this function)
> make[4]: *** [stream_decoder.lo] Error 1

This looks like either the patch /mythpatches/flac-1.2.1/10-stdint.diff
failed it didn't fix the original problem for your compiler.  Can you
confirm line 32 of mythwork/flac-1.2.1/include/share/alloc.h is:

#if !defined _MSC_VER && (!defined __MINGW32__ || __GNUC__ >= 4) && !defined __EMX__

Which it should be after the patch.  If it is then your mingw's stdint.h
doesn't define SIZE_MAX or SIZE_T_MAX - strange (required in C99) but
possible.  Could you edit alloc.h line 40 to add the following two lines
and retry?

#ifndef SIZE_MAX
# ifndef SIZE_T_MAX
#  ifdef _MSC_VER
#   define SIZE_T_MAX UINT_MAX
+#  elif defined UINTPTR_MAX
+#   define SIZE_T_MAX UINTPTR_MAX
#  else
#   error
#  endif
# endif
# define SIZE_MAX SIZE_T_MAX
#endif

If that fixes it I'll incorporate it into the patch.

Thanks for the feedback.

-- Lawrence




More information about the mythtv-dev mailing list