[sword-devel] Building modules on Mac OS X

David Bell david.bell at bluebottle.com
Thu Dec 14 06:48:50 MST 2006

I posted here a few weeks ago about building modules. What I have  
learned in the past two weeks has been wonderful. So I thought I  
would put it all together for any others out there who are interested  
in using the Mac to develop Sword modules. If anyone sees any  
problems or clarifications, please feel free to add or clarify. If  
you try this on your computer and run into a snag, please post as  
well. These commands worked for me on my G5 iMac (PPC)

Here is the process for building the tools that you will need to turn  
text files into modules.
1. Install the developers tools from Apple (this should come  
uninstalled on your Mac or on a CD or DVD when you buy the System.

2. Download the latest version of Sword (http://www.crosswire.org/ 

3. Open Terminal and create a new directory (mkdir /sword) then copy  
your download to that directory (for example mv ~/Desktop/ 
sword-1.5.9.tar.gz /sword . (this step could be done in the Finder as  
well and may be more comfortable. The end result should be a folder  
entitled "sword-1.5.9 in the directory you have created)

4. Untar the download (tar -xzf sword-1.5.9.tar.gz /sword/ 
sword-1.5.9) (if you did the previous step in the finder, when you  
open up the terminal you need to make sure you navigate to the right  
directory: cd /sword)

5. Change to this directory (cd /sword/sword-1.5.9)

6. Configure the installation (./configure --prefix=/sword/ 
sword-1.5.9) (by the way, that's <hyphen> <hyphen> prefix)

7. Run the make command and then make install (make && make install).  
These two commands can also be run separately. If the directory where  
you are installing is not public (for example /opt/.. then you would  
have to run the second command as a root user.

You should now find a directory with the Sword project compiled for  
your Mac. In the /bin folder you will find the tools that you need to  
build modules or even edit modules. (to run the mod2* commands, you  
must have the modules installed in this folder, and not just in your  
MacSword folder). Double clicking the tools should run them empty in  
the terminal and give you some short instructions for their use.  
Check the module making guide on www.crosswire.org for further  
instructions. At this point you should have everything you need to  
download formatted files (from CCEL for example) and turn them into  
Sword modules.

However, if you are going to create your own files, you will have one  
more problem. The Mac treats line endings differently from other  
versions of *NIX. That means that the tools will not read your import  
file correctly, even though it looks like it is the correct format.  
The problem is very easy to fix. First of all, you can see if your  
file has a problem by typing the following command in the terminal:  
vi ~/Desktop/your_file.txt If you see M-s at the end of the lines,  
then you have Mac line breaks. Type the following command> perl -pi - 
e 's/\r/\n/g' <filename>. This should solve your problem and allow  
you to use the import or vpl tool without problems. (This information  
was taken from http://www.macosxhints.com/article.php? 

David Bell
david.bell at bluebottle.com
parati semper en MMVI dare omni rationem de ea quae en me est spe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20061214/3b1984dc/attachment.html 

More information about the sword-devel mailing list