Hello to All,
just wanted to share my experience about how I installed PHP 4.3.10 on Mainframe S390 SuSE Linux, kernel 2.2.16.
My goal was to compile PHP with ability to access MySQL, M$SQL and may be other SQL sources through unixODBC and FreeTDS. However, I won't describe the FreeTDS and unixODBC installation, this is a different story.
For that reason, after downloading and untar/gunzip the source I ran configure:
./configure '--with-apxs2=/usr/local/apache/bin/apxs' '--with-mysql' '--with-unixODBC' '--with-mssql' '--prefix=/usr/local/apache/php' '--with-config-file-path=/usr/local/apache/php' '--enable-force-cgi-redirect' '--disable-cgi' '--with-zlib' '--with-gettext' '--with-gdbm'
The next step is logically make. While compiling I got the error message:
$ php-4.3.10/Zend/zend.c: In function `zend_error':
$ php-4.3.10/Zend/zend.c:776: incompatible types in assignment
make: *** [Zend/zend.lo] Error 1
I opened zend.c and on lines 773-776 saw:
#if defined(va_copy)
va_copy(usr_copy, args);
#else
usr_copy = args;
#endif
It took me some time to find out that the statement
usr_copy = args;
cannot be applied here for usr_copy and args are of type va_list, which is a struct (http://www-128.ibm.com/developerworks/eserver/articles/linux_s390/):
.....
.....
.....
Under Linux 390, a va_list definition is different from other platforms. va_list is a structure with various members.
.....
.....
.....
To solve this I used memcpy:
memcpy(usr_copy, args, sizeof(va_list));
This was successful and make continued compiling until a new error was printed:
$ php-4.3.10/Zend/zend_strtod.c:233: parse error before one'
$ php-4.3.10/Zend/zend_strtod.c:234: parse error beforeIBM'
$ php-4.3.10/Zend/zend_strtod.c:240: parse error before }'
$ php-4.3.10/Zend/zend_strtod.c:240: warning: data definition has no type or storage class
$ php-4.3.10/Zend/zend_strtod.c: In functionulp':
$ php-4.3.10/Zend/zend_strtod.c:928: _double' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:928: (Each undeclared identifier is reported only once
$ php-4.3.10/Zend/zend_strtod.c:928: for each function it appears in.)
$ php-4.3.10/Zend/zend_strtod.c:928: parse error beforex'
$ php-4.3.10/Zend/zend_strtod.c:930: parse error before a'
$ php-4.3.10/Zend/zend_strtod.c:932:x' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:940: a' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c: In functionb2d':
$ php-4.3.10/Zend/zend_strtod.c:970: _double' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:970: parse error befored'
$ php-4.3.10/Zend/zend_strtod.c:988: d' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c: In functiond2b':
$ php-4.3.10/Zend/zend_strtod.c:1041: _double' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:1041: parse error befored'
$ php-4.3.10/Zend/zend_strtod.c:1046: d' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c: In functionratio':
$ php-4.3.10/Zend/zend_strtod.c:1172: _double' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:1172: parse error beforeda'
$ php-4.3.10/Zend/zend_strtod.c:1175: da' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:1176:db' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c: In function zend_strtod':
$ php-4.3.10/Zend/zend_strtod.c:1243:_double' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:1243: parse error before rv'
$ php-4.3.10/Zend/zend_strtod.c:1252:rv' undeclared (first use in this function)
$ php-4.3.10/Zend/zend_strtod.c:1485: `rv0' undeclared (first use in this function)
On the lines 231-235 in zend_strtod.c I found:
#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \
defined(IBM) != 1
Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or
IBM should be defined.
#endif
It seemed that the comment "Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or IBM should be defined." wasn't commented out. Since there was no other statement between the #If defined and #endif I just commented out the sentence "Exactly one.... " and make didn't give me any errors. This 2 corrections did the job.
Hope this will help to faster find solution in case someone gets into the same problems I have experienced. Enjoy!
Cheers,
NGD