Erik de Castro Lopo
2008-May-10 04:27 UTC
[Flac-dev] Patch : Fix cross-compiling from Linux to windows
Hi all, The following patch fixes cross compiling from Linux to windows. The existing code was doing: #if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */ #endif when it seems to make much more sense to just test for the presence of <stdint.h> and do: #ifdef HAVE_STDINT_H #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */ #endif It is not possible to cross compile from Linux to windows, but the tests don't currently work. Josh, are you interested in fixing this? It should be possible to run the tests under Wine. Cheers, Erik cvs diff -u configure.in include/share/alloc.h Index: configure.in ==================================================================RCS file: /cvsroot/flac/flac/configure.in,v retrieving revision 1.151 diff -u -r1.151 configure.in --- configure.in 28 Feb 2008 05:34:21 -0000 1.151 +++ configure.in 10 May 2008 04:24:21 -0000 @@ -48,6 +48,8 @@ AC_C_BIGENDIAN +AC_CHECK_HEADERS(stdint.h) + AC_CHECK_TYPES(socklen_t, [], []) dnl check for getopt in standard library Index: include/share/alloc.h ==================================================================RCS file: /cvsroot/flac/flac/include/share/alloc.h,v retrieving revision 1.5 diff -u -r1.5 alloc.h --- include/share/alloc.h 28 Feb 2008 05:34:25 -0000 1.5 +++ include/share/alloc.h 10 May 2008 04:24:22 -0000 @@ -28,7 +28,7 @@ */ #include <limits.h> /* for SIZE_MAX */ -#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ +#ifdef HAVE_STDINT_H #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */ #endif #include <stdlib.h> /* for size_t, malloc(), etc */ -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- The Earth is around 70% water. Fish rule the seas. Humans are over 90% water. It's only a matter of time.
Erik de Castro Lopo
2008-May-10 21:58 UTC
[Flac-dev] Patch : Fix cross-compiling from Linux to windows
Erik de Castro Lopo wrote:> It is not possible to cross compile from Linux to windows, but the > tests don't currently work.Its is *now* possible .. Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "OSX - because making unix useable was easier than fixing windows." -- from slashdot
Josh Coalson
2008-May-23 17:36 UTC
[Flac-dev] Patch : Fix cross-compiling from Linux to windows
--- Erik de Castro Lopo <mle+la at mega-nerd.com> wrote:> Hi all, > > The following patch fixes cross compiling from Linux to windows. > > The existing code was doing: > > #if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ > #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get > it */ > #endif > > when it seems to make much more sense to just test for the presence > of <stdint.h> and do: > > #ifdef HAVE_STDINT_H > #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get > it */ > #endifhmm, ok, will do that. the VC projects will also have to be fixed because they don't have a config.h> It is [now] possible to cross compile from Linux to windows, but the > tests don't currently work. Josh, are you interested in fixing > this? It should be possible to run the tests under Wine.the tests work for me under cygwin, I run them for every release. what happens for you?
Erik de Castro Lopo
2008-May-23 21:11 UTC
[Flac-dev] Patch : Fix cross-compiling from Linux to windows
Josh Coalson wrote:> > It is [now] possible to cross compile from Linux to windows, but the > > tests don't currently work. Josh, are you interested in fixing > > this? It should be possible to run the tests under Wine. > > the tests work for me under cygwin, I run them for every release. > what happens for you?Yes, they worik as they should under Cygwin, but running the tests for the cross-compiled windows binaries is a little more complex. On Cygwin, windows can figure out that if it is told to run "program", it should look for a file named "program.exe". Linux OTOH will try to run "program" and does not know to look for "program.exe". The result looks like: ERROR can't find test_cuesheet executable FAIL: ./test_grabbag.sh ERROR can't find flac executable FAIL: ./test_flac.sh ERROR can't find flac executable FAIL: ./test_metaflac.sh ERROR can't find flac executable FAIL: ./test_seeking.sh ERROR can't find flac executable FAIL: ./test_streams.sh For this particular case, these shell scripts need to figure out that they are being run as windows binaries on a Linux system and then use then add the appropriate file extension. Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- Gambling(n): A discretionary tax on those asleep during high school maths.