Hi David,
I tried to build Poly/ML on Windows using the MSYS/MinGW toolchains, but was unsuccessful The build failed with:
g++ -DHAVE_CONFIG_H -I. -I.. -I../../../polyml.svn/polyml/libpolyml -DWINDOWS_P C -Wall -O3 -mthreads -MT mpoly.lo -MD -MP -MF .deps/mpoly.Tpo -c ../../../polym l.svn/polyml/libpolyml/mpoly.cpp -DDLL_EXPORT -DPIC -o .libs/mpoly.o ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:24:23: error: winconfig.h: No suc h file or directory In file included from ../../../polyml.svn/polyml/libpolyml/mpoly.h:26, from ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:60: ../../../polyml.svn/polyml/libpolyml/../polyexports.h:78: warning: 'PolyWinMain' initialized and declared 'extern' ../../../polyml.svn/polyml/libpolyml/../polyexports.h:78: error: 'HINSTANCE' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/../polyexports.h:78: error: 'HINSTANCE' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/../polyexports.h:79: error: 'LPTSTR' was no t declared in this scope ../../../polyml.svn/polyml/libpolyml/../polyexports.h:79: error: expected primar y-expression before 'int' ../../../polyml.svn/polyml/libpolyml/../polyexports.h:79: error: expected primar y-expression before '*' token ../../../polyml.svn/polyml/libpolyml/../polyexports.h:79: error: 'exports' was n ot declared in this scope ../../../polyml.svn/polyml/libpolyml/../polyexports.h:79: error: initializer exp ression list treated as compound expression In file included from ../../../polyml.svn/polyml/libpolyml/pexport.h:27, from ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:65: ../../../polyml.svn/polyml/libpolyml/exporter.h:58: error: ISO C++ forbids decla ration of 'FILE' with no type ../../../polyml.svn/polyml/libpolyml/exporter.h:58: error: expected ';' before ' *' token ../../../polyml.svn/polyml/libpolyml/mpoly.cpp: In function 'int polymain(int, c har**, exportDescription*)': ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:143: error: 'printf' was not decl ared in this scope ../../../polyml.svn/polyml/libpolyml/mpoly.cpp: In function 'void Usage(const ch ar*)': ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:233: error: 'printf' was not decl ared in this scope ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:236: error: 'printf' was not decl ared in this scope ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:238: error: 'stdout' was not decl ared in this scope ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:238: error: 'fflush' was not decl ared in this scope ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:243: error: '_T' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/mpoly.cpp: In function 'char* RTSArgHelp()' : ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:258: error: 'sprintf' was not dec lared in this scope ../../../polyml.svn/polyml/libpolyml/mpoly.cpp:261: warning: statement has no ef fect make[2]: *** [mpoly.lo] Error 1 make[2]: Leaving directory `/home/gdr/Desktop/sandbox/build/polyml/libpolyml'
This is an out-of-source build, meaning that I keep the build directory separate from the vanilla Poly/ML source tree. I had a quick look for winconfig.h and was under the impression that it was supposed to replace config.h (which is generated anyway at configure time). For some reason, it is not being seen by the preprocessor. Why keep winconfig.h when config.h (that truly reflects the host/build machine characteristics) is generated at configure time?
I also noticed that pthread is being check for even on Windows. I believe that is not good. On Windows, one should just check for Windows thread support. The reason is that configure may report that pthread.h exists without the full semantics support needed by Poly/ML (which is the case on my machine, Windows XP SP3). A second point is that in such circumstances, checking for HAVE_PTHREAD_H, then for WIN32 is not good. The test should be reversed. One should first check for WIN32, then HAVE_PTHREAD_H.
Another observation: __darwin_mcontext32 should be checked only on darwin platforms.
Best,
-- Gaby