php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #420 Compile failure on FreeBSD (fudged headers)
Submitted: 1998-05-30 17:28 UTC Modified: 1998-05-30 17:39 UTC
From: brian at schaffner dot net Assigned: rasmus (profile)
Status: Closed Package: Compile Failure
PHP Version: 3.0 Release Candidate 5 OS: FreeBSD 2.2.6
Private report: No CVE-ID: None
 [1998-05-30 17:28 UTC] brian at schaffner dot net
I just installed FreeBSD 2.2.6 - someting I pretty new to (been 
using mostly Linux before).  When compiling PHP, I got a failure
on the file mysql.c due to what appears to be a fudged configuration
or pre-processor directive. 
My configuration:

./configure --with-apache=/usr/local/httpd --with-gd=no 
--with-pgsql --enable-debug=no --enable-track-vars=yes

(Note that I'm _not_ configuring mysql)

For some reason the HAVE_SYS_TYPES_H macro is not defined - even 
though I definitely have sys/types.h on my system. The simple fix was to 
change

#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netdb.h>
#include <netinet/in.h>
#endif

to

#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#endif

I'm not sure what the "real" fix is. I could find no other sources that relied
on HAVE_SYS_TYPES_H, so I wonder if it's even necessary.

Here's the make error:
gcc -O2 -fpic   -I. -I.   -I/usr/local/httpd/src         -I/usr/local/pgsql/include    -c functions/mysql.c
In file included from functions/mysql.c:58:
/usr/include/netinet/in.h:212: parse error before `u_long'
/usr/include/netinet/in.h:212: warning: no semicolon at end of struct or union
/usr/include/netinet/in.h:263: parse error before `u_char'
/usr/include/netinet/in.h:263: warning: no semicolon at end of struct or union
/usr/include/netinet/in.h:264: warning: data definition has no type or storage class
/usr/include/netinet/in.h:265: parse error before `sin_port'
/usr/include/netinet/in.h:265: warning: data definition has no type or storage class
/usr/include/netinet/in.h:268: parse error before `}'
/usr/include/netinet/in.h:278: field `ip_dst' has incomplete type
/usr/include/netinet/in.h:325: field `imr_multiaddr' has incomplete type
/usr/include/netinet/in.h:326: field `imr_interface' has incomplete type
In file included from /usr/local/httpd/src/conf.h:580,
                 from /usr/local/httpd/src/httpd.h:59,
                 from php.h:182,
                 from functions/mysql.c:61:
/usr/include/arpa/inet.h:71: warning: parameter has incomplete type
/usr/include/arpa/inet.h:74: warning: parameter has incomplete type
/usr/include/arpa/inet.h:78: warning: parameter has incomplete type
In file included from php.h:182,
                 from functions/mysql.c:61:
/usr/local/httpd/src/httpd.h:571: field `local_addr' has incomplete type
/usr/local/httpd/src/httpd.h:572: field `remote_addr' has incomplete type
/usr/local/httpd/src/httpd.h:603: field `host_addr' has incomplete type
/usr/local/httpd/src/httpd.h:659: field `local_addr' has incomplete type
/usr/include/netinet/in.h:266: storage size of `sin_addr' isn't known
*** Error code 1

Stop.

Although at first glance it may appear related to apache - it's not. It's 
simply a missing header file.

-Brian Schaffner-


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-30 17:39 UTC] rasmus
Reported and fixed already.  We had forgotten to run
'autoheader' to update config.h.in.  Simply add:

/* Define if you have the <sys/types.h> header file.  */
#undef HAVE_SYS_TYPES_H

to your config.h.in file and it should take care of it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC