dev: mapserver & cygwin

Matt.Wilkie Matt.Wilkie at gov.yk.ca
Tue Dec 12 11:14:04 PST 2000


Hi All,

Just for the heck of it, I tried to compile Mapserver on Win32
using the Cygwin development environment. Well, not quite for
the heck of it but I'll save that for another time. :o

For the record, I'm not a programmer, I don't know a damn thing
about C and I know just enough about unices to really screw 
things up. Be that as it may, I thought I'd share my experience
in the hope it'll benefit somebody else who knows more about 
what they're doing. :)

I had almost no problems compiling Mapserver. However once 
Mapserver.exe is installed in $cgi-bin it doesn't run properly 
either. The exe does respond (apparently) correctly - no core 
dumps or  anything messy - it just doesn't do what you want: 
display a map. :)

cheers,

-matt
----------------------------------------------------------
The Environment:
  Windows NT 4.0sp5
  Apache 1.3.14	(current to 31-Oct-2k)
	http://httpd.apache.org/dist/binaries/win32/
  cygwin v1.1 (install current to 04-Dec-2k)
	http://cygwin.com/setup.exe
  cygwin-utils (current to 04-Dec-2k)
	http://cygutils.netpedia.net/V1.1/usr-local/index.html

Cygwin root is D:\cygwin 
(eg. "cd /" in bash shell is equiv. to "cd d:\cygwin" in NT 
 cmd shell)
Apache is installed to c:/local/Apache.
Webroot folder is d:/var/www.


#grab Mapserver nightly.tar and msworkbench (11-Dec-2k)
  cd /usr/local/src
  wget http://mapserver.gis.umn.edu/dist/nightly.tar.gz
  wget http://www.nyx.net/~tpoindex/gis/msworkbench.tar.gz

#unpackage Mapserver and workbench
  gunzip -c nightly.tar.gz | tar xvf -
  cd /usr/local/src/mapserver/mapscript/tcl
  gunzip -c /usr/local/src/msworkbench.tar.gz | tar xvf -

#configure and compile mapserver
  cd /usr/local/src/mapserver
  ./configure --with-gd --with-tiff --with-jpeg --with-ttf
	#no errors or warnings were encountered,
	#was an error using '--with-proj'
  make
	#no errors, some warnings (see bottom of file)

  cp mapserv.exe //d/var/www/cgi-bin/

Pointing a web browser to http://localhost/cgi-bin/mapserv
yields:

	"No query information to decode. QUERY_STRING is set, 
	but empty. "

Which I find promising - the exe responds with a message,
not a segfault, blue screen of death or other unfortunate
mess.

Next I installed the demo so there was something to work
with:
  cd //d/var/www/htdocs/maps
  wget http://mapserver.gis.umn.edu/dist/ms_demo.tar.gz
  gunzip -c ms_demo.tar.gz |tar xvf -

Fire up web browser and loading
http://localhost/maps/demo_init.html yields:

	"msLoadMap(): Regular expression error. (\.map$)"

And now we are truly into territory I don't understand. 
Perusing the Mapserver 'readme.win32' I see a section on
RegEx library, which isn't installed by default on VC++ 
systems. However it does seem to be installed on a Cygwin
system:
	/etc/setup/regex.lst.gz
	/lib/libregex.a 
	/usr/include/regex.h 
	/usr/include/regexp.h 
	/usr/info/regex.info 
	/usr/lib/libregex.a 
	/usr/local/share/aclocal/regex.m4 
	/usr/share/iwidgets3.0.0/scripts/regexpfield.itk 	

Just in case I adapted the instructions for VCwin32:

  cd /usr/local/src/mapserver
  wget ftp://ftp.gnu.org/pub/gnu/regex/regex-0.12.tar.gz
  gunzip -c regex-0.12.tar.gz | tar xvf -

Added to the Makefile:

	REGEX_OBJ=./regex-0.12/regex.obj
	REGEX_INC=-I./regex-0.12
	REGEX_OPT=-DHAVE_STRING_H -DREGEX_MALLOC

And recompiled. No errors that weren't seen before. And
no change in the resultant mapserv.exe behaviour either.

Oh well. {shrug} it was still fun to try. The fact that I made it this far
with no obvious problems leads me to think it shouldn't bet that difficult
to get the rest of the way  -- for somebody who knows what the *** they are
doing that is. ;-)



#------------- make warnings for /usr/local/src/mapserver: -------------
maputil.c: In function `msDrawShapefileLayer':
maputil.c:1202: warning: assignment discards qualifiers from pointer target
type
...
maputil.c: In function `msSaveImage':
maputil.c:1731: warning: implicit declaration of function `_setmode'
maputil.c:1731: warning: implicit declaration of function `_fileno'
...
mapraster.c: In function `msDrawRasterLayer':
mapraster.c:1294: warning: assignment discards qualifiers from pointer
target type
mapraster.c: At top level:
mapraster.c:1028: warning: `drawGEN' defined but not used
...
shptree.c: In function `main':
shptree.c:38: warning: `filename' might be used uninitialized in this
function
shptree.c:40: warning: `byte_order' might be used uninitialized in this
function
...
shptreetst.c: In function `main':
shptreetst.c:68: warning: `node' might be used uninitialized in this
function



More information about the MapServer-users mailing list