[mapserver-users] Compiling PHP-Mapscript FreeBSD 4.5

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jun 14 22:07:39 EDT 2002


Bob,

This is only a guess, but the zend_* functions are in libz.a which
should be referenced via -lz option which may not be being found. check
where it is located (like: /usr/local/lib/libz.a) with "whereis libz"
and make sure you have a -L/usr/local/lib or whatever the path is for
libz and try to link it again.

Also make sure that when you configured mapserver that you pointed it to
the correct php source directory because zend_* styff is linked into php
also.

-Steve

Bob Carr wrote:
> 
> In a previous message Stephen Woodbridge wrote:
> >
> > Bob,
> >
> > Check the definition of $(CC) there is a know bug on some platforms
> > where CC= gcc gcc  or CC= cc cc
> > just edit the Makefile and remove the duplicate cc or gcc
> >
> > -Steve
> >
> > Bob Carr wrote:
> > >
> > > Compiling Mapserver 3.6 seems to go fine until it enters the
> > > mapscript/php3 directory, then exits with the following:
> > >
> > > *******************************************************************
> > > make.gnu[1]: Entering directory
> > > `/usr/home/racarr/downloads/source/mapserver-3.6.0/mapscript/php3'
> > > cc undef  -I. -I.. -DPIC -fpic -O2  -Wall -DCOMPILE_DL=1 -DPHP4
> > > -DUSE_WMS_LYR -DUSE_WMS -DUSE_POSTGIS -DUSE_GDAL -DUSE_OGR
> > > -DUSE_PROJ -DUSE_PROJ_API_H  -DUSE_TIFF   -DUSE_GD_PNG -DUSE_GD_JPEG
> > > -DUSE_GD_WBMP -DUSE_GD_FT -DUSE_JPEG
> > > -I/usr/home/racarr/downloads/source/mapserver-3.6.0
> > > -I/usr/local/include -I/usr/local/include/w3c-libwww -DHAVE_CONFIG_H
> > > -I/usr/local/pgsql/include
> > > -I/usr/home/racarr/downloads/gdal-1.1.5/port
> > > -I/usr/home/racarr/downloads/gdal-1.1.5/core
> > > -I/usr/home/racarr/downloads/gdal-1.1.5/ogr
> > > -I/usr/home/racarr/downloads/gdal-1.1.5/ogr/ogrsf_frmts
> > > -I/usr/home/racarr/downloads/gdal-1.1.5/ogr/ogrsf_frmts
> > > -I/usr/home/racarr/downloads/gdal-1.1.5/ogr
> > > -I/usr/home/racarr/downloads/gdal-1.1.5/ogr/../port
> > > -I/usr/home/racarr/downloads/source/proj-4.4.5/src
> > > -I/usr/local/include  -I/usr/local/include
> > > -I/usr/home/racarr/downloads/source/mapserver_3.3/jpeg-6b
> > > -I/home/racarr/downloads/php-4.1.1
> > > -I/home/racarr/downloads/php-4.1.1/dl
> > > -I/home/racarr/downloads/php-4.1.1/main
> > > -I/home/racarr/downloads/php-4.1.1/Zend
> > > -I/home/racarr/downloads/php-4.1.1/include
> > > -I/home/racarr/downloads/php-4.1.1/TSRM  -c -o php_mapscript_util.o
> > > php_mapscript_util.c
> > > cc: cannot specify -o with -c or -S and multiple compilations
> > > make.gnu[1]: *** [php_mapscript_util.o] Error 1
> > > make.gnu[1]: Leaving directory
> > > `/usr/home/racarr/downloads/source/mapserver-3.6.0/mapscript/php3'
> > > ****************************************************************
> > >
> > > Triggering this seems to be lines #84 & #85 in the mapscript/php3/Makefile,
> > > which reads:
> > >
> > > 84 %.o: %.c php_mapscript_util.h php_mapscript.h
> > > 85         $(CC) $(CFLAGS) -c -o $@ $<
> > >
> > > Obviously, I'm stumped and will appreciate any assistance
> > >
> 
> In the mapscript/php3/Makefile I have the line
> 
>  CC =     gcc -undef -I. -I.. -DPIC -fpic
>  LD =    gcc -Wl -Wl
> 
> Originally they both specified cc instead of gcc.  I changed that.  I've also
> added a '-' to the 'undef' option, and now compilation proceeds a bit further,
> but still fails with several 'undefined references' in php_mapscript.o
> Here's an excerpt from the script file recorded.
> 
> cd mapscript/php3; /usr/bin/make.gnu; cd ../..
> make.gnu[1]: Entering directory `/usr/home/racarr/downloads/source/mapserver-3.6.0/mapscript/php3'
> gcc -Wl -Wl -o php_mapscript.so php_mapscript_util.o php_mapscript.o mapscript_i.o
> -R/usr/home/racarr/downloads/source/mapserver_3.3/jpeg-6b -R/usr/local/lib -R/usr/local/include/lib
> -R/usr/home/racarr/downloads/source/proj-4.4.5/src/.libs -R/usr/home/racarr/downloads/source/mapserver-3.6.0
> -L/usr/home/racarr/downloads/source/mapserver-3.6.0 -lmap -L/usr/local/lib -lwwwxml -lxmltok -lxmlparse -lwwwinit
> -lwwwapp -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache
> -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lmd5 -L/usr/local/pgsql/lib -lpq
> -L/usr/home/racarr/downloads/gdal-1.1.5 -lgdal.1.1 -lgeotiff -lpng -lgrass5 -lz -lm -L/usr/local/lib -lm
> -L/usr/home/racarr/downloads/source/proj-4.4.5/src/.libs -lproj -L/usr/local/include/lib -ltiff
> -L/usr/home/racarr/downloads/source/mapserver_3.3/jpeg-6b -ljpeg -L/usr/local/lib -lfreetype -L/usr/local/lib -lpng
> -lz  -lgd -L/usr/local/lib -lgd -L/usr/home/racarr/downloads/source/mapserver_3.3/jpeg-6b -ljpeg -L/usr/local/lib
> -lfreetype -L/usr/local/lib -lpng -lz -L/usr/home/racarr/downloads/source/mapserver_3.3/jpeg-6b -ljpeg   -lm
> /usr/home/racarr/downloads/gdal-1.1.5/ogr/ogrsf_frmts/ogrsf_frmts.a /usr/home/racarr/downloads/gdal-1.1.5/ogr/ogr.a
> /usr/home/racarr/downloads/gdal-1.1.5/ogr/../port/cpl.a
> /usr/local/lib/libwwwcore.so: warning: tmpnam() possibly used unsafely; consider using mkstemp()
> /usr/local/lib/libwwwcore.so: warning: tempnam() possibly used unsafely; consider using mkstemp()
> php_mapscript_util.o: In function `_phpms_report_mapserver_error':
> php_mapscript_util.o(.text+0x33): undefined reference to `zend_error'
> php_mapscript_util.o: In function `_phpms_fetch_handle2':
> php_mapscript_util.o(.text+0x95): undefined reference to `zend_hash_find'
> php_mapscript_util.o(.text+0xae): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0xc3): undefined reference to `_zend_list_find'
> php_mapscript_util.o(.text+0xea): undefined reference to `zend_error'
> php_mapscript_util.o: In function `_phpms_fetch_property_handle2':
> php_mapscript_util.o(.text+0x154): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0x178): undefined reference to `zend_hash_find'
> php_mapscript_util.o(.text+0x19a): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0x1b7): undefined reference to `_zend_list_find'
> php_mapscript_util.o(.text+0x1e5): undefined reference to `zend_error'
> php_mapscript_util.o: In function `_phpms_fetch_property_string':
> php_mapscript_util.o(.text+0x258): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0x27c): undefined reference to `zend_hash_find'
> php_mapscript_util.o(.text+0x29e): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0x2b5): undefined reference to `_convert_to_string'
> php_mapscript_util.o: In function `_phpms_fetch_property_long':
> php_mapscript_util.o(.text+0x30c): undefined reference to `zend_hash_find'
> php_mapscript_util.o(.text+0x32e): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0x344): undefined reference to `convert_to_long'
> php_mapscript_util.o(.text+0x364): undefined reference to `zend_error'
> php_mapscript_util.o: In function `_phpms_fetch_property_double':
> php_mapscript_util.o(.text+0x3a4): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0x3c4): undefined reference to `zend_hash_find'
> php_mapscript_util.o(.text+0x3e6): undefined reference to `zend_error'
> php_mapscript_util.o(.text+0x3f5): undefined reference to `convert_to_double'
> 
> --
> bob carr
> port washington, wisconsin
> racarr at ameritech.net



More information about the mapserver-users mailing list