Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#1468 closed defect (fixed)

mapscript compile error

Reported by: tomkralidis Owned by: dmorissette
Priority: highest Milestone: 4.8 release
Component: MapScript-PHP Version: unspecified
Severity: blocker Keywords:
Cc:

Description

Hi,

I just updated latest CVS (I update and build every couple of days or
so) and found a problem when building php mapscript as part of my usual
process:

$./configure --enable-debug --with-freetype=/usr/local/bin/freetype-config
--with-zlib=/usr/local/ --with-png=/usr/local/ --with-jpeg=/usr/local/
--with-xpm =/usr/local/ --with-gd=/usr/local --with-pdf=/usr/local --with-eppl
--with-proj=/usr/local --with-ogr=/usr/local/bin/gdal-config
--with-gdal=/usr/local/bin
/gdal-config --without-tiff --with-postgis=/usr/local/pgsql/bin/pg_config
--with-wfs --with-wcs --with-wmsclient --with-wfsclient
--with-curl-config=/usr/l ocal/bin/curl-config
--with-php=/usr/local/src/php/php-5.0.5
$make

[snip of everything that compiled fine before this]

gcc -fPIC -g -O2 -fPIC -Wall  -DUSE_PHP_REGEX -DCOMPILE_DL=1 -DPHP4
-DENABLE_STDERR_DEBUG   -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_WCS_SVR
-DUSE_WFS_SVR -DUSE_W
MS_SVR    -DUSE_POSTGIS  -DUSE_GDAL -DUSE_OGR     -DUSE_PROJ -DUSE_EPPL
-DUSE_PDF  -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT
-DGD_H AS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS -DUSE_ICONV -DUSE_ZLIB
-I/usr/local/src/mapserver/cvs/mapserver
-I/usr/local/src/php/php-5.0.5/regex/..  -I/usr/l
ocal/include    -I/usr/local/pgsql/include  -I/usr/local/include
-I/usr/local/include -I/usr/local/include -I/usr/local/include
-I/usr/local//include  - I/usr/local/src/php/php-5.0.5
-I/usr/local/src/php/php-5.0.5/dl -I/usr/local/src/php/php-5.0.5/main
-I/usr/local/src/php/php-5.0.5/Zend
-I/usr/local/src/ph
p/php-5.0.5/include -I/usr/local/src/php/php-5.0.5/TSRM
-I/usr/local/src/php/php-5.0.5/regex/.. -c -o
/usr/local/src/php/php-5.0.5/regex/regerror.o /usr/l
ocal/src/php/php-5.0.5/regex/regerror.c
/usr/local/src/php/php-5.0.5/regex/regerror.c:38: error: `REG_OKAY' undeclared
here (not in a function)
/usr/local/src/php/php-5.0.5/regex/regerror.c:38: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:38: error: (near initialization
for `rerrs[0].code')
/usr/local/src/php/php-5.0.5/regex/regerror.c:38: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:38: error: (near initialization
for `rerrs[0]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:39: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:39: error: (near initialization
for `rerrs[1]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:40: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:40: error: (near initialization
for `rerrs[2]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:41: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:41: error: (near initialization
for `rerrs[3]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:42: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:42: error: (near initialization
for `rerrs[4]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:43: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:43: error: (near initialization
for `rerrs[5]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:44: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:44: error: (near initialization
for `rerrs[6]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:45: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:45: error: (near initialization
for `rerrs[7]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:46: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:46: error: (near initialization
for `rerrs[8]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:47: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:47: error: (near initialization
for `rerrs[9]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:48: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:48: error: (near initialization
for `rerrs[10]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:49: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:49: error: (near initialization
for `rerrs[11]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:50: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:50: error: (near initialization
for `rerrs[12]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:51: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:51: error: (near initialization
for `rerrs[13]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:52: error: `REG_EMPTY' undeclared
here (not in a function)
/usr/local/src/php/php-5.0.5/regex/regerror.c:52: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:52: error: (near initialization
for `rerrs[14].code')
/usr/local/src/php/php-5.0.5/regex/regerror.c:52: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:52: error: (near initialization
for `rerrs[14]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:53: error: `REG_ASSERT' undeclared
here (not in a function)
/usr/local/src/php/php-5.0.5/regex/regerror.c:53: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:53: error: (near initialization
for `rerrs[15].code')
/usr/local/src/php/php-5.0.5/regex/regerror.c:53: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:53: error: (near initialization
for `rerrs[15]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:54: error: `REG_INVARG' undeclared
here (not in a function)
/usr/local/src/php/php-5.0.5/regex/regerror.c:54: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:54: error: (near initialization
for `rerrs[16].code')
/usr/local/src/php/php-5.0.5/regex/regerror.c:54: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:54: error: (near initialization
for `rerrs[16]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:55: error: initializer element is
not constant
/usr/local/src/php/php-5.0.5/regex/regerror.c:55: error: (near initialization
for `rerrs[17]')
/usr/local/src/php/php-5.0.5/regex/regerror.c:64: error: syntax error before
"php_regerror"
/usr/local/src/php/php-5.0.5/regex/regerror.c:65: warning: return type defaults
to `int'
/usr/local/src/php/php-5.0.5/regex/regerror.c: In function
`php_regerror':
/usr/local/src/php/php-5.0.5/regex/regerror.c:72: error: `REG_ITOA' undeclared
(first use in this function)
/usr/local/src/php/php-5.0.5/regex/regerror.c:72: error: (Each undeclared
identifier is reported only once
/usr/local/src/php/php-5.0.5/regex/regerror.c:72: error: for each function it
appears in.)
/usr/local/src/php/php-5.0.5/regex/regerror.c:76: error: `REG_ATOI' undeclared
(first use in this function)
/usr/local/src/php/php-5.0.5/regex/regerror.c: In function `regatoi':
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
/usr/local/src/php/php-5.0.5/regex/regerror.c:119: error: structure has no
member named `re_endp'
make[1]: *** [/usr/local/src/php/php-5.0.5/regex/regerror.o] Error 1
make[1]: Leaving directory `/usr/local/src/mapserver/cvs/mapserver/mapscript/php3'

Change History (12)

comment:1 by dmorissette, 19 years ago

Cc: mapserver-bugs@… added
Owner: changed from mapserverbugs to dmorissette@…
Did you upgrade PHP since the last time that you built MapServer? And if yes
then which version of PHP did you use before?

comment:2 by tomkralidis, 19 years ago

I upgraded from PHP 5.0.4 to PHP 5.0.5.  Here is my PHP ./configure:

./configure  --with-regex=system --enable-dbase --with-jpeg=/usr/local/
--with-png=/usr/local/
--with-gd=/usr/local/ --with-apxs2=/usr/local/www/bin/apxs
--with-zlib-dir=/usr/local/src/zlib/
zlib-1.2.3/ --with-freetype-dir=/usr/local/src/freetype2/freetype-2.1.10
--with-pgsql=/usr/loca
l/pgsql/bin/pg_config --enable-dbase --with-pdflib

comment:3 by tomkralidis, 19 years ago

I just checked my builds again.

I upgraded to php 5.0.5 on 07 Sept (as well as gdal, xerces, libcurl, freetype2,
zlib), THEN I rebuilt MapServer latest CVS on 07 Sept with no problems.

I then upgraded to MapServer latest CVS on 09 September, which is when I ran
into errors.  Note that a few CVS commits against in mapscript/php3/ happened
during this time in between.

comment:4 by tomkralidis, 19 years ago

Priority: highhighest
Severity: normalmajor

comment:5 by assefa, 19 years ago

Note sure why the changes done recently would have this effect. I added a link 
to geos libararies. Do you do your builds with geos supoport ?  If yes can you 
do a quick try without it ? 

comment:6 by tomkralidis, 19 years ago

Nope, I don't use GEOS.  See my configure flags in comment 1.

Has anyone successfully compiled against php 5.0.5?

comment:7 by dmorissette, 19 years ago

I think it's a configure/makefile problem, not a source code problem... I hope
to find the time to try to reproduce this soon...

comment:8 by tomkralidis, 19 years ago

FYI, I tried this on another machine and was able to reproduce the error when
make went into building php_mapscript.

comment:9 by tomkralidis, 19 years ago

Milestone: 4.8 release
Severity: majorblocker
I've set this for 4.8 and as a blocker for testing latest PHP mapscript CVS

comment:10 by dmorissette, 19 years ago

Status: newassigned
I'll try a php 5.0.5 build on Linux now.

comment:11 by dmorissette, 19 years ago

Resolution: fixed
Status: assignedclosed
I have finally been able to reproduce. 

The reason why you got those errors is that the files
/usr/local/src/php/php-5.0.5/regex/*.o (e.g. regerror.o) were not present,
normally they should have been created and left there when you compiled your
PHP. This may be because you pointed to a source tree where PHP was not compiled
before, or where you made a 'make clean'. 

With the changes to support the PHP regex made in bug 1354, configure should not
have tried to use those regex/*.o files if regex_extra.h was available but due
to a bug in the configure script it still tried to use them even if the
--with-php-regex-dir switch was nto used. This problem is not new and probably
existed since the changes done in 4.6 for bug 1354.

Anyway, the code in the configure script that handled the deprecated
--with-php-regex-dir switch and tried to link with regerror.o (and other
regex/*.o) was deprecated since 4.6 and is useless with the fix from bug 1354 so
I took it out in the 4.7 CVS and that solves the issue.

comment:12 by tomkralidis, 19 years ago

Tested by me.  Works fine now.  Verified.
Note: See TracTickets for help on using tickets.