For build compatibility reasons MSVC is probably the best choice of compiler, followed by gcc, i'm using BCB so go figure.
To begin with you will need:
- latest sc3 source from cvs http://sourceforge.net/projects/supercollider
- libsndfile from http://www.zip.com.au/~erikd/libsndfile/
- win32 pthreads from http://sources.redhat.com/pthreads-win32/
- a current PortAudio V19 snapshot from http://www.portaudio.com/usingcvs.html
The general idea is to make DLLs for libsndfile and pthreads, to build the sc server into an exe, and build each plugin into a separate dll (these go in a /plugins directory when you've finished). PortAudio can be linked statically or as a DLL. It's important for libsndfile and pthreads to be DLLs so they can be accessed from the plugins.
Depending on whether your compiler is supported by libsndfile or pthreads-win32 you may need to know something about .def files to get the DLL exports working properly.
building the server
- add all files in source/server and source/common to project except for Rendezvous.c and dlopen.c
- added \headers\server, headers\common, headers\plugin_interface to include path
- define SC_WIN32
- you may also need a .def file for the plugins, something like:
LIBRARY portaudio.dll EXPORTS ; load _load
Below are some further build notes I made as I was working, it's probably best to ignore them unless you encounter problems. Better to read the documentation that comes with the libraries.
libsndfile
- copy sndfile.h amd unistd.h from /Win32 to /src
- turned off a few warnings so the thing compiles
- added \. and \Win32 to include path
- if you get problems with _lseeki64 and _telli64 being undefined ask Erik for the latest 1.0.6 pre-release in which i rewrote the file i/o layer to use native Win32 calls.
pthreads-win32
- added pthreads_snap_2003_09_18 to the include path
- added following files to project (according to Nmakefile): attr.c barrier.c cancel.c cleanup.c condvar.c create.c dll.c exit.c fork.c global.c misc.c mutex.c private.c rwlock.c sched.c semaphore.c spin.c sync.c tsd.c nonportable.c
- ENOSYS is not defined by BCB headers, so added the following to pthread.h:
#ifndef ENOSYS #define ENOSYS EINVFNC #endif #ifndef EDEADLK #define EDEADLK EDEADLOCK #endif
- changed _ftime and _timeb to ftime and timeb in sem_timedwait.c and pthread_mutex_timedlock.c :
##ifdef __BORLANDC__ ##define _ftime ftime ##define _timeb timeb ##endif
portaudio v19-devel
- if you want ASIO support you'll need to get the ASIO SDK, otherwise make sure PA_NO_ASIO is defined
- Ross B.