lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compile for Mac


From: Carl Sorensen
Subject: Compile for Mac
Date: Fri, 11 Mar 2011 23:13:38 -0700

Tim Sheasby <tim <at> sheafpublishing.co.za> writes:

> 
> Using lilydev on a Virtual Box ubuntu machine ­ how do I compile a Mac binary?
> 
> Tim Sheasby
> tim <at> sheafpublishing.co.za

Ok, I just built LilyPond on OSX 10.6.  Takes a bit of time to get
everything set up,
but the build came off flawlessly.

Here's the recipe:

1. Install XCode.  I installed version 3.2.6, because it was free.

http://developer.apple.com/xcode/

Look for the "Looking for XCode 3?" link at the lower right of the screen.
Follow it.
You will need to sign up with Apple, but there's no cost.

2. Install MacPorts.  I installed version 1.9.2 for Snow Leopard.

http://www.macports.org/

3.  Edit my ~/.profile file to add the following lines:

export PATH=~/bin:/opt/local/bin:/opt/local/sbin:$PATH
export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib:$DYLD_FALLBACK_LIBRARY_PATH


4.  Install the necessary prerequisites for lilypond

sudo port install git-core
sudo port install guile
sudo port install fontforge
sudo port install mftrace
sudo port install flex
sudo port install netpbm
sudo port install fontconfig (This one was actually not necessary -- already
installed)
sudo port install pango (Also already installed)
sudo port install fondu
sudo port install t1utils

The next two ports are optional, but I did them anyway so I could
build the documentation.
sudo port install imagemagick
sudo port install dblatex

Create symlinks to libguile*.dylib called *.so

cd /opt/local/lib
ls -lG libguile* | grep lrwx

This gives a list of files in the form of

libguile-SPECIFIC_FILE_NAME.dylib -> libguile-LINKED_TO_FILE_NAME.dylib

For each of those files, do

ln -s libguile-LINKED_TO_FILE_NAME.dylib libguile-SPECIFIC_FILE_NAME.so

Now it's time to go get set up with lilypond.

cd ~
mkdir my-lily-source  (or whatever you want to call it)
cd my-lily-source
git clone git://sv.gnu.org/lilypond.git

copy the following into ~/bin/lilypond-configure:

#! /bin/bash
# find fontconfig, freetype and pango from DarwinPorts
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
CXXFLAGS="-I/opt/local/include"
# -shared flag does not work on mac os x
SHARED_FLAGS="-bundle -flat_namespace -undefined suppress"
LDFLAGS="-L/opt/local/lib -lexpat"
# where New Century School Book .pfb files are located:
NCSB_DIR="/opt/local/share/ghostscript/fonts"

./autogen.sh --noconf
rm -f config.cache
PKG_CONFIG_PATH="$PKG_CONFIG_PATH" SHARED_FLAGS="$SHARED_FLAGS" \
       CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix=$(pwd) \
       --infodir=$(pwd)/out/share/info \
       --with-ncsb-dir="$NCSB_DIR"


make it executable:

chmod +x ~/bin/lilypond-configure

copy the following into ~/bin/fix-lily-configure


#!/bin/bash
sed  -i bak 's:usr/include/FlexLexer.h:opt/local/include/Flexlexer.h:'
config.make

make it executable:

chmod +x ~/bin/fix-lily-configure

Now it's time to configure lilypond:

lilypond-configure

Then you fix your configuration:

fix-lily-configure

Finally, you make lilypond

make




HTH,

Carl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]