I sort of ended up in the same problem as Getting started with gnulib on MinGW and not familiar (enough) with autotools - that is, wanting to include headers like netinet/in.h
in a MinGW Windows project; and that is where I first heard of gnulib
.
As the above post notes, the primary intention of gnulib
is to sort of "patch" an existing autoconf
project with the right files; however I work with a project whose build system I don't really understand - so at first, I thought of just copying headers.
Now, I'm not really sure, but it seems to me as if gnulib
will generate these headers based on the system it is ran on - which is why instead of containing netinet/in.h
verbatim, it in fact contains:
gnulib_git$ find . -name '*.h' | grep netinet
./lib/netinet_in.in.h
Indeed, this file has stuff like @PRAGMA_SYSTEM_HEADER@
, which I can only assume are some macros.
So, I found there is a command --create-testdir
, so I tried it like this:
rm -rf /tmp/AA # erase previous, else it won't run
./gnulib-tool --create-testdir --dir=/tmp/AA getsockname getsockopt setsockopt socket socketlib sockets socklen sys_socket arpa_inet inet_ntop inet_pton netinet_in
cd /tmp/AA
./configure
make
I've tried this on Linux, it runs fine, however:
$ find /tmp/AA -name '*.h' | grep netinet
/tmp/AA/gllib/netinet_in.in.h
... I still don't get any headers verbatim (and that one still has macros inside)? Turns out I cannot try this on my MinGW-w64, as there is no aclocal
program there...
So could anyone explain whether full headers can ever be generated using --create-testdir
, or how/when in the process can one expect to obtain the actual headers (and whether it is host OS dependent)?