[R] building R-1.3.0

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jun 26 21:28:54 CEST 2001


On Tue, 26 Jun 2001, Deborah Swayne wrote:

> > nanoftp.c:771: `AF_INET' undeclared (first use in this function)
> > nanoftp.c:781: `SOCK_STREAM' undeclared (first use in this function)
> > nanoftp.c:1090: `IPPROTO_TCP' undeclared (first use in this function)
>
> I've learned a bit more about this, and I'd say I've probably
> encountered a puzzle and a bug.
>
> The puzzle:
>
>   If I'm reading config.cache correctly, configure fails to locate
>       /usr/include/netinet/tcp.h
>   though it finds other files in the same directory
>
>   from config.cache:
>     ac_cv_header_netinet_in_h=${ac_cv_header_netinet_in_h=yes}
>     ac_cv_header_netinet_tcp_h=${ac_cv_header_netinet_tcp_h=no}
>   but
>    -r--r--r--  1 root   root  23975 Jul 24  2000 /usr/include/netinet/in.h
>    -r--r--r--  1 root   root   3754 Jul 24  2000 /usr/include/netinet/tcp.h

Um ....

>
> As a consequence of that decision, HAVE_BSD_NETWORKING is not defined.
>
> The bug:
>
>   nanoftp.c checks that macro before including tcp.h (and other
>   files), but doesn't seem to do the right test later on when it uses
>   the contents of the include files in question.
>
>   All the code in the file is embedded in this test:
>     #if !defined(Unix) || defined(HAVE_BSD_NETWORKING)
>
>   While the test for including tcp.h (et al) is more stringent:
>     #ifdef HAVE_BSD_NETWORKING

But it is as intended.  Is not Unix defined on your system?  Or is that
being parsed incorrectly (according to my understanding, and Harbison &
Steele's)?

Does

#if (!defined(Unix)) || defined(HAVE_BSD_NETWORKING)

work?

We do need the extra freedom on Windows, where HAVE_BSD_NETWORKING is
false but the  #ifdef Win32 lines save the day.

Brian


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list