Now under development....
mp3, MOD, etc... plug-ins are available:)
2002/4/10: revised
- include.tar.gz (w32api 1.2 section)
- gcc_Makefile.diff (gcc 3.0.4 section)
- -e _DllMainCRTStartup flag (building DLL section)
- using C++ section added
$ tar zxvf .../binutils-2.11.2.tar.gz $ cd binutils-2.11.2 $ mkdir build $ cd build $ ../configure --prefix=/usr/local/wince --target=mips-pe $ make $ sudo make install
If you want to install to another path, you shold change prefix parameter so that you like.
$ tar zxvf .../gcc-core-3.0.4.tar.gz $ tar zxvf .../gcc-g++-3.0.4.tar.gz $ cd gcc-3.0.4 $ mkdir build $ cd build $ ../configure --prefix=/usr/local/wince --target=mips-pe --with-gnu-as $ patch < .../gcc_Makefile.diff $ make $ sudo make install $ cd /usr/local/wince/lib/gcc-lib/mips-pe/3.0.4 $ patch < .../specs.diff
I made a patch file for specs. it fix followings.
So if you installed another path you should fix this spec file or use -L flags on linking.
gcc_Makefile.diff is also needed for building libgcc.a as little-endian binary. Unless this patch, libgcc.a may be for big endian.
$ tar zxvf w32api-1.2.tar.gz $ cp -rf include/* /usr/local/wince/include/ $ rm -rf include lib $ cd /usr/local/wince/include $ patch -p1 < .../w32api-1.2-hpcmips.diff $ tar zxvf < .../include.tar.gz
In CE, we can use str* and wcs* functions with coredll. This is prototype for that.
gcc for mips don't support __attribute__((cdecl)) and __attribute__((stdcall)), but it's not needed on mips to begin with.
gcc define _MIPSEL instead of MIPS.
$ mdkir /usr/local/wince/lib/hpcpro $ cp -rf .../HPC30SDK/Lib/* /usr/local/wince/lib/hpcpro $ cd /usr/local/wince/lib/hpcpro/mips $ for f in *.lib; do mv $f lib${f/.lib/.a}; done
You can get SDKs for CE from Microsoft's website freely.
$ export PATH="/usr/local/wince/bin:$PATH"
If you use only this cross compiler, add "/usr/local/wince/mips-pe/bin" too. With it you type just gcc instead of mips-pe-gcc.
/* test.c */ #include <windows.h> int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { MessageBox(NULL, L"compiled by gcc 3.0.4", L"TEST", MB_OK); return 0; }
$ mips-pe-gcc -o test.exe test.c -lcoredll
; test.def EXPORTS FooFunc @1 BarFunc
$ mips-pe-gcc -shared -e _DllMainCRTStartup -o test.dll test.def foo.o bar.o -lcoredll
Using C++, you may get error "undefined reference to '__gxx_personality_v0'" on link phase. You can avoid from this error with -fno-exceptions flag. But in this way, you can not use any exceptions, You know.