SGI: Development

Building neko_php

I have made packages for the latest apache, apr, and apr-util recently, which requires that I recompile the PHP SAPI for apache. I figured this would be easy because it's already been worked out as a nekoware package, but I'm running into some odd problems with the configure script:

First off, using the --with-mcrypt flag causes the script to return

Code:
checking for mcrypt support... yes, shared
checking for libmcrypt version... >= 2.5.6
checking for mcrypt_module_open in -lmcrypt... no
checking for mcrypt_module_open in -lmcrypt... no
configure: error: Sorry, I was not able to diagnose which libmcrypt version you have installed.


I've found mentions of this problem all over the web, but no solutions. If I remove --with-mcrypt and run configure again, it fails on mysql checking. Here is the end of config.log:

Code:
1.   int main() {
2.   mysql_close()
3.   ; return 0; }
4.   configure:58241: checking for mysql_error in -lmysqlclient
5.   configure:58260: c99 -o conftest -I/usr/include -O3 -mips4 -I/usr/nekoware/include -TARG:platform=IP35:proc=r14000 -I/usr/nekoware/include -I/usr/include -D_XPG_IV -Wl,-rpath,/usr/nekoware/mysql5/lib/mysql -L/usr/nekoware/mysql5/lib/mysql -Wl,-rpath,/usr/nekoware/lib -L/usr/nekoware/lib -L/usr/lib -L/usr/nekoware/lib -L/usr/nekoware/lib -Wl,-rpath -Wl,/usr/nekoware/lib -Wl,-rpath,/usr/nekoware/lib -L/usr/nekoware/lib conftest.c -lmysqlclient  -ldb-4.4 -lz -lm  -lxml2 -lz -liconv -lm 1>&5
6.   ld32: FATAL   12 : Expecting n32 objects: /usr/lib/crt1.o is o32.
7.   configure: failed program was:
8.   #line 58249 "configure"
9.   #include "confdefs.h"
10.   /* Override any gcc2 internal prototype to avoid an error.  */
11.   /* We use char because int might match the return type of a gcc2
12.       builtin and then its argument prototype would still apply.  */
13.   char mysql_error();
14.
15.   int main() {
16.   mysql_error()
17.   ; return 0; }


I think the problem here is the -L/usr/lib that shows up in the compiler line, which is not in my LDFLAGS, so the php configure script must be inserting it on its own. For the record, I tried compiling the latest version of php 5.2 a couple months ago and had the exact same problems with it. Since 5.2.1 is in nekoware/current, I figure there must be at least a handful of people hanging around who have built php 5.2.x successfully on IRIX. Any ideas?

_________________
:Fuel: :O2: :Octane: :Octane2: :0300:
Sure, the build instructions to get around this are in the release notes contained in my nekochan_php package located here:

http://www.nekochan.net/downloads/index ... Fnekochan/

I'd quote it out here but I don't have an IRIX machine handy at the moment.

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
The release notes just contain a list of environment variables, which don't seem to change the outcome of the confugure process. Might I be missing something?

_________________
:Fuel: :O2: :Octane: :Octane2: :0300:
Yep, this part right here:

Code:
Edit configure.in; find the following:

*mips*)
CPPFLAGS="$CPPFLAGS -D_XPG_IV";;

Change to:

*mips*)
CPPFLAGS="$CPPFLAGS -D_XPG_IV -L/usr/nekoware/lib -L/usr/lib32";;

Rebuild 'configure' with 'buildconf --force'.


This ensures that the spurious '-L/usr/lib' you noted above won't cause trouble as /usr/nekoware/lib and /usr/lib32 will always come first.

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
Thanks, that worked!

Now I'm encountering something else that may be a problem, but I'm not sure. The existing nekoware php5 package contains php-cgi and php-fcgi in /usr/nekoware/php5/bin, as well as their relevant config files, but these don't get built for me. The relnotes claim that "[it] takes 3 extra runs to compile the cgi,apache and fastcgi module," but I'm not sure how to invoke these extra runs to build the cgi and fastcgi SAPIs. Also, the apache2 SAPI builds with everything else, which seems to contradict what the relnotes are saying.

_________________
:Fuel: :O2: :Octane: :Octane2: :0300:
Not sure on that one - that release note quote must be from neko_php5 which I had no involvement with. I did the 'nekochan' builds to keep the forums/wiki/gallery up-to-date with the latest security updates, but I wasn't concerned with much more than the Apache SAPI and whatever extensions needed to make things work smoothly :)

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
The impression I'm getting from reading around the web is that cgi and fastcgi aren't needed when using mod_php for apache, so I think I can just leave them out. Something a little more concerning is that the mod_php I built doesn't seem to work. The neko_php (5.2.1) libphp5.so is linked against db4 and the one I built (5.2.13) isn't, but I can't figure out anything else different about my new setup that would cause it not to work.

_________________
:Fuel: :O2: :Octane: :Octane2: :0300:
Hmm, all I can suggest is checking your Apache error logs to try and pinpoint the failure - php will usually spit something out. 5.2.13 should work; I built (and ran) nearly all of the 5.2.X tree on IRIX over the years.

It should be noted though that unless you have a specific need for an older PHP build, the 5.3.X branch runs quite a bit faster under IRIX than 5.2.X.

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.