php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46020 With Sun Java System Web Server 7.0 on HPUX, #define HPUX
Submitted: 2008-09-08 08:41 UTC Modified: 2009-08-03 10:15 UTC
From: river at wikimedia dot org Assigned: thetaphi (profile)
Status: Closed Package: iPlanet related
PHP Version: 5.2.6 OS: HP-UX 11.11
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: river at wikimedia dot org
New email:
PHP Version: OS:

 

 [2008-09-08 08:41 UTC] river at wikimedia dot org
Description:
------------
When compiling --with-nsapi on HP-UX 11.11 using Sun Java System Web Server 7.0 Update 3, compilation fails inside <nsapi.h> because HPUX is not #defined.  

A workaround is to build with 'CPPFLAGS=-DHPUX'.  I suggest detecting HP-UX at compile time and defining HPUX if the NSAPI module is being built.

Reproduce code:
---------------
I compiled PHP like this:

CPPFLAGS='-I/usr/local/include' LDFLAGS='-L/usr/local/lib -Wl,+b,/usr/local/mysql/lib:/usr/local/lib' CC=gcc CXX=g++ ./configure --prefix=/opt/php --with-mysql=/usr/local/mysql --enable-mbstring --enable-fastcgi --with-nsapi=/opt/webserver7


Expected result:
----------------
I expected PHP to compile.

Actual result:
--------------
PHP didn't compile, with the following error:

In file included from /home/river/php/php-5.2.6/sapi/nsapi/nsapi.c:62:
/opt/webserver7/include/nsapi.h:315:24: error: sys/select.h: No such file or directory

(This include is wrapped in "#ifndef HPUX", which HP's GCC doesn't define by default.)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-01 00:49 UTC] krish dot v at gmail dot com
This happened for my Sun one webserver 6.1 running in HP UX 11.11. I tried your work around and it worked fine. Thanks for the help.

This is really a useful one.

Krish.
 [2008-10-02 17:33 UTC] thetaphi@php.net
In my opinion, this is not a bug in PHP, as the compile failure happens in nsapi.h.
I think you should also ask this question on the SJSWS discussion on Sun's homepage. Or maybe this is a GCC bug.
In principle, it would be possible to add a compile option to PHP that is only set on HPUX, but this would not help others to compile other NSAPI components with GCC. Did you try the HP-UX compiler, does it set "-DHPUX"?
I have no HP-UX machine, so I cannot test any of your configurations. Maybe you send me a fragment to detect HP-UX in configure scripts or what the auto-defines of GCC are for HP-UX.

With this a simple workaround would be to do:

#ifdef GCC_SPECIAL_HPUX_DEFINE
#define HPUX
#endif
include "nsapi.h"

in the nsapi module (I think nsapi.h is used nowhere else in PHP).
 [2009-01-12 09:21 UTC] rkl at connect dot org dot uk
Just a note that "#ifndef HPUX" is technically the wrong check for HP-UX when compiling C/C++, it should be:

#ifndef __hpux
..Do non-HP-UX code
#endif

__hpux is defined in all C/C++ compilers (both gcc/g++ and HP's C/C++) in all releases of HP-UX. So the blame here is with Sun's nsapi.h and not PHP, but until Sun fix it, -DHPUX is the obvious workaround.
 [2009-01-12 09:23 UTC] river at wikimedia dot org
I agree the problem seems to be inside the NSAPI headers, but the response from Sun about this was 'define HPUX yourself', so it seems they're not interested in fixing it.
 [2009-08-03 10:12 UTC] svn@php.net
Automatic comment from SVN on behalf of thetaphi
Revision: http://svn.php.net/viewvc/?view=revision&revision=286721
Log: Fix bug #46020: With Sun Java System Web Server 7.0 on HPUX, #define HPUX
 [2009-08-03 10:13 UTC] svn@php.net
Automatic comment from SVN on behalf of thetaphi
Revision: http://svn.php.net/viewvc/?view=revision&revision=286722
Log: MFH: Fix bug #46020: With Sun Java System Web Server 7.0 on HPUX, #define HPUX
 [2009-08-03 10:14 UTC] svn@php.net
Automatic comment from SVN on behalf of thetaphi
Revision: http://svn.php.net/viewvc/?view=revision&revision=286723
Log: MFH: Fix bug #46020: With Sun Java System Web Server 7.0 on HPUX, #define HPUX
 [2009-08-03 10:15 UTC] thetaphi@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 20:01:30 2024 UTC