#Copyright (C) 1998 Tuomas J. Lukka, 2001, 2002 John Stewart, CRC Canada.
#DISTRIBUTED WITH NO WARRANTY, EXPRESS OR IMPLIED.
#See the GNU Library General Public License (file COPYING in the distribution)
#for conditions of use and redistribution, EXCEPT on the files
#which belong under the mozilla public license.

Macintosh Installation Instructions



The following instructions are for buidling FreeWRL as a standalone executable running under XDarwin on Mac OS X. The release of Mac OS X used was Mac OS X v 10.2.3. The instructions assume that you are starting with a freshly installed Mac OS system, and all supporting packages required are listed and referenced. You may already have some of these packages installed on your system. If so, you may be able to skip some or all of the first six steps.



Step 1. Download and install the developer tools for Mac OS X from connect.apple.com. This pacakge is self installing.



Step 2. Download and install the XonX XFree86 package from www.sourceforge.org. This package is self installing. This package allows you to run Xwindows in rootless mode on your system, and supports X extensions required by FreeWRL.



Step 3. Download and install the ImageMagick package from www.entropy.ch/software/macosx/. The package available from this location is self-installing and requires no tweaking to install on Darwin.



Step 4. Download and install the libjpeg package from www.freshmeat.net. This package looks for a man directory as specified in the Makefile. Edit the makefile to point to a valid directory on your system before running make. Change into the directory and



./configure

make

make install



Step 5. Download and install the zlib and libpng packages from www.sourceforge.org. Rename the source directories to simply "zlib" and "libpng" and make sure that they are in the same subdirectory. Install the zlib package first, then the libpng package. Change into the zlib directory and



./configure

make

make install



Then change into the libpng directory and



cp scripts/makefile.macosx makefile

make

make install



Step 6. Download and install Freetype2 version 2.0.9 from freetype.sourceforge.org. You will need to move /usr/local/include/freetype2/freetype to /usr/local/include/freetype after installation. Change into the freetype directory and



./configure

make

make install

cp -r /usr/local/include/freetype2/freetype /usr/local/include/freetype

rm -r /usr/local/include/freetype2/freetype



Step 7. Install the following perl modules available from the CPAN website.



Digest-MD5-2.23

HTML-Parser-3.27

MIME-Base64-2.16

URI-1.23

libnet-1.12

libwww-perl-5.68

Image-Base-1.07



Note that the version numbers above are current as of the writing of this document. They may have been increased.



To install each of these modules, untar them, go into their directories, and

perl Makefile.PL

make

make test (if applicable)

make install



Note that libwww-perl may ask you if you want to reconfigure. I always just select the default.



Step 8. Download the FreeWRL source code. Now to the actual installation of FreeWRL!



Step 9. Rename the file vrml.conf.macosx to vrml.conf. Check that the directories for the libaries in this file are correct. If you followed the instructions above, they should be, with the exception of the JPEG libraries and includes which will have to point to the directory in which you installed the jpeg-6b package.



Step 10. A couple of the FreeWRL filenames seem to be too long for the Mac system to pick up properly for some reason. You should rename them so that they have the appropriate names.

mv java/classes/vrml/external/FreeWRLEAI/UnsupportedFieldTypeException.c java/classes/vrml/external/FreeWRLEAI/UnsupportedFieldTypeException.class



mv java/classes/vrml/external/FreeWRLEAI/UnsupportedFieldTypeException.j

java/classes/vrml/external/FreeWRLEAI/UnsupportedFieldTypeException.java



Step 11. Modify your vrml.conf file to point to the correct Javascript library.

In the vrml.conf file your JS_LIBS and JS_INC variables must be modified to point to the directories for the version of Darwin installed on your machine. The include directory -Ijs/src/Darwin5.2.2_OPT.OBJ and the library directory -Ljs/src/Darwin5.2.2_OPT.OBJ must be modified to js/src/Darwin*_OPT.OBJ, where * is the version of Darwin installed on your machine. You can check which version of Darwin you are running by entering "uname -a" at the command prompt. Note that you may also need to add a mk file for your version of Darwin to the JS/js/src/config directory if one does not exist. If a .mk file is not listed for your version of Darwin in the JS/js/src/config directory you can create one by copying one of the other Darwin mk files to a new file with the appropriate version name. For example, if your version of Darwin is 5.2.2 and no Darwin5.2.2.mk file is listed in the JS/js/src/config directory, you will have to create one by issuing the command "cp Darwin.mk Darwin5.2.2.mk" in the JS/js/src/config directory. Any of the Darwin mk files may be copied to create the mk file for your system, with the following caveat: Mac OS X Jaguar installations (Darwin 6.0 and beyond) must copy a mk file for Darwin6.0 or greater; Mac OS X 10.1 installations must copy a mk file for a Darwin version earlier than 6.0

Step 12. Modify the sv.h perl header file

There is a problem with one of the perl header files which stops the FreeWRL installation process. In order to fix this problem you must comment out one of the lines in /System/Library/Perl/darwin/CORE/sv.h. Line 356: DIR * xio_dirp; /* for opendir, readdir, etc */ must be commented out. You can do this by inserting two forward slash characters (//) at the start of this line. Once you have done this the line 356 will read:

// DIR * xio_dirp; /* for opendir, readdir, etc */

Step 13. Make the Makefile

perl Makefile.PL



Step 14. run ranlib on /usr/local/lib/libpng.a

ranlib /usr/local/lib/libpng.a



Step 15. Build and install FreeWRL

make

make install



You should now be able to successfully run all of the tests in the tests directory from an X command prompt.