[mapserver-users] Error in Mapscript/PHP for MS 3.5 ( redux)

Greg Mader gmader at GeoAnalytics.com
Thu Jul 25 08:20:20 PDT 2002


 Hi all,
Platform is RH 7.3 on a dual PIII server.
I am having a problem that has been addressed before, but I cannot find the
right fix:

cd mapscript/php3; make; cd ../..
make[1]: Entering directory `/home/gmader/mapserver_3.5/mapscript/php3'
gcc  gcc -I. -I.. -fPIC -O2  -Wall -DCOMPILE_DL=1 -DPHP4 -DUSE_EPPL
-DUSE_TIFF   -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DUSE_JPEG
-I/home/gmader/mapserver_3.5         -I/usr/include
-I/usr/local/include/php/main -I/usr/local/include/php/main/dl
-I/usr/local/include/php/main/main -I/usr/local/include/php/main/Zend
-I/usr/local/include/php/main/include -I/usr/local/include/php/main/TSRM  -c
-o php_mapscript_util.o php_mapscript_util.c
gcc: cannot specify -o with -c or -S and multiple compilations
make[1]: *** [php_mapscript_util.o] Error 1


Here is the makefile that it is generating:
CC =     gcc  gcc -I. -I.. -fPIC
LD =     gcc -shared -L/usr/local/lib -rdynamic
CFLAGS = -O2  -Wall -DCOMPILE_DL=1 -DPHP4
RUNPATHS= 

#
# Set PHP_SRC_DIR to point to the root of the PHP source tree
#
PHP_SRC_DIR = /usr/local/include/php/main

PHP_INC = -I$(PHP_SRC_DIR) -I$(PHP_SRC_DIR)/dl -I$(PHP_SRC_DIR)/main \
	  -I$(PHP_SRC_DIR)/Zend -I$(PHP_SRC_DIR)/include \
	  -I$(PHP_SRC_DIR)/TSRM 

#
# Set MapServer extensions parameters.  See main MapServer Makefile for 
# more details... 
# Common defaults are:
# MS_DEFINE = -DUSE_TTF -DUSE_TIFF -DUSE_EPPL -DUSE_GD_1_2
# MS_INCLUDE = -I../.. -I../../gd-1.2 -I../../gdft
# MS_LIBS = -L../.. -lmap -L../../gdft -lgdft -ltiff -lttf -L../../gd-1.2
-lgd
#
MS_DEFINE =        -DUSE_EPPL -DUSE_TIFF   -DUSE_GD_PNG -DUSE_GD_JPEG
-DUSE_GD_WBMP -DUSE_GD_FT -DUSE_JPEG 
MS_INC =    -I/home/gmader/mapserver_3.5         -I/usr/include  
MS_STATIC =   
MS_LIBS =   $(RUNPATHS) -L/home/gmader/mapserver_3.5 -lmap       -ltiff
-ljpeg -lfreetype -lpng -lz  -lgd -L/usr/lib -lgd -ljpeg -lfreetype -lpng
-lz -ljpeg   -lm $(MS_STATIC)


#
# The rest of the file should not have to be edited...
#

CFLAGS := $(CFLAGS) $(MS_DEFINE) $(MS_INC) $(PHP_INC)

all: php_mapscript.so

PHPMS_OBJS =  php_mapscript_util.o php_mapscript.o mapscript_i.o

PHPPROJ_OBJS = php_mapscript_util.o php_proj.o


php_mapscript.so: $(PHPMS_OBJS) ../../libmap.a
	$(LD) -o $@ $(PHPMS_OBJS) $(MS_LIBS)

php_proj.so:  $(PHPPROJ_OBJS)
	$(LD) -o $@ $(PHPPROJ_OBJS) $(MS_LIBS)

%.o: %.c php_mapscript_util.h php_mapscript.h
	$(CC) $(CFLAGS) -c -o $@ $<


clean:
	-rm -f *.so *.o perl.out


Thanks,

Greg Mader




More information about the MapServer-users mailing list