[mapserver-users] Mapscript Perl examples - XBase.pm

Janet Ciavarelli Jciavarelli at city.kamloops.bc.ca
Mon May 7 14:01:17 PDT 2001


Just off of the top of my head, and please note that I used VC++ and Active X Perl.
Also, you should have a similar directory structure to the following for install purposes:
    g:\mapserver
                         \cvs
                         \fonts   (I don't have true type fonts installed yet)
                         \gd-1.2
                         \gdft
                         \mapscript
                         \regex-0.12    (get this off the internet as in the install doc)
                         \symbols
                         \tmp    

So it would really depend on your environment but if you're using this same environment, here's all what I did.

The key things that I did were:

- upgraded VC++ to Service Pack 5 (available at msn support on Internet)
- upgraded Active X Perl to the latest version (again on Internet)
- Install SWIG 1.1 (available on Internet)
- Make sure you add the VC98 lib, gd-1.2 lib and mapserver to your LIB system variable. (Do this in control panel-->System-->Environment)
  Here's what my Lib and INCLUDE values are set to:
     LIB=C:\Program Files\MTS\Lib;c:\Program Files\Microsoft Visual Studio\VC98\Lib;g:\mapserver\gd-1.2;g:\mapserver
     INCLUDE=C:\Program Files\MTS\Include;c:\Program Files\Microsoft Visual Studio\VC98\CRT\SRC;c:\Program Files\Microsoft Visual Studio\VC98\Include;g:\mapserver;g:\mapserver\regex-0.12

- build mapserver first. This one is fairly straightforward and works as in the documentation. Do nmake makefile.vc if I remember correctly.

Adding the mapscript extension to Active X Perl

- Now in your mapserver folder, you will need to run Makefile.in to create a perlvars file
     - del perlvars (if there's already one there)
     - copy Makefile.in Makefile
     - nmake perlvars (See my attached perlvars file below). This file is important for the build we will do in mapserver\mapscript\perl. Feel free to use my perlvars file and just edit it to your correct paths. 
- Go to your mapserver\mapscript\perl directory. This is where the fun begins:
- Basically we need to do everything in the README file:
      perl Makefile.PL
      make
      make install

   The hard part is getting it all to work. I will include a copy of my Makefile and you can do a diff on it to see what I've all customized to get it to work. But I will highlight here what I remember were the key problems:
    - perl Makefile.PL
           This is fairly straightforward and I don't remember making changes to the Makefile.PL. It does use the perlvars file though and it is very important that this file exists 2 directories up in the mapserver directory.
    - The next thing is to figure out if you have to use nmake or dmake. The Active Perl web site has a good documenation page on this.  For my system, nmake was the way to go, and I believe that was cause I was using VC++ compiler. However, notice the documentation says make. I tried this at first but it did not get me very far. 
    - After running nmake about 2000 times, these are the things I had to change to get it to successfully compile. I had to do a lot of editting to the Makefile generated from the perl Makefile.PL. 
         Key Problems
         - change the :: to :  but not all of them though. Only the ones that are not used in Perl commands. See my attached Makefile.
         - had to make one change in the map.h file. I had to comment out the call to malloc.h It must have been called from somewhere else already or maybe VC++ includes it by default. Either way, the only way I could get a successful compile was by commenting it out. See my attached map.h file line 17.
         - I had to add a bunch of libraries. Again see my Makefile for this. In particular, see LDLOADLIBS and EXTRALIBS
         - I also had to comment out the pm_to_blib lines in the Makefile (near the bottom. See my Makefile). Not sure if this is important or not but mine works fine without it.
         - I might have made more changes than this, but don't remember. Checkout my makefile for all the details. Also, last but not least was the VC98 libc.lib library. Don't forget this one. It's needed at Link time. 
         - Also, a successful build of the mapsciprt perl extension will create a bunch of subdirectories under your perl directory unless you have your INSTALLDIRS set to something different than site. Mine was set to site and created all of the following directory structure: blib-->arch-->auto-->mapscript which will be used in the next step to install the extension into Perl. To find more Information on the MakeMaker command, see the Perl\html\lib\ExtUtils\MakeMaker.html in your Perl installation. 

       To install
    - Then the install is fairly straightforward, and don't forget to use the corrent make command, in my case nmake. So nmake install and it installed fine. 

And last but not least, don't forget patience. 
Hope this helps. 

Janet.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: perlvars
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010507/42d35526/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MAKEFILE
Type: application/octet-stream
Size: 25297 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010507/42d35526/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map.h
Type: application/octet-stream
Size: 21616 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010507/42d35526/attachment-0001.obj>


More information about the MapServer-users mailing list