Libsmf

Building libsmf on Darwin
The main issue is building *universal binaries*.

Darwin Dependencies

=
======

Use MacPorts to build all dependencies. *Remember* to install the 'universal' variants.



sudo port install libiconv +universal sudo port install gettext +universal

Building GLib Universal Binary Static Library on Darwin

=
==========================================

This is quite involved, but here's how::

sudo port install gnome-doc-utils sudo port install gtk-doc svn co http://svn.gnome.org/svn/glib/trunk glib2 cd glib2

Replace all occurences of 'libtoolize' with 'glibtoolize' in autogen.sh, and build the ppc lib::

./autogen.sh ./configure CFLAGS="-arch ppc" CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" --prefix="/opt/local" --enable-static --disable-shared make

Check and retrieve ppc lib::

$ find. -name 'libglib*.a' ./glib/.libs/libglib-2.0.a

$ lipo -info glib/.libs/libglib-2.0.a input file glib/.libs/libglib-2.0.a is not a fat file Non-fat file: glib/.libs/libglib-2.0.a is architecture: ppc7400

$ cp glib/.libs/libglib-2.0.a libglib-2.0-ppc.a

Then build the i386 lib::

make clean ./configure CFLAGS="-arch i386" CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" --prefix="/opt/local" --enable-static --disable-shared make

Check and retrieve i386 lib::

$ find. -name 'libglib*.a' ./glib/.libs/libglib-2.0.a ./libglib-2.0-ppc.a

$ lipo -info glib/.libs/libglib-2.0.a input file glib/.libs/libglib-2.0.a is not a fat file Non-fat file: glib/.libs/libglib-2.0.a is architecture: i386

$ cp glib/.libs/libglib-2.0.a libglib-2.0-i386.a

Make Universal Binary::

$ lipo -create libglib-2.0-*.a -o libglib-2.0.a $ lipo -info libglib-2.0.a Architectures in the fat file: libglib-2.0.a are: i386 ppc7400

DONE!

Build libsmf

=
Download and unpack libsmf source, e.g.::

curl -O 'http://pin.if.uz.zgora.pl/~trasz/libsmf/libsmf-1.1.tar.gz' tar xvzf libsmf-1.1.tar.gz   rm libsmf-1.1.tar.gz

Configure libsmf::

cd libsmf-1.1/ ./configure

Compile libsmf::

gcc -arch i386 -arch ppc -DPACKAGE_VERSION=\"1.1\" `pkg-config --cflags glib-2.0` -c src/*.c   libtool -static *.o -o libsmf.a

Building libsmf using MinGW / MSYS
Windows Dependencies

=
=======

libsmf pkg-config ( http://pkgconfig.freedesktop.org/releases/ ) mingw/msys libintl: msys supplementary tools ( http://sourceforge.net/project/showfiles.php?group_id=2435 ): gettext-MSYS - copy to c:\msys\1.0\local libiconv: msys supplementary tools: libiconv-MSYS - copy to c:\msys\1.0\local glib win32 dev ( http://www.gtk.org/download-windows.html ) - copy to c:\msys\1.0\local

Please note that ``dependencies/win32/libglib-2.0-0.dll`` must be in the directory *from which the unity exe is run* for the plugin to work with Windows.

Compiling libsmf::

PKG_CONFIG_PATH="/local/lib/pkgconfig" ./configure

replace all ``#include `` from ``*.c`` files with ``#include ``::

make

ignore that smfsh fails to compile (we don't need it), and run::

ar -rcs libsmf.a src/*.o

Compiling PortMidi::

gcc -c -Iporttime pm_common/*.c   gcc -c -Ipm_common/ -Iporttime pm_win/*.c    gcc -c porttime/porttime.c    gcc -c porttime/ptwinmm.c    ar -rcs libportmidi.a *.o