# compile issues on Solaris

- Thread: https://externals.io/message/9703
- Original archive: https://news-web.php.net/php.internals/9703
- Started by Daniel Fahlgren on 2004-05-07T11:58:24+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #9703 — Daniel Fahlgren — 2004-05-07T11:58:24+00:00

URL: https://externals.io/message/9703#9703

Hello

I'm having compile issues with PHP5 on Solaris. I tried both Solaris 8
and 9, both giving me the same error. The problem is in the file
ext/standard/proc_open.c

And the error message from gcc is:

In file included from
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend.h:244, from
/Home/staff/fahlgren/php-test/php5-200405071030/main/php.h:34, from
/Home/staff/fahlgren/php-test/php5-200405071030/ext/standard/proc_open.c:23:
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
parse error before `*'
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
parse error before `uint'
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
`ulong' declared as function returning a function
[...] more errors due to the first ones.

I found that in order to get ulong and uint on Solaris you have to
include sys/types.h Then it compiles and gives a functional binary. It
must beincluded before the "#define _XOPEN_SOURCE", otherwise it still
won't compile.

This problem is still in the latest cvs snapshot (from May 07, 2004
10:30 GMT as you can tell by the path). When I compiled RC2 I think I
had to include sys/termios.h as well in order to get some constant
defined, but that seems to have been fixed now. 

/ Daniel Fahlgren

-- 
I live the way I type; fast, with a lot of mistakes

Daniel Fahlgren             http://www.acc.umu.se/~guru/
sysadm@{acc,cs,math}.umu.se 070-3406400         ordf@acc

---

## #9704 — Wez Furlong — 2004-05-07T13:00:31+00:00

URL: https://externals.io/message/9703#9704 · In reply to: #9703

This is a known issue (search bugs.php.net).

Unfortunately, the workaround you (and the others) suggest will cause a
similar problem on Linux systems :-/

We need to find a way to set those _XOPEN_SOURCE style defines up so that
the build succeeds on your system.  However, I don't have access to any
Solaris boxen  so I can't get stuck in to fix it.

--Wez.
 

> -----Original Message-----
> From: Daniel Fahlgren [mailto:guru@acc.umu.se] 
> Sent: 07 May 2004 12:58
> To: internals@lists.php.net
> Subject: [PHP-DEV] compile issues on Solaris
> 
> Hello
> 
> I'm having compile issues with PHP5 on Solaris. I tried both 
> Solaris 8 and 9, both giving me the same error. The problem 
> is in the file ext/standard/proc_open.c
> 
> And the error message from gcc is:
> 
> In file included from
> /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend.h:24
> 4, from 
> /Home/staff/fahlgren/php-test/php5-200405071030/main/php.h:34, from
> /Home/staff/fahlgren/php-test/php5-200405071030/ext/standard/p
> roc_open.c:23:
> /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
> parse error before `*'
> /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
> parse error before `uint'
> /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
> `ulong' declared as function returning a function [...] more 
> errors due to the first ones.
> 
> I found that in order to get ulong and uint on Solaris you 
> have to include sys/types.h Then it compiles and gives a 
> functional binary. It must beincluded before the "#define 
> _XOPEN_SOURCE", otherwise it still won't compile.
> 
> This problem is still in the latest cvs snapshot (from May 
> 07, 2004 10:30 GMT as you can tell by the path). When I 
> compiled RC2 I think I had to include sys/termios.h as well 
> in order to get some constant defined, but that seems to have 
> been fixed now. 
> 
> / Daniel Fahlgren
> 
> --
> I live the way I type; fast, with a lot of mistakes
> 
> Daniel Fahlgren             http://www.acc.umu.se/~guru/
> sysadm@{acc,cs,math}.umu.se 070-3406400         ordf@acc
> 
> --
>  To 
> unsubscribe, visit: http://www.php.net/unsub.php

---

## #9707 — Daniel Fahlgren — 2004-05-07T18:59:27+00:00

URL: https://externals.io/message/9703#9707 · In reply to: #9704

> This is a known issue (search bugs.php.net).
> 
> Unfortunately, the workaround you (and the others) suggest will cause a
> similar problem on Linux systems :-/
> 
> We need to find a way to set those _XOPEN_SOURCE style defines up so that
> the build succeeds on your system.  However, I don't have access to any
> Solaris boxen  so I can't get stuck in to fix it.

Well. A simple solution that should keep the build on Linux (and others)
intact is

#ifdef __sun__
#include<sys/types.h>
#endif

Perhaps not the neatest one, but then it should compile on Solaris using
gcc.. Better then not compile at all :) I guess the correct way is to
let configure figure out if types.h is needed and not trust a define
that might not exist in all compilers.

I could dig in and try to find another solution that works. If I'm
feeling brave (and perhaps stupid) I can give it a try on Irix and AIX
as well.. ;) (I haven't tried to compile on them at all)

/ Daniel Fahlgren

-- 
I live the way I type; fast, with a lot of mistakes

Daniel Fahlgren             http://www.acc.umu.se/~guru/
sysadm@{acc,cs,math}.umu.se 070-3406400         ordf@acc

---

## #9709 — Jay Smith — 2004-05-07T19:34:44+00:00

URL: https://externals.io/message/9703#9709 · In reply to: #9704

Wez Furlong wrote:

> This is a known issue (search bugs.php.net).
> 
> Unfortunately, the workaround you (and the others) suggest will cause a
> similar problem on Linux systems :-/
> 
> We need to find a way to set those _XOPEN_SOURCE style defines up so that
> the build succeeds on your system.  However, I don't have access to any
> Solaris boxen  so I can't get stuck in to fix it.
> 
> --Wez.
>  
> 

<snip>

Hey Wez,

Conincidentally enough, just yesterday I ressurrected my Solaris box, so if
you'd like a login or have any tests you'd like me to, I can provide a
login and everything. Actually, I think I sent login details a long time
ago, but if not, I can re-send 'em. 

The box is still at Solaris 8 on an old SPARC Ultra 10. I've upgraded a few
things recently like glibc and gcc and such, and while it's a bit of hassle
to compile PHP now (ld path issues, I think I've cleaned most of it up) it
will probably do if you need a shell.

Let me know and I'll send you the login details if want access.

J
