On 7-Aug-09, at 7:51 AM, Ivan Kelly wrote:
Im compiling gambit on windows with ___SHARED defined, in a symbian OS emulator environment. I've managed to get it working without issue compiling to one big monolith, taking pointers from the openwatcom batch file (also compiled with gcce and running on phone).
However, ___SHARED is proving to be a bit more difficult. The dll compiles with very little issue. ___LIBRARY and ___PRIMAL are defined for all *.c inputs to that, and it compiles without error apart from the unused variables, whose warnings i've hidden.
gsi is proving trickier though. In getting a load of errors for ___gstate being defined in many places. Also, ___G__20__gsilib is twice defined.
Can you try this recipe:
in lib/:
for each file <file>.c: gcc <many options> -c -o <file>.o -D___PRIMAL -D___SHARED - D___LIBRARY <file>.c
gcc -shared -o libgambc.dll <all .o files> -lws2_32
in gsi/:
for each file <file>.c in _gsilib.c _gambcgsi.c: gcc <many options> -c -o <file>.o -D___SHARED -D___LIBRARY <file>.c
gcc -shared -o libgambcgsi.dll _gsilib.o _gambcgsi.o ../lib/ libgambc.dll -lws2_32
for each file <file>.c in gsi.c _gsi_.c: gcc <many options> -c -o <file>.o -D___SHARED <file>.c
gcc <many options> -o gsi.exe _gsi.o _gsi_.o ../lib/libgambc.dll - lws2_32 libgambcgsi.dll
I've tested it on Windows with MinGW, so I expect it to also work on similar OSes.
Note that -D___SHARED is passed to all compilations of .c files.
Marc