wiki:Build/OSX

OSX

Notice: Do not use this as an example for building on Unix! They are very different!

OS X requires more effort than most platforms, you're on your own for building any Dependencies. However this page will attempt to give some tips on building each.

Don't forget to swap <user> for your username.

The following instructions apply to Aegisub trunk only, if you want to build a branch you're on your own.


Dependencies

The current Aegisub build does not support using macports or fink and never will. In order to build it is required you build every dependency by hand and install them in a local directory.

This is required in order to ensure the same environment is used as the other developers. While it may take some work to get started once it has been set up it is not much work to maintain.

See Build/Deps for a list of dependencies, please note that OS X uses wxWidgets trunk only for trunk and all branches.

Note
Anything not listed here can be configured with a simple prefix with no other options.

wxWidgets

PATH="/Users/<user>/prefix/bin:/usr/bin:/bin:/usr/sbin:/sbin" \
LDFLAGS="-L/Users/<user>/prefix/lib" \
CPPFLAGS="-I/Users/<user>/prefix/include" \
CXXFLAGS="-I/Users/<user>/prefix/include" \
CFLAGS="-I/Users/<user>/prefix/include" \
./configure \
--prefix=/Users/<user>/prefix \
--enable-unicode \
--with-opengl \
--with-libtiff=sys \
--with-expat=sys \
--with-zlib=sys \
--enable-debug \
--enable-debug_info \
--enable-debug_gdb \
--enable-intl \
--with-osx_cocoa \
--enable-std_iostreams

FFMPEG

You can of course add any additional codecs and support as you wish, the ones listed here are the absolute minimum. Also you need to install the dependencies first, eg: xvid, lame and faac.

./configure 
--prefix=/Users/<user>/prefix 
--extra-cflags="-I/Users/<user>/prefix/include" 
--extra-ldflags="-L/Users/<user>/prefix/lib" 
--enable-shared 
--enable-gpl 
--enable-postproc 
--enable-libxvid 
--enable-libmp3lame 
--enable-libfaac

FontConfig

./configure 
--with-old-mac-fonts 
--prefix=/Users/<user>/prefix

FreeType

./configure 
--prefix=/Users/<user>/prefix 
--with-old-mac-fonts

libjpeg

./configure 
--prefix=/Users/<user>/prefix 
--enable-shared 
--enable-static

Building

Autogen

ACLOCAL_FLAGS="-I /Users/<user>/prefix/share/aclocal -I /Developer/usr/share/aclocal 
AUTOMAKE=/Users/<user>/prefix/bin/automake-1.9 
ACLOCAL=/Users/<user>/prefix/bin/aclocal-1.9 
AUTOCONF=/Users/<user>/prefix/bin/autoconf 
AUTOHEADER=/Users/<user>/prefix/bin/autoheader
./autogen.sh

Configure

PKG_CONFIG=/Users/<user>/prefix/bin/pkg-config 
PKG_CONFIG_PATH="/Users/<user>/prefix/lib/pkgconfig" 
CXXFLAGS="-I/Users/<user>/prefix/include" 
LDFLAGS="-L/Users/<user>/prefix/lib" 
LUA_CFLAGS="-I/Users/<user>/prefix/include/lua51" 
LUA_LDFLAGS="-L/Users/<user>/prefix/lib/lua51 -llua" 
OPENAL_CFLAGS="-framework OpenAL" 
OPENAL_LIBS="-framework OpenAL" 
CFLAGS="-I/Developer/SDKs/MacOSX10.5.sdk/usr/include" 
ICONV_LDFLAGS="/usr/lib/libiconv.dylib" 
./configure 
--enable-maintainer-mode 
--with-apple-opengl-framework 
--with-wx-config="/Users/verm/<user>/lib/wx/config/osx_cocoa-unicode-2.9" 
--enable-debug

Packaging

Bundle

# make osx-bundle

Will get you a bundle.

DMG

# make osx-dmg

Will get you a dmg.