I did some investigation on the Agar source code and found that the -lc parameters for the linker comes from the libtool script that is generated when you compile the source. And the parameter is used when the script detects (using uname command) that you're using Linux and sets the host variable to (in my case) x86_64-unknown-linux-gnu. It creates that variable using the mentioned command uname so when I tried to cross-compile Agar on Linux using mingw32 the host variable contained that string.
So, I created a simple shell script called uname and placed it on the PATH where the binaries used to cross-compile reside. The new uname, when I tried to cross-compile, generates the host variable with the value i586-pc-mingw32 now and that solved the problem of the -lc parameter. Now, Agar compiles using mingw32 under Linux (I also had to pass the --disable-threads, --without-jpeg and --without-gl to the configure script, more about this later) but now I have the problem that the demos does find Agar but it says that it doesn's work so I can't compile them. Agar seems to be compiled fine but it doesn't create shared libraries, just static ones. This is my first problem. The second problem that I found is about the additional parameters that I had to pass to the configure script. --disable-threads is not a problem because I'm not using the pthreads library for win32 so I used that parameter because the configure were detecting the pthreads for Linux.I had to use --without-jpeg because the script was again detecting the libjpeg from Linux and make the compilation failed because of some duplication on headers and anyway, for what I was seeing the win32 version doesn't need that library. Finally, I had to use --without-gl because the script was detecting the opengl library for Linux even when the mingw32 has their own opengl library for cross-compiling opengl applications, the problem is that I didn't find how to tell to the configure script where to look for them (in my case, they're on /usr/i586-mingw32msvc/include/GL and /usr/i586-mingw32msvc/lib but the script just looks for common Linux PATHs). Well, I hope all (or something) of this helps to solve my problem of cross-compiling Agar under Linux. I think that we're close, but I don't know if all these that I mention is just wrong, if the uname script that I create for example has sense or what. Thanks for all. Ernesto PS: if you can't understand something just let me know that I'll try to explain it in some other way because English is not my native language, anyway I think that you can already figure that ;-) _______________________________________________ Agar mailing list [email protected] http://libagar.org/lists.html
