[Freedos-devel] problems cross-compiling gnuchess
I guess I need to mention what I did before and why: Ok... I directly plugged http://www.delorie.com/pub/djgpp/current/v2gnu/pth207b.zip inside: /home/paul/opt/cross/lib/gcc/i386-pc-msdosdjgpp/10.2.0/ which I feels is a bit wrong... but working cowboy approach. [I now think /home/paul/opt/cross/lib/ and /home/paul/opt/cross/include/ would have been the right place to put those] I then did the same with: http://www.delorie.com/pub/djgpp/current/v2tk/ls080b.zip (to have sys/socket.h) And then later I followed advice from: https://www.freebasic.net/wiki/DevBuildDos (without reading much): The file pthread.h in C:\DJGPP\include must be modified, by removing the lines: #include /* for sockaddr */ #include /* for struct timespec */ #include And I now get: paul@kasparno:~/Téléchargements/gnuchess$ CLANG=C make Making all in src make[1] : on entre dans le répertoire « /home/paul/Téléchargements/gnuchess/src » make all-recursive make[2] : on entre dans le répertoire « /home/paul/Téléchargements/gnuchess/src » Making all in frontend make[3] : on entre dans le répertoire « /home/paul/Téléchargements/gnuchess/src/frontend » i386-pc-msdosdjgpp-g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src -I../../lib -g -O2 -MT pgn.o -MD -MP -MF .deps/pgn.Tpo -c -o pgn.o pgn.cc In file included from ../../lib/gettext.h:54, from pgn.cc:38: /home/paul/opt/cross/lib/gcc/i386-pc-msdosdjgpp/10.2.0/include/c++/cstdlib:151:11: error: 'malloc' has not been declared in '::' 151 | using ::malloc; | ^~ /home/paul/opt/cross/lib/gcc/i386-pc-msdosdjgpp/10.2.0/include/c++/cstdlib:164:11: error: 'realloc' has not been declared in '::' 164 | using ::realloc; | ^~~ /home/paul/opt/cross/lib/gcc/i386-pc-msdosdjgpp/10.2.0/include/c++/cstdlib:169:11: error: 'system' has not been declared in '::' 169 | using ::system; | ^~ make[3]: *** [Makefile:421 : pgn.o] Erreur 1 make[3] : on quitte le répertoire « /home/paul/Téléchargements/gnuchess/src/frontend » make[2]: *** [Makefile:576 : all-recursive] Erreur 1 make[2] : on quitte le répertoire « /home/paul/Téléchargements/gnuchess/src » make[1]: *** [Makefile:416 : all] Erreur 2 make[1] : on quitte le répertoire « /home/paul/Téléchargements/gnuchess/src » make: *** [Makefile:516 : all-recursive] Erreur 1 paul@kasparno:~/Téléchargements/gnuchess$ I was not expecting errors in cstdlib.___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
[Freedos-devel] Problems cross-compiling gnuchess
Frankly, this is in part a note to myselft... but could be considered a follow-up to me trying to compile gnuchess. So after "plugging" http://www.delorie.com/pub/djgpp/current/v2gnu/gpp1020b.zip and http://www.delorie.com/pub/djgpp/current/v2tk/ls080b.zip The problem is linked to the fact that CPP stdlib have been (I think) compiled with --disable-nls . In gettext.h, if NLS is disabled, it #include which seems an old not correct anymore way to include stuff: https://developers.redhat.com/blog/2016/02/29/why-cstdlib-is-more-complicated-than-you-might-think In fact I have tried: #include //#include int main (){ return 0; } which does not find cstdllib.h. So I commented out the #include at line 54 of gnuchess lib/gettext.h and configure gnuchess with: ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ./configure --build=i686-pc-linux-gnu --host=i386-pc-msdosdjgpp which is a trick (workaround) I have taken from: https://github.com/maxmind/libmaxminddb/issues/144#issuecomment-757101861 leaving out --with-gnu-ld ... not thinking it would apply to cross-compiling... unsure. And now I get: Making all in adapter make[3] : on entre dans le répertoire « /home/paul/Téléchargements/gnuchess/src/adapter » i386-pc-msdosdjgpp-g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -MT adapter.o -MD -MP -MF .deps/adapter.Tpo -c -o adapter.o adapter.cpp adapter.cpp:32:10: fatal error: sys/select.h: No such file or directory 32 | #include | ^~ compilation terminated. I begin to suspect directly compiling under DJGPP rather than cross-compiling might be easier.___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel