On Sat, Sep 5, 2009 at 11:58 AM, David MatthewsDavid.Matthews@prolingua.co.uk wrote:
Gabriel Dos Reis wrote:
On Fri, Sep 4, 2009 at 3:49 AM, David MatthewsDavid.Matthews@prolingua.co.uk wrote:
Doing an out-of-source build won't currently work. ?You may be able to build the library but compiling the basis library into Poly/ML assumes that it is running within the directory that contains the sources.
OK,thanks! ?Is it reasonable to expect that restriction to be lifted in a recent future?
It should work in the next release. ?I've added support for an option to indicate where the source files are to be found but at the moment the pre-built compilers in the imports directory don't understand this.
OK.
Looking at sighandler.cpp:142, I'm under the impression that the line
#if (!defined(WINDOWS_H) && defined(HAVE_LIBPTHREAD) && defined(HAVE_PTHREAD_H) && defined(HAVE_SEMAPHORE_H))
should just be
#ifdef USE_PTHREAD_SIGNALS
because that macro is already defined at line 86. ?Is that correct?
Yes, I've tidied this up.
OK.
After I locally made that change, the build progressed a bit further.
I could not see anything wrong at line 527. ?I had a look at the header <semaphore.h> under /mingw/mingw32/include and found that indeed sema_open is declared there to return an int. ?The macro SEM_FAILED is not defined. ?so my current recommendation is to avoid <semaphore.h> on MinGW. ?(test for the C preprocessor __MINGW__)
Actually, this shouldn't be used if the pthread library isn't used. I've changed the ifdefs so that it doesn't include this. ?Generally, I try to avoid having ifdefs that check for specific operating systems. It's better to check for the presence of specific features.
I fully agree and that is my policy as well. In this specific case, the test for the feaure (pthread.h) appears positive, but the feature is broken on that specific platform. You're right in your fixes.
Another observation: __darwin_mcontext32 should be checked only on darwin platforms.
There are various header files that are operating-system specific. ?It's easier and probably more reliable to search for the files in all cases rather than only check on certain platforms. ?Unless it breaks something I'd prefer to leave it as it is.
Well, my worry is that an unconditional test that looks for an OS-specific header may report an unreliable result. ?For example, I would suggest NOT testing for <semaphore.h> when on MinGW:
I guess this a matter of taste. ?I prefer to have configure report what is present or absent and then to make the choices about what to use in the code itself. ?There's sometimes a series of options depending on exactly what is available. ?In this case semaphore.h is present so configure should report that. ?It may be that it can't be used in this particular place but it could be used elsewhere.
Incidentally, I've just installed MinGW/MSys and semaphore.h isn't there. ?I have fixed a few other things and built poly successfully so if you update from SVN it should work.
I'm using the latest MinGW/MSYS releases, with full developer toolsets. On my machine (Windows XP, 32-bit), the header is located under /ming/mingw32/include.
The in-source build indeed is now OK. Thanks!
The out-of-source build still fails for libpolyml. Now, it is
g++ -DHAVE_CONFIG_H -I. -I../../../polyml.svn/polyml/libpolyml -I.. -DWINDOWS_P C -Wall -O3 -mthreads -MT Console.lo -MD -MP -MF .deps/Console.Tpo -c ../../../p olyml.svn/polyml/libpolyml/Console.cpp -DDLL_EXPORT -DPIC -o .libs/Console.o ../../../polyml.svn/polyml/libpolyml/Console.cpp:61:22: error: resource.h: No su ch file or directory ../../../polyml.svn/polyml/libpolyml/Console.cpp: In function 'void CheckForBuff erSpace(int)': ../../../polyml.svn/polyml/libpolyml/Console.cpp:269: warning: suggest parenthes es around '&&' within '||' ../../../polyml.svn/polyml/libpolyml/Console.cpp: In function 'LRESULT EditSubcl assProc(HWND__*, UINT, WPARAM, LPARAM)': ../../../polyml.svn/polyml/libpolyml/Console.cpp:396: error: 'ID_EDIT_PASTE' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp: In function 'LRESULT WndProc(H WND__*, UINT, WPARAM, LPARAM)': ../../../polyml.svn/polyml/libpolyml/Console.cpp:575: error: 'ID_EDIT_COPY' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp:579: error: 'ID_EDIT_PASTE' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp:623: error: 'ID_HELP_ABOUT' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp:624: error: 'IDD_ABOUT_POLYML' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp:628: error: 'ID_FILE_QUIT' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp:634: error: 'ID_RUN_INTERRUPT' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp: In function 'int PolyWinMain(H INSTANCE__*, HINSTANCE__*, TCHAR*, int, exportDescription*)': ../../../polyml.svn/polyml/libpolyml/Console.cpp:787: error: 'IDI_ICON' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp:791: error: 'IDR_MENU' was not declared in this scope ../../../polyml.svn/polyml/libpolyml/Console.cpp: In function 'int initDDEContro l(char*)': ../../../polyml.svn/polyml/libpolyml/Console.cpp:991: warning: deprecated conver sion from string constant to 'char*' make[2]: *** [Console.lo] Error 1
-- Gaby