Click to See Complete Forum and Search --> : Having problems compiling php-4.0.2 for Netwinder!


Anon
10-02-2000, 12:10 AM
Hi,

I am using the following configure:
./configure --with-apxs


I end up getting the following error message...

// Compile command line
/bin/sh /var/tmp/downloads/php-4.0.2/libtool
--silent --mode=compile gcc
-I.
-I/var/tmp/downloads/php-4.0.2/main
-I/var/tmp/downloads/php-4.0.2
-I/var/tmp/downloads/php-4.0.2/main
-I/usr/include/apache
-I/var/tmp/downloads/php-4.0.2/Zend
-I/var/tmp/downloads/php-4.0.2
-I/var/tmp/downloads/php-4.0.2/ext/mysql/libmysql
-I/var/tmp/downloads/php-4.0.2/ext/xml/expat/xmltok
-I/var/tmp/downloads/php-4.0.2/ext/xml/expat/xmlparse
-DXML_BYTE_ORDER=12 -g -O2 -c main.c

// Actual error message
main.c:207: parse error before `zend_compiler_globals'
main.c:207: initializer element is not constant
main.c:207: (near initialization for `ini_entries[7].mh_arg1')
main.c:208: parse error before `zend_compiler_globals'
main.c:208: initializer element is not constant
main.c:208: (near initialization for `ini_entries[8].mh_arg1')
main.c:209: parse error before `php_core_globals'
main.c:209: initializer element is not constant
... and lots more similar errors.


I tracked the bug down to the following lines in /main/php.h

#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
#ifdef __STDC__
// A) This is the one being called
#define XtOffset(p_type,field) _Offsetof(p_type,field)
#else
#ifdef CRAY2
#define XtOffset(p_type,field) (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
#else /* !CRAY2 */
#define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
#endif /* !CRAY2 */
#endif /* __STDC__ */
#else /* ! (CRAY || __arm) */
// B) This is the one that works
#define XtOffset(p_type,field) ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
#endif /* !CRAY */


The define following the comment marked A) is the one compiled
in but gives the above error. I thought it looked a little odd
that that line was compiled because I am not running a Cray and
I am running Linux. Therefore I tested the code so line commented
by B) was used. This allowed main.c to compile and a lot more code
after that (but I eventually received another error - see below).


Now my questions (I guess).

It seems that my system was mis-diagnosed in the configure step
(maybe in the config.guess step but then this is getting out of
my league).

Q: Has anyone actually successfully installed PHP 4.0.2 on a
Netwinder?

Q: Is there something different I should do?

Q: With alternate configure tests I tried to force the system
settings with these options "--build=armv41-rebel-linux
--target==armv41-rebel-linux" but it didn't work.
Is there another way to do this?

************************************************************

Just to confuse the issue the error I receive when I continue
the make with the hacked line B) above is:

make[3]: Entering directory `/var/tmp/downloads/php-4.0.2/ext/standard'
/bin/sh /var/tmp/downloads/php-4.0.2/libtool --silent --mode=compile gcc
-I.
-I/var/tmp/downloads/php-4.0.2/ext/standard
-I/var/tmp/downloads/php-4.0.2
-I/var/tmp/downloads/php-4.0.2/main
-I/usr/include/apache
-I/var/tmp/downloads/php-4.0.2/Zend
-I/var/tmp/downloads/php-4.0.2
-I/var/tmp/downloads/php-4.0.2/ext/mysql/libmysql
-I/var/tmp/downloads/php-4.0.2/ext/xml/expat/xmltok
-I/var/tmp/downloads/php-4.0.2/ext/xml/expat/xmlparse
-DXML_BYTE_ORDER=12 -g -O2 -c dns.c
dns.c: In function `php_if_getmxrr':
dns.c:310: internal error--unrecognizable insn:
(insn 785 784 309 (set (reg:SI 0 r0)
(umin:SI (reg/v:SI 0 r0)
(const_int 8192 [0x2000]))) -1 (nil)
(nil))

make[3]: *** [dns.lo] Error 1
make[3]: Leaving directory `/var/tmp/downloads/php-4.0.2/ext/standard'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/downloads/php-4.0.2/ext/standard'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/downloads/php-4.0.2/ext'
make: *** [all-recursive] Error 1


Thanks In Advance
Mike