[Mapserver-users] Re: help installing mapserver with ming

blaise bpicinbono at worldonline.fr
Tue May 11 12:15:10 EDT 2004


Dear list,

Installing MapServer with Ming support partially solved.
(what a headache !)

After many days and even weeks working on that, I managed to compile 
MapServer with the Ming support.

Here are my tricks, I put them on the list, hopping it can help some of 
you. But I am not fully satisfied with that. I had to modify several 
files that, I think, were not supposed to be modified. I don't think my 
method is very academic, so don't take it as the Truth, but as possible 
ways to help you with the Ming install.

Moreover, although the MapServer compilation runs to its end, it outputs 
several warnings that make me think that everything is not ok.

Anyway, I a now able to run the FlashMapServer demo and I am going to 
customize it to my needs. But, in this demo, I still have two main 
problems :
-- big aliasing artefacts on the map (during the compilation, it 
complains a lot with the php_mapscript_util.c and php_mapscript.c files 
telling :
warning: dereferencing type-punned pointer will break strict-aliasing rules)
-- I haven't yet been able to output raster on the Flash demo.
If somebody know how to solve these problems, that will be greatly 
welcomed ! ! !

So here are my tricks :
I am working on a linux box driven by Fedora Core 1a, Apache 2. I have 
installed the Mapserver-4.0.2, Php-4.3.6, Ming-0.3a, GD-2.0.22 and other 
libs from source.
The file tree of the installation stuff I used is :
/root/ms_install/mapserver-4.0.2 : mapserver
/root/ms_install/lib/php-4.3.6 : php
/root/ms_install/lib/ming : ming
/root/ms_install/lib/gd-2.0.22 : gd
/root/ms_install/lib/xxx : all other needed libraries.

I am NOT using GIF, don't have any gif support.


##############################################
Files that I changed before installing Ming :
##############################################

# cd /root/ms_install/lib
# tar -xzvf ming-0.3a.tar.gz
# cd ming

---------------
ming/config.h
---------------
edit /root/ms_install/lib/ming/config.h
replace line 2 :
#define USE_GIF 1
by :
#define USE_GIF 0
save the updated file

---------------
ming/config.make
---------------
edit /root/ms_install/lib/ming/config.make
replace line 2 :
EXTRA_OBJS = gifdbl.o pngdbl.o
by :
EXTRA_OBJS = pngdbl.o
and replace line 5 :
EXTRA_LIBS = -lz -lungif -lpng12
by :
EXTRA_LIBS = -lz -lpng12
save the updated file

---------------
ming/src/ming.h
---------------
edit /root/ms_install/lib/ming/src/ming.h in a text editor
remove these lines :
lines 156-159 :
#ifdef USE_GIF
SWFDBLBitmapData newSWFDBLBitmap_fromGifFile(char *name);
SWFDBLBitmapData newSWFDBLBitmap_fromGifInput(SWFInput input);
#endif
...save the updated file

---------------
ming/src/blocks/bitmap.c
---------------
edit /root/ms_install/lib/ming/src/blocks/bitmap.c in a text editor
remove these lines :
lines 64-69 :
if(c1 == ‘G’ && c2 == ‘I’)
#if 1
		return (SWFBitmap) newSWFDBLBitmap_fromGifInput(input);
#else
		SWF_error("GIF images must be translated into DBL files for now");
#endif
...save the updated file


# cd /root/ms_install/lib/ming
# make
# make static
# make install
# cd php_ext
# make
# ldconfig
... make a 987.2 ko php_ming.so file in ming/php_ext... good

(this file has to go in the extensions directory of Php).




##################################################
Files that I changed before installing MapServer :
##################################################

# cd /root/ms_install
# tar -xzvf mapserver-4.0.2.tar.gz
# cd mapserver

---------------
mapserver-4.0.2/mapswf.c
---------------
(very sensitive file ! ! ! )
line 827, replace :
char        *driver = strdup("GD/GIF");
by
char        *driver = strdup("GD/PNG");

delete lines 875 -877 :
#ifdef USE_GD_GIF
         driver = strdup("GD/GIF");
#else

delete one "#endif" line (line 890) : NO DON’T DELETE THAT ONE, OR MAKE 
WILL FAIL ! ! ! ( WHY ? THIS IS VERY STRANGE ! )

line 2422 replace :
const char         *driver = "GD/GIF";
by ;
const char         *driver = "GD/PNG";

delete line 2443 :
#endif

replace line 2805 :
char        *driver = strdup("GD/GIF");
by :
char        *driver = strdup("GD/PNG");

delete lines 2808 to 2810 :
#ifdef USE_GD_GIF
     driver = strdup("GD/GIF");
#else

delete line 2825 :
#endif

replace line 2728 :
SWFMovie_save(image->img.swf->sMainMovie, filename);
by :
SWFMovie_save(image->img.swf->sMainMovie, filename,0);



---------------
mapserver-4.0.2/map.h
---------------
edit mapservver/map.h
replace line 42 :
#include "ming.h"
by
#include "/root/ms_install/lib/ming/src/ming.h"


---------------
/usr/include/ming.h
---------------
edit file /usr/include/ming.h
replace line 41 :
#include "../config.h"
by :
#include "/root/ms_install/lib/ming/config.h"
save updated file

# cd /root/ms_install/mapserver-4.0.2
# ./configure --with-tiff --without-eppl --with-threads --with-proj 
--with-php=../lib/php-4.3.6 --with-gd=/usr/local 
--with-freetype=/usr/bin --with-ming
# make




As I said before, during the "make" of MapServer, I get a lot of 
warnings, mainly of two kinds :
--1-- mapswf.c: warning: passing arg 2 of 'SWFButton_addShape' from 
incompatible pointer type
--2-- php_mapscript_util.c and php_mapscript.c: dereferencing 
type-punned pointer will break strict-aliasing rules


As I am just discovering FlashMapServer, I haven't tested all the 
available functions and can't tell that everything is working. I just 
can run the FlashMapServer demo, but without raster and with big 
aliasing artefacts.


Well, well, I hope this will help some of you, but I am also waiting for 
a more academic way of installing MapServer with Ming
Bye
Blaise



More information about the mapserver-users mailing list