ID:               46020
 Comment by:       river at wikimedia dot org
 Reported By:      river at wikimedia dot org
 Status:           Assigned
 Bug Type:         Compile Failure
 Operating System: HP-UX 11.11
 PHP Version:      5.2.6
 Assigned To:      thetaphi
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2009-01-12 09:21:26] 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.

------------------------------------------------------------------------

[2008-10-02 17:33:43] theta...@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).

------------------------------------------------------------------------

[2008-10-01 00:49:51] 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-09-08 08:41:04] 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.)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46020&edit=1

Reply via email to