2013/1/6 JonY <jon_y@users.sourceforge.net>
On 1/6/2013 20:55, Ruben Van Boxem wrote:
> To get this thread back on-topic and to prove my point (even with autotools
> if you didn't have a platform in mind it probably won't work out of the
> box), I tried the quickfix autotools and got (the half-expected):
> libtool: compile:  x86_64-w64-mingw32-g++ -DHAVE_CONFIG_H -I.
> -I/m/Development/Source/quickfix/src/C++/test -I../../.. -I..
> -I../../../UnitTest++/src -g -O2 -Wall -ansi -Wpointer-arith
> -Wwrite-strings -I/libxml/include/libxml2 -O0 -g -MT DictionaryTestCase.lo
> -MD -MP -MF .deps/DictionaryTestCase.Tpo -c DictionaryTestCase.cpp
> -DDLL_EXPORT -DPIC -o .libs/DictionaryTestCase.o
> In file included from ../Exceptions.h:27:0,
>                  from ../Dictionary.h:31,
>                  from DictionaryTestCase.cpp:28:
> ../Utility.h:71:24: fatal error: sys/socket.h: No such file or directory
>  #include <sys/socket.h>
>                         ^
> compilation terminated.

Ugh, do I have to repeat myself? Autotools does not imply any API usage.
You are blaming the errors in the code on the buildsystem. You even got
pass configure.

I'll try to clarify my point one more time: yes it is possible in autotools to exclude code depending on configure. But that is not an autotools specific feature. Code and/or build systems not meant to be used on platforms that weren't in the dev's thoughts when written will not work. And because autotools is very Unix-centric, chances are a lot higher that they were written for Unix, and not with Windows in mind. This is a practical/statistical fact, not some disadvantage of autotools.

But whatever, I don't care anymore. You seem intent to not listen.


> To Frank: I suggest writing some kind of build script or file from the VC
> project files, which have a high chance of having all the Windows stuff set
> right. Remember to drop stdafx.h and mind specific defines and such that
> would signify the exclusion of the Unix code.

Yes, you can do this by excluding Unix specific code from Makefile.am
via AM_CONDITIONAL, defines with AC_DEFINE in configure.ac, keeping all
of it in a single build system if you prefer.

The error Ruben sees looks like it was from a test case that was
designed to run from Unix, it should be fine to exclude it.

Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
Mingw-w64-public mailing list